ModifyListener

1. API Description

This API is used to modify the properties of a load balance listener, including its name, health check parameters, and forwarding rules. The listening protocol cannot be modified.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

loadBalancerId

Yes

String

Load balancer ID.

listenerId

Yes

String

The listener ID of the load balancer.

listenerName

No

String

The name of the listener for the load balancer.

It will not be modified if not passed in.

healthCheck

No

The health check for the listener of the load balancer.

It will not be modified if not passed in. To enable or disable it, please set the HealthCheck.enabled field.

scheduler

No

The scheduling method for the listener of the load balancer.

It will not be modified if not passed in.

port

No

String

Listening port.

Multiple ports are separated by commas.

When the port is a range, connect with -, for example: 10000-10005.

The value range of the port is 1 to 65535.

It will not be modified if not specified.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required to locate a problem.

4. Code Example

Modify the name, health check parameters, and forwarding rules of a load balance listener.

POST /api/v2/zlb HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ModifyListener
<Common Request Params>

Request:
{
  "loadBalancerId" : "<loadBalancerId>",
  "listenerId" : "<listenerId>",
  "listenerName" : "sampleName",
  "healthCheck" : {
    "enabled": true,
    "checkType": "PING_CHECK",
    "checkPort": 0,
    "checkDelayLoop": 4,
    "checkConnTimeout": 3,
    "checkRetry": 4,
    "checkDelayTry": 5,
    "checkHttpGetUrl": "",
    "checkHttpStatusCode": null
  },
  "scheduler" : "mh"
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

HTTP Status Code
Error code
Description

404

INVALID_LB_LISTENER_NOT_FOUND

The load balancer listener does not exist.

400

INVALID_PORT_FORMAT_ERROR

Invalid port format.

400

INVALID_LISTENER_PORT_CONFLICT

The port conflicts with other ports of the listener.

400

INVALID_PORT_RANGE

Invalid port range. The port range should be between 1 and 65535.

400

INVALID_LISTENER_PORT_CONFLICT_SELF

The currently configured port is invalid and conflicts with another.

Last updated