DescribeVpcs

DescribeVpcs

1. API Description

This API 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 NameRequiredTypeDescription

vpcIds

No

Array of String

VPC ID(s).

The maximum number of VPCs in each request is 100.

cidrBlock

No

String

CIDR block of VPC.

vpcStatus

No

String

vpcName

No

String

Name of VPC.

vpcRegionId

No

String

Availability region ID of VPC.

resourceGroupId

No

String

Resource group ID.

If the value is null, then return all the VPCs in the authorized resource groups.

pageSize

No

Integer

Number of items in the current page result.

Default value: 20;

Maximum value: 1000.

pageNum

No

Integer

Number of pages returned.

Default value: 1.

3. Output Parameters

Parameter NameTypeDescription

requestId

String

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

dataSet

Array of VpcInfo

Information on VPCs.

totalCount

Integer

Number of VPCs meeting the filtering conditions.

4. Code Exampleq

Query details of VPCs.

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"
      }
    ]
  }
}

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