> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/bmc/cidr-block/describeinstanceavailablecidrblock.md).

# DescribeInstanceAvailableCidrBlock

## 1. API Description

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

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type                                                 | Description                                                                                                 |
| -------------- | -------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| instanceId     | Yes      | String                                               | <p>ID of the instance.</p><p>You can find the instanceId in the response by calling DescribeInstances .</p> |
| cidrBlockType  | No       | [IpType](/api-reference/bmc/datastructure.md#iptype) | <p>Type of CIDR block. The optional values are as follows:</p><p>IPv4 IPv6</p>                              |

## 3. Output Parameters

| Parameter Name              | Type                                                                                                  | Description                                                                                                           |
| --------------------------- | ----------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| requestId                   | String                                                                                                | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| instanceAvailableCidrBlocks | Array of [InstanceAvailableCidrBlock](/api-reference/bmc/datastructure.md#instanceavailablecidrblock) | List of available CIDR blocks for the instance.                                                                       |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
Query available IPv4 CIDR blocks for instance `123456`.

```json
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
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，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](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
