• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. LBaas
  6. Create listener

Create listener

Function Description

This interface is used to create a listener.

Interface Format

Method

URI

Description

POST

/v2.0/lbaas/listeners

Creates a listener.

Restrictions

  • Only the administrator can specify the value of connection_limit.
  • You cannot specify the values of default_pool_iddefault_tls_container_ref, and sni_container_refs to create a listener.
  • The value of protocol can be only TCP or HTTP.
  • In DR mode, protocol is set to TCP, and protocol_port is set to 0.

The value of parameter admin_state_up must be set to true.

Request Parameter

Parameter

Type

Mandatory

Description

listener

Dict

Yes

Specifies the listener. For details, see Table 2.

The protocol_portprotocol, and loadbalancer_id fields are mandatory.

Response Parameter

Parameter

Type

Mandatory

Description

listener

Dict

Yes

Specifies the listener. For details, see Table 2.

Request Example

POST  /v2.0/lbaas/listener
{
    "listener": {
        "protocol_port": "80",
        "protocol": "TCP",
        "loadbalancer_id": "0416b6f1-877f-4a51-987e-978b3f084253",
        "name": "listener-test",
        "admin_state_up": true
    }
}

Response Example

{
    "listener": {
        "protocol_port": 80,
        "protocol": "TCP",
        "description": "",
        "default_tls_container_ref": null,
        "admin_state_up": true,
        "loadbalancers": [
            {
                "id": "0416b6f1-877f-4a51-987e-978b3f084253"
            }
        ],
        "tenant_id": "145483a5107745e9b3d80f956713e6a3",
        "sni_container_refs": [],
        "connection_limit": -1,
        "default_pool_id": null,
        "id": "b7f32b52-6f17-4b16-9ec8-063d71b653ce",
        "name": "listener-test"
    }
}

Error Code

See section Return Code Processing.