edit-icon download-icon

CreateLoadBalancer

Last Updated: Mar 02, 2018

Description

Create a Server Load Balancer instance.

Request parameter

Name Type Required Description
Action String Yes

The action to perform. Valid value:

CreateLoadBalancer

RegionId String Yes

The ID of the region where the Server Load Balancer instance is located. For example: cn-hangzhou

Call the DescribeRegions API to get the list of available regions.

LoadBalancerSpec String No

The specification of the Server Load Balancer instance. Valid values:

slb.s1.small | slb.s2.small| slb.s2.medium | slb.s3.small | | slb.s3.medium | slb.s3.large

The performance varies depending on the instance specification. For more information, see Guaranteed-performance instances.

Note: If no value is provided, a shared-performance instance will be created.

MasterZoneId String No

The ID of the active zone. By default, the SLB cluster in the active zone is used to distribute traffic.

Call the DescribeZone API to get the available zones to use.

SlaveZoneId String No

The ID of the standby zone. The standby zone takes over the traffic distribution only when the SLB cluster in the master zone fails.

Call the DescribeZone API to get the available zones to use.

LoadBalancerName String No The name of the SLB instance.
AddressType String No

The network type of the SLB instance. Valid values:

  • internet (Default value): An Internet SLB instance can forward traffic only from the Internet.

  • intranet: An intranet SLB instance can forward traffic only from the intranet.

    Note: If intranet is selected, the VSwitchId parameter must be provided.

VSwitchId String No The ID of the VSwitch where the SLB instance is created.
InternetChargeType String No

The billing method used for the Internet SLB instance. Valid value:

paybytraffic

ClientToken String No

The client token to ensure the idempotence of a request.

It is a unique, case-sensitive string of up to 64 ASCII characters. For more information, see Ensure idempotence.

ResourceGroupId String No Enterprise resources group ID.

Response parameter

Name Type Description
RequestId String The ID of the request.
LoadBalancerId String The ID of the SLB instance.
Address String The IP address of the SLB instance.
VpcId String The ID of a VPC instance.
VSwitchId String The ID of a VSwitch in a VPC instance.
MasterZoneId String The active zone of the SLB instance.
SlaveZoneId String The standby zone of the SLB instance.
LoadBalancerName String The name of the SLB instance.
LoadBalancerSpec String

The specification of the SLB instance.

If no value is returned, then the instance is a shared-performance instance.

Example

Request example

  1. https://slb.example.com/?Action=CreateLoadBalancer
  2. &RegionId=cn-east-hangzhou-01
  3. &LoadBalancerName=abc
  4. &AddressType=internet
  5. &InternetChargeType=paybytraffic
  6. &<CommonReuqestParameters>

Response example

  • XML format

    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <CreateLoadBalancerResponse>
    3. <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    4. <LoadBalancerId>139a00604ad-cn-east-hangzhou-01</LoadBalancerId>
    5. <Address>42.250.6.36</Address>
    6. <NetworkType>classic<NetworkType>
    7. <MasterZoneId>cn-hangzhou-b<MasterZoneId>
    8. <SlaveZoneId>cn-hangzhou-d<SlaveZoneId>
    9. <LoadBalancerName>abc</LoadBalancerName>
    10. </CreateLoadBalancerResponse>
  • JSON format

    1. {
    2. "RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
    3. "LoadBalancerId":"139a00604ad-cn-east-hangzhou-01",
    4. "Address":"42.250.6.36",
    5. "NetworkType":"classic",
    6. "MasterZoneId":"cn-hangzhou-b",
    7. "SlaveZoneId":"cn-hangzhou-d",
    8. "LoadBalancerName":"abc"
    9. }
Thank you! We've received your feedback.