Updated on 2023-12-18 GMT+08:00

Adding a Listener

API Format

Method

URI

Description

POST

/v2.0/lbaas/listeners

Adds a listener.

Constraints

Each listener added a load balancer can listen on only one port.

Procedure

  1. Set the request header. Set the header in Postman and place the obtained token in the header.

  2. Under Body, set the request body.

  3. Enter the URL.

    https://elb.cn-east-2.myhuaweicloud.com/v2.0/lbaas/listeners

  4. Send the request. Set the POST request method and click Send to wait for response from the server.

    {
        "listener": {
            "protocol_port": 80,
            "protocol": "HTTP",
            "description": "",
            "default_tls_container_ref": null,
            "admin_state_up": true,
            "loadbalancers": [
                {
                    "id": "abe3ee34-1882-408f-a2ba-1ce7e428d6e3"
                }
            ],
            "tenant_id": "0d0bf0e8fb564cc9abbe526dbdca9248",
            "sni_container_refs": [],
            "connection_limit": -1,
            "default_pool_id": null,
            "id": "779d77c8-f3f9-486d-a598-18e2aa2aa319",
            "name": "listener4guide"
        }
    }

Sample Code

Request body in 2

{
    "listener": {
        "protocol_port": "80",
        "protocol": "HTTP",
        "loadbalancer_id": "abe3ee34-1882-408f-a2ba-1ce7e428d6e3",
        "name": "listener4guide",
        "admin_state_up": true
    }
}