CreateLoadBalancer

1. API Description

This API is used to create a load balancer instance with specified configurations.

Prerequisites

Note

  • If you create a subscription instance, the amount required will be pre-deducted. If the balance is insufficient, the request will fail. If you create a pay-as-you-go instance, please ensure your account balance is sufficient before calling this API.

  • Vouchers can be used for fee deduction in instance creation.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

clientToken

No

String

This parameter is used to guarantee idempotence of the request.

zoneId

Yes

String

Zone ID.

loadBalancerName

Yes

String

Load balancer instance name.

specName

Yes

String

Specification name.

chargeType

Yes

String

Pricing model.

PREPAID: monthly or yearly subscription;

POSTPAID: pay-as-you-go as you need.

instanceChargePrepaid

No

Subscription pricing model. Details of subscription configurations, including the purchase period, auto-renewal. It is required if the chargeType is PREPAID.

bandwidth

Yes

Integer

Bandwidth value. Valid range: 1 to 10240. Unit: Mbps.

ipType

Yes

String

Type of IP to be associated. Valid values:

  • IPv4

  • IPv6

vipCount

No

Integer

Quantity of VIPs to be associated. The quantity of IPs with the specified IP type to be associated to load balancer.

One of the IPs will be associated by default and you don't need to pay for it.

subnetId

No

String

Subnet ID. The value is required if ipType is IPv4. You will obtain the master IP and backup IP in the subnet.

cidrBlockId

No

String

CIDR block ID. The value is required if ipType is IPv6. You will obtain the master IP and backup IP in the CIDR block.

masterIp

No

String

Master IP.

backupIp

No

String

Backup IP.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

orderNumber

String

Number of order.

loadBalancerId

String

Load balancer ID.

4. Code Example

Create a load balancer instance.

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

Request:
{
  "zoneId": "HKG-A",
  "loadBalancerName": "xxxx",
  "specName": "xxxx",
  "clientToken": "xxxx",
  "chargeType": "xxxx",
  "bandwidth": 100,
  "subnetId": "xxxx",
  "ipType": "IPv4"
}

Response:
{
  "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
  "response": {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "orderNumber": "xxxx",
    "loadBalancerId": "xxxx"
  }
}

5. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated