Copying a Listener
Function
This API is used to copy a listener from a load balancer to another in the same VPC.
Note the following when copying a listener:
-
You can only copy a listener from a load balancer to another in the same VPC.
-
Listeners of gateway load balancers cannot be copied, and listeners of other types of load balancers cannot be copied to gateway load balancers.
-
You can only copy a listener from a load balancer to another of the same type.
-
The original listener cannot have more than 1,000 backend servers and 100 forwarding policies.
-
The source and destination load balancers cannot be frozen or migrated.
-
If quic_config of the original listener is configured, quic_config of the new listener will be null.
-
If a redirection is configured for the original listener, this forwarding policy will not be copied.
Calling Method
For details, see Calling APIs.
URI
POST /v3/{project_id}/elb/listeners/{listener_id}/clone
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. Constraints: N/A Range: The value can contain a maximum of 32 characters, including digits and lowercase letters. Default value: N/A |
|
listener_id |
Yes |
String |
Definition: Specifies the ID of the listener to be copied. Constraints: N/A Range: The ID must be in UUID format and can contain up to 36 characters. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: Specifies the token used for IAM authentication. Constraints: N/A Range: N/A Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
target_listener_params |
Yes |
Array of CloneListenerOption objects |
Definition: Specifies the configurations of the new listener. Constraints: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Definition: Specifies the name of the new listener. Constraints: N/A Range: The value contains 0 to 255 characters. If an empty string is specified, the default value is used. Default value: original listener name-copy |
|
loadbalancer_id |
Yes |
String |
Definition: Specifies the ID of the load balancer to which the new listener is copied. Constraints:
Range: The ID must be in UUID format and can contain up to 36 characters. Default value: N/A |
|
protocol_port |
No |
Integer |
Definition: Specifies the port used by the new listener. Constraints:
Range: 0 to 65535 Default value: N/A |
|
port_ranges |
No |
Array of PortRange objects |
Definition: Specifies one or more port ranges, including the start and end port numbers. A maximum of 10 port ranges can be specified. Port ranges cannot overlap with each other. Constraints:
|
|
reuse_pool |
No |
Boolean |
Definition: Specifies whether to reuse or copy the backend server groups and backend servers of the original listener.
Constraints: Range: Default value: false |
|
subnet_mapping_list |
No |
Array of SubnetMappingList objects |
Definition: Specifies the IDs of the subnets where the original and new listeners' backend servers are running. Constraints:
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
start_port |
No |
Integer |
Definition: Specifies the start port number. Constraints: N/A Range: 1-65535 Default value: N/A |
|
end_port |
No |
Integer |
Definition: Specifies the end port number. Constraints: The value must be greater than or equal to the start port number. Range: 1-65535 Default value: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
subnet_cidr_id |
Yes |
String |
Definition: Specifies the ID of the subnet in the VPC where the original listener's backend servers are running. Constraints: N/A Range: The ID must be in UUID format and can contain up to 36 characters. Default value: N/A |
|
dst_subnet_cidr_id |
Yes |
String |
Definition: Specifies the ID of the subnet in the VPC where the new listener's backend servers are running. Constraints: The VPC subnet ID must exist and must have the same CIDR block as that defined by subnet_cidr_id. Range: The ID must be in UUID format and can contain up to 36 characters. Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
listener_list |
Array of CloneListenerResp objects |
Definition: Specifies the information about the new listener. |
|
request_id |
String |
Definition: Specifies the request ID. Range: The value is automatically generated, and can contain characters including digits, lowercase letters, and hyphens (-). |
|
job_id |
String |
Definition: Specifies the ID of the listener copy task. You can query the task details by calling the API (GET /v3/{project_id}/elb/jobs/{job_id}). Range: The ID must be in UUID format and can contain up to 36 characters. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Specifies the ID of the new listener. Range: The ID must be in UUID format and can contain up to 36 characters. |
|
loadbalancer_id |
String |
Definition: Specifies the ID of the destination load balancer. Range: The ID must be in UUID format and can contain up to 36 characters. |
|
protocol_port |
Integer |
Definition: Specifies the port used by the new listener. Range: 1 to 65535 |
|
port_ranges |
Array of ResPortRange objects |
Definition: Specifies one or more port ranges, including the start and end ports. |
Example Requests
Copying a listener
POST https://{ELB_Endpoint}/v3/{project_id}/elb/listeners/{listener_id}/clone
{
"target_listener_params" : [ {
"name" : "xx-clone",
"loadbalancer_id" : "fb624475-734a-470a-85ed-bd8828bae924",
"protocol_port" : 425,
"reuse_pool" : false
} ]
}
Example Responses
Status code: 200
Successful request.
{
"request_id" : "11750ade-148f-4498-bd7a-e07190a1f5fe",
"job_id" : "aa132002-c0a8-473b-82b4-69fd2d6f87d2",
"listener_list" : [ {
"id" : "81fdfab0-35c0-476e-96df-e00797076843",
"loadbalancer_id" : "fb624475-734a-470a-85ed-bd8828bae924",
"protocol_port" : 425,
"port_ranges" : null
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Successful request. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot