Modifies the zones and zone attributes of a Network Load Balancer (NLB) instance.

Precautions

When you call this operation, make sure that you specify all the zones of the NLB instance, including the existing zones and new zones. If you do not specify the existing zones, the existing zones are removed.

Description

  • Make sure that an NLB instance is created. For more information, see CreateLoadBalancer.
  • You can call the GetLoadBalancerAttribute operation to query the zones and zone attributes of an NLB instance.
  • UpdateLoadBalancerZones is an asynchronous operation. After you send a request, the request ID is returned but the operation is still being performed in the system background. You can call the GetJobStatus operation to query the status of a task:
    • If the task is in the Succeeded state, the zones and zone attributes are modified.
    • If the task is in the Processing state, the zones and zone attributes are being modified. In this case, you can perform only query operations.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateLoadBalancerZones

The operation that you want to perform. Set the value to UpdateLoadBalancerZones.

LoadBalancerId String Yes nlb-83ckzc8d4xlp8o****

The ID of the NLB instance.

ZoneMappings.N.VSwitchId String Yes vsw-bp1rmcrwg3erh1fh8****

The ID of the vSwitch in the zone. By default, each zone contains one vSwitch and one subnet.

ZoneMappings.N.ZoneId String Yes cn-hangzhou-a

The ID of the zone. You can call the DescribeZones operation to query the zones.

ZoneMappings.N.PrivateIPv4Address String No 192.168.36.16

The private IP addresses.

ZoneMappings.N.AllocationId String No eip-bp1aedxso6u80u0qf****

The ID of the elastic IP address (EIP) or Anycast EIP.

ZoneMappings.N.EipType String No Common

The type of the EIP. Valid values:

  • Common: EIP
  • Anycast: Anycast EIP
Note Only NLB instances in the China (Hong Kong) region can be associated with Anycast EIPs. This parameter is required if you set the AddressType parameter to Internet.
DryRun Boolean No false

Specifies whether to check the request without performing the operation. Valid values:

  • true: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the check, an error message is returned. If the request passes the check, the DryRunOperation error code is returned.
  • false: sends the request. If the request passes the check, an HTTP 2xx status code is returned and the operation is performed. This is the default value.
ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among all requests. The token can only contain ASCII characters.

Note If you do not specify this parameter, the system automatically sets ClientToken to the value of RequestId. RequestId of each API request may be different.
RegionId String No cn-hangzhou

The ID of the region where the NLB instance is deployed.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
RequestId String CEF72CEB-54B6-4AE8-B225-F876FF7BA984

The ID of the request.

JobId String 72dcd26b-f12d-4c27-b3af-18f6aed5****

The ID of the asynchronous task.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateLoadBalancerZones
&LoadBalancerId=nlb-83ckzc8d4xlp8o****
&ZoneMappings=[{"VSwitchId":"vsw-bp1rmcrwg3erh1fh8****","ZoneId":"cn-hangzhou-a","PrivateIPv4Address":"192.168.36.16","AllocationId":"eip-bp1aedxso6u80u0qf****"}]
&DryRun=false
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&RegionId=cn-hangzhou
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateLoadBalancerZonesResponse>
    <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
    <JobId>72dcd26b-f12d-4c27-b3af-18f6aed5****</JobId>
</UpdateLoadBalancerZonesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "CEF72CEB-54B6-4AE8-B225-F876FF7BA984",
  "JobId" : "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}

Error codes

For a list of error codes, see Service error codes.