DescribeInstanceAvailableCidrBlock

1. API Description

This API is used to query available CIDR blocks for the instance.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter NameRequiredTypeDescription

instanceId

Yes

String

ID of the instance.

You can find the instanceId in the response by calling DescribeInstances.

cidrBlockType

No

String

Type of CIDR block. The optional values are as follows:

  • IPv4

  • IPv6

3. Output Parameters

Parameter NameTypeDescription

requestId

String

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

instanceAvailableCidrBlocks

List of available CIDR blocks for the instance.

4. Code Example

Query available IPv4 CIDR blocks for instance 123456.

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

Request:
{
  "instanceId": "123456",
  "cidrBlockType": "IPV4"
}

Response:
{
  "requestId": "TD558E499-305A-45CF-A416-8BAD3DCFFFA4",
  "response": {
    "requestId": "TD558E499-305A-45CF-A416-8BAD3DCFFFA4",
    "instanceAvailableCidrBlocks": [
      {
        "cidrBlockId": "d6ea77ad-fd05-4383-b973-93703bddaa79",
        "zoneId": "SEL-A",
        "cidrBlockType": "IPV4",
        "cidrBlock": "1.1.1.48/29",
        "availableIps": [
          "1.1.1.50",
          "1.1.1.51",
          "1.1.1.52",
          "1.1.1.53",
          "1.1.1.54"
        ],
        "availableIpCount": 5
      },
      {
        "cidrBlockId": "50a242cb-172d-4ebe-824b-f484bbfee803",
        "zoneId": "SEL-A",
        "cidrBlockType": "IPV4",
        "cidrBlock": "2.2.2.56/29",
        "availableIps": [
          "2.2.2.58",
          "2.2.2.59",
          "2.2.2.60",
          "2.2.2.61",
          "2.2.2.62"
        ],
        "availableIpCount": 5
      }
    ]
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

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

Last updated