• Elastic Load Balancing

elb
  1. Help Center
  2. Elastic Load Balancing
  3. API Reference
  4. Classic Load Balancer APIs
  5. Listener
  6. Modifying a Listener

Modifying a Listener

Function

This API is used to modify the listener information, including the listener name, description, and status.

URI

PUT /v1.0/{project_id}/elbaas/listeners/{listener_id}
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID of the operator.

listener_id

Yes

String

Specifies the listener ID.

name

No

String

  • Specifies the listener name.
  • The value is a string of 1 to 64 characters that consist of Chinese characters, letters, digits, underscores (_), and hyphens (-).

description

No

String

  • Provides supplementary information about the listener.
  • The value is a string of 0 to 128 characters and cannot contain angle brackets (< and >).

port

No

Integer

  • Specifies the listening port.
  • The port number ranges from 1 to 65535.

backend_port

No

Integer

  • Specifies the backend port.
  • The port number ranges from 1 to 65535.

lb_algorithm

No

String

  • Specifies the load balancing algorithm.
  • The value can be roundrobin, leastconn, or source.

tcp_timeout

No

Integer

  • Specifies the TCP session timeout duration. This parameter is valid when protocol is set to TCP.
  • The value ranges from 1 to 1440.

tcp_draining

No

Boolean

  • Specifies whether to maintain TCP connections to a backend ECS that has been removed. This parameter is valid when protocol is set to TCP.
  • The value can be true or false.

tcp_draining_timeout

No

Integer

  • Specifies the timeout duration for maintaining TCP connections to a backend ECS that has been removed. The unit is minute.

    This parameter is valid when protocol is set to TCP and tcp_draining to true.

  • The value ranges from 0 to 60.

udp_timeout

No

Integer

  • Specifies the UDP session timeout duration. This parameter is valid when protocol is set to UDP.
  • The value ranges from 1 to 1440.

client_ca_tls_container_ref

No

String

  • Specifies the client certificate ID.

ssl_protocols

No

String

  • Specifies the supported SSL/TLS protocol version. This parameter is valid only when protocol is set to HTTPS or SSL.
  • The value is TLSv1.2 or TLSv1.2 TLSv1.1 TLSv1 and the default value is TLSv1.2.

ssl_ciphers

No

String

  • Specifies the cipher suites supported by a specific SSL/TLS protocol version. This parameter is valid only when protocol is set to HTTPS or SSL.
  • The value is Default, Extended, or Strict.

    The value of Default is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256.

    The value of Extended is ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:AES128-SHA256:AES256-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-SHA:AES256-SHA:DHE-DSS-AES128-SHA:CAMELLIA128-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA:ECDHE-RSA-RC4-SHA:RC4-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:CAMELLIA256-SHA:EDH-DSS-DES-CBC3-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA.

    The value of Strict is ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256.

    The default value is Default. The value can only be set to Extended if ssl_protocols is set to TLSv1.2 TLSv1.1 TLSv1.

certificate_id

No

String

  • Specifies the default certificate ID. This parameter is mandatory when protocol is set to HTTPS or SSL.
  • The ID can be obtained from details about the certificate.

certificates

No

List<String>

  • Lists the certificate IDs if protocol is set to HTTPS.
  • This parameter is mandatory in the SNI scenario.
  • This parameter is valid only when the load balancer is a public network load balancer.

Request

  • Request parameters

    None

  • Example request
    {
        "name": "lis",
        "description": "",
        "port": 9090,
        "backend_port": 9090,
        "lb_algorithm": "roundrobin"
    }

Response

  • Response parameters
    Table 2 Parameter description

    Parameter

    Type

    Description

    update_time

    String

    Specifies the time when the listener was updated.

    backend_port

    Integer

    Specifies the backend port.

    id

    String

    Specifies the listener ID in UUID format.

    backend_protocol

    String

    Specifies the protocol the backend ECSs use to receive requests.

    sticky_session_type

    String

    • Specifies the cookie processing method.
    • The default value is insert, indicating that the cookie is inserted by the load balancer.
    • This parameter is valid when protocol is set to HTTP and session_sticky to true. This parameter is invalid when protocol is set to TCP, which means that the parameter is unavailable or its value is set to null.

    description

    String

    Provides supplementary information about the listener.

    loadbalancer_id

    String

    Specifies the ID of the load balancer to which the listener is added.

    create_time

    String

    Specifies the time when the listener was created.

    status

    String

    Specifies the listener status. The value can be ACTIVE, PENDING_CREATE, or ERROR.

    protocol

    String

    Specifies the protocol used for load balancing at layer 4 or layer 7.

    port

    Integer

    Specifies the listening port.

    cookie_timeout

    Integer

    • Specifies the cookie timeout duration. This parameter is valid when session_sticky is set to true and sticky_session_type to insert.
    • The value ranges from 1 to 1440.

    client_ca_tls_container_ref

    String

    • Specifies the client certificate ID.

    admin_state_up

    Boolean

    • Specifies the administrative status of the load balancer.
    • Two options are available:

      false: The load balancer is disabled.

      true: The load balancer is working properly.

    healthcheck_id

    String

    Specifies the health check ID.

    session_sticky

    Boolean

    Specifies whether to enable the sticky session feature. The feature is enabled when the value is true. This parameter is valid only when protocol is set to HTTP.

    lb_algorithm

    String

    Specifies the load balancing algorithm.

    name

    String

    Specifies the listener name.

    tcp_draining

    Boolean

    • Specifies whether to maintain TCP connections to a backend ECS that has been removed. This parameter is valid when protocol is set to TCP.
    • The value can be true or false.

    tcp_draining_timeout

    Integer

    • Specifies the timeout duration for maintaining TCP connections to a backend ECS that has been removed. The unit is minute.

      This parameter is valid when protocol is set to TCP and tcp_draining to true.

    • The value ranges from 0 to 60.

    certificate_id

    String

    Specifies the ID of the SSL certificate for security authentication.

    This parameter is mandatory when protocol is set to HTTPS or SSL. Otherwise, the parameter value is null.

    certificates

    List<string>

    Lists the certificate IDs if protocol is set to HTTPS.

    This parameter is mandatory in the SNI scenario.

  • Example response
    {
        "update_time": "2016-12-01 07:12:59",
        "backend_port": 9090,
        "id": "a824584fb3ba4d39ba0cf372c7cbbb67",
        "backend_protocol": "TCP",
        "sticky_session_type": null,
        "certificate_id": null,
        "description": "",
        "loadbalancer_id": "f54c65b1b5dd4a4f95b71b44796ac013",
        "create_time": "2016-12-01 07:12:43",
        "admin_state_up": false,
        "status": "ACTIVE",
        "protocol": "TCP",
        "cookie_timeout": 100,
        "port": 9092,
        "tcp_draining": true,
        "tcp_timeout": 1,
        "client_ca_tls_container_ref": null,
        "lb_algorithm": "roundrobin",
        "healthcheck_id": null,
        "session_sticky": true,
        "tcp_draining_timeout": 5,
        "name": "lis"
    
    }

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 badRequest

    Request error.

    401 unauthorized

    Authentication failed.

    403 userDisabled

    You do not have the rights to perform the operation.

    404 Not Found

    The requested page does not exist.

    500 authFault

    System error.

    503 serviceUnavailable

    The service is unavailable.