Create a Server Load Balancer instance.

Note the following when calling this API:
  • After the instance is created, charges are generated. For more information, see billing.
  • If you do not specify the instance specification (LoadBalancerSpec), a shared-performance instance is created. We recommend that you call the LoadBalancerSpec API to specify the instance specification when creating a Server Load Balancer instance.

Request parameters

Name Type Required Description 
Action String Yes The action to perform. Valid value:

CreateLoadBalancer

RegionId String  Yes The region of the SLB instance.

You can obtain the region ID by calling the DescribeRegions API.

MasterZoneId String No The ID of the primary zone. By default, the SLB cluster in the primary zone is used to distribute traffic.

You can query the primary zone and backup zones in a region by calling the DescribeZone API.

SlaveZoneId  String No The ID of the backup zone. The backup zone takes over the traffic distribution only when the SLB cluster in the primary zone fails.

You can query the primary zone and backup zones in a region by calling the DescribeZone API.

LoadBalancerSpec  String No The specification of the Server Load Balancer instance. Valid value: 
  • slb.s1.small
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large
Note If no value is specified, a shared-performance instance is created.

The supported specifications vary by region. Currently guaranteed-performance instances are supported in the following regions: China (Qingdao), China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Zhangjiakou), China (Hohhot), Singapore and US (Virginia). For more information, see Guaranteed-performance instance.

LoadBalancerName String No The name of the SLB instance.

The name can contain 2 to 128 characters. It must begin with English letters and can contain numbers, periods, hyphens, and underlines.

AddressType  String No

The network type of the SLB instance. Valid value: 

  • internet: After an Internet Server Load Balancer instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet.
  • intranet: After an intranet Server Load Balancer instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests.
VSwitchId  String No The ID of the VSwitch to which the SLB instance belongs.
Note When this parameter is specified, the value of the AddressType parameter is automatically set to intranet.
Address  String No The IP address of the SLB instance of the VPC network.

To specify this parameter, you must specify the VSwitchId parameter.

PayType  String No The billing method of the SLB instance. Valid value:
  • PayOnDemand: Pay-As-You-Go
InternetChargeType  String No Billing method of Internet SLB instances. Valid value:

paybytraffic: Pay by traffic

ClientToken String No A client token used to guarantee the idempotence of requests.

This value is generated by the client and must be unique, and cannot exceed 64 ASCII characters.

ResourceGroupId  String No The ID of enterprise resource group.
Addressippversion  String No The IP version, which can be set to ipv4 or ipv6.
Note Currently, only zone E and zone F in the China (Hangzhou) region as well as Zone F and Zone G in the China (Beijing) region supports creating an ipv6 instance and the instance must be a guaranteed-performance instance.

Response parameters

Name  Type Description
RequestId String The ID of the request.
LoadBalancerId String The ID of Server Load Balancer instance.
Address String The IP address of the SLB instance.
VpcId String The ID of the VPC to which the SLB instance belongs.
VSwitchId String The ID of the VSwitch to which the SLB instance belongs.
MasterZoneId String The primary zone of the SLB instance.
SlaveZoneId String The backup 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 specified, a shared-performance instance is created.
MasterZoneId String The ID of the primary zone.
SlaveZoneId String The ID of the backup zone.
LoadBalancerSpec String The specification of the SLB instance.
addressIPVersion String The IP version.
orderId: String The order ID of a Subscription instance.

Examples

Request example

https://slb.aliyuncs.com/?Action=CreateLoadBalancer
 &RegionId=cn-east-hangzhou-01
 &LoadBalancerName=abc
 &AddressType=internet
 &AddressIPVersion=ipv4
 &InternetChargeType=paybytraffic
 &<CommonParameters>
Response examples
  • XML format

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

    {
     "RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
     "LoadBalancerId":"139a00604ad-cn-east-hangzhou-01",
     "Address":"42.250.6.36",
     "NetworkType":"classic",
     "MasterZoneId":"cn-hangzhou-b",
     "SlaveZoneId":"cn-hangzhou-d",
     "LoadBalancerName":"abc"
    }