> 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/compute/bmc/vpc/describevpcs.md).

# DescribeVpcs

## 1. API Description

This API (DescribeVpcs) is used to query the details of one or more VPCs. You can filter the query results with the VPC ID, VPC name, subnet ID and availability region ID.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name  | Required | Type                                                               | Description                                                                                                       |
| --------------- | -------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| vpcIds          | No       | Array of String                                                    | <p>VPC ID(s).</p><p>The maximum number of VPCs in each request is 100.</p>                                        |
| vpcName         | No       | String                                                             | Name of VPC.                                                                                                      |
| cidrBlock       | No       | String                                                             | CIDR block of VPC.                                                                                                |
| vpcStatus       | No       | [VpcStatus](/api-reference/compute/bmc/datastructure.md#vpcstatus) | [Status of VPC](/api-reference/compute/bmc/datastructure.md#vpcstatus).                                           |
| vpcRegionId     | No       | String                                                             | Availability region ID of VPC.                                                                                    |
| resourceGroupId | No       | String                                                             | <p>Resource group ID.</p><p>If the value is null, then return all the VPCs in the authorized resource groups.</p> |
| pageSize        | No       | Integer                                                            | <p>Number of items in the current page result.</p><p>Default value: 20;</p><p>Maximum value: 1000.</p>            |
| pageNum         | No       | Integer                                                            | <p>Number of pages returned.</p><p>Default value: 1</p>                                                           |
| tagKeys         | No       | Array of String                                                    | <p>Search by tag key.</p><p>You can query up to 20 tag keys in each request.</p>                                  |
| tags            | No       | Array of [Tag](/api-reference/compute/bmc/datastructure.md#tag)    | <p>Search by tag.</p><p>You can query up to 20 tags in each request.</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> |
| totalCount     | Integer                                                                 | Number of VPCs meeting the filtering conditions.                                                                      |
| dataSet        | Array of [VpcInfo](/api-reference/compute/bmc/datastructure.md#vpcinfo) | Information on VPCs.                                                                                                  |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
Query details of VPCs.

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

Request:
{
  "pageSize": 10,
  "pageNum": 1
}

Response:
{
  "requestId": "T890357C5-9793-4668-BB32-217134475DAC",
  "response": {
    "requestId": "T890357C5-9793-4668-BB32-217134475DAC",
    "totalCount": 9,
    "dataSet": [
      {
        "vpcId": "675574041725115352",
        "vpcRegionId": "HKG5",
        "vpcRegionName": "HKG-A_C",
        "vpcName": "111",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-07-21T02:45:01Z",
        "vpcStatus": "AVAILABLE",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "677036631693206488",
        "vpcRegionId": "CHI1",
        "vpcRegionName": "CHI-A",
        "vpcName": "VPC-CHI-A-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-07-23T03:10:55Z",
        "vpcStatus": "DELETING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "695843306310998744",
        "vpcRegionId": "MAA2",
        "vpcRegionName": "MAA-A_C",
        "vpcName": "VPC-MAA-A_C-Default",
        "cidrBlock": "10.0.0.0/16",
        "createTime": "2022-08-18T01:56:26Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "705474328350696152",
        "vpcRegionId": "SIN3",
        "vpcRegionName": "SIN-A_B",
        "vpcName": "VPC-SIN-A_B-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-08-31T08:51:35Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "706724644945666264",
        "vpcRegionId": "AMS2",
        "vpcRegionName": "AMS-C",
        "vpcName": "VPC-AMS-C-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-09-02T02:15:42Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "706839622411361496",
        "vpcRegionId": "TYO2",
        "vpcRegionName": "TYO-A",
        "vpcName": "VPC-TYO-A-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-09-02T06:04:09Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "736091361115114712",
        "vpcRegionId": "AMS2",
        "vpcRegionName": "AMS-C",
        "vpcName": "VPC-AMS-C-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-10-12T14:42:08Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "750526251764025304",
        "vpcRegionId": "FRA5",
        "vpcRegionName": "FRA-B_D_E",
        "vpcName": "VPC-FRA-B_D_E-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-11-01T12:41:41Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      },
      {
        "vpcId": "786474054256176856",
        "vpcRegionId": "LAX5",
        "vpcRegionName": "LAX-C_D_E",
        "vpcName": "VPC-LAX-C-Default",
        "cidrBlock": "10.0.0.0/8",
        "createTime": "2022-12-21T03:03:33Z",
        "vpcStatus": "CREATING",
        "resourceGroupId": "5a4f6519-2977-47cb-b3fc-150fd2b4de71",
        "resourceGroupName": "Default Resource Group"
      }
    ]
  }
}

```

{% 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 |
| ---------------- | ---------- | ----------- |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/compute/bmc/vpc/describevpcs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
