CreateLoadBalancer

1. API Description

This API is used to create a load balancer instance.

Note

  • You can call DescribeLoadBalancerRegions to check the available regions supporting the creating of load balancers.

  • This API is an async API. A response is returned after the request is sent. However, it does not mean the operation has been completed. You can call DescribeLoadBalancers to query the state of the load balancer instance. The RUNNING state means creating successfully.

  • Currently only creating load balance instances for Elastic Compute is supported.

  • Only pay-as-you-go load balance instance creation is supported.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

regionId

Yes

String

Region ID.

vpcId

Yes

String

VPC ID to which the load balance backend server belongs.

loadBalancerName

Yes

String

Load balance instance name.

Containing 1 to 64 characters.

Available range: [1.0, +).

internetChargeType

No

IP network billing model.

ipNetworkType

No

IP network type.

bandwidthMbps

Yes

Integer

Maximum outbound bandwidth of the elastic IP.

Unit: Mbps.

The maximum limit is usually 10000 Mbps. If you have additional requirements, please contact Support.

Available range: [1, +).

trafficPackageSize

No

Float

Data transfer package size.

The parameter is only required when internetChargeType is ByTrafficPackage.

Available range: [0.0, 999999.0].

bandwidthClusterId

No

String

ID of bandwidth cluster.

The parameter is only required when internetChargeType is BandwidthCluster.

resourceGroupId

No

String

Resource Group ID

If not specified, the load balance instance will belong to the default resource group.

number

No

Integer

The number of created load balancers.

Default value: 1.

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.

orderNumber

String

Order number.

loadBalancerIds

Array of String

A collection of unique IDs of the load balancers.

4. Code Example

Create a public network load balancer. IP billing method is flat rate.

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

Request:
{
  "regionId" : "asia-east-1",
  "vpcId" : "<vpcId>",
  "loadBalancerName" : "sample",
  "internetChargeType" : "ByBandwidth",
  "ipNetworkType" : "BGPLine",
  "bandwidthMbps" : 2,
  "trafficPackageSize" : null,
  "bandwidthClusterId" : "",
  "number" : 1
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "orderNumber": "<orderNumber>",
    "loadBalancerIds": ["<loadBalancerId>"]
  }
}

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_VPC_NOT_FOUND

VPC does not exist.

Last updated