Querying VPCs
Function
After a VPC is created, you can call this API to query all information about the VPC, including the VPC name, ID, and CIDR block.
Constraints
This API is used to query all VPCs accessible to the tenant submitting the request. A maximum of 2000 records can be returned for each query. If the number of records exceeds 2000, the pagination marker will be returned.
Calling Method
For details, see Calling APIs.
URI
GET /v3/{project_id}/vpc/vpcs
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
|
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
|
|
marker |
No |
String |
|
|
id |
No |
Array of strings |
|
|
name |
No |
Array of strings |
|
|
description |
No |
Array of strings |
|
|
cidr |
No |
Array of strings |
|
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
|
|
vpcs |
Array of Vpc objects |
|
|
page_info |
PageInfo object |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
|
|
name |
String |
|
|
description |
String |
|
|
cidr |
String |
|
|
extend_cidrs |
Array of strings |
|
|
status |
String |
|
|
project_id |
String |
|
|
enterprise_project_id |
String |
|
|
created_at |
String |
|
|
updated_at |
String |
|
|
cloud_resources |
Array of CloudResource objects |
|
|
tags |
Array of ResponseTag objects |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_type |
String |
|
|
resource_count |
Integer |
|
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Tag key. Range:
|
|
value |
String |
Definition: Tag value. Range:
|
|
Parameter |
Type |
Description |
|---|---|---|
|
previous_marker |
String |
Definition: The first record on the current page. Range: N/A |
|
current_count |
Integer |
Definition: Total number of resources on the current page. Range: N/A |
|
next_marker |
String |
Definition: The last record on the current page. The next_marker field does not exist if the page is the last one. Range: N/A |
Example Requests
-
Querying VPCs
GET https://{Endpoint}/v3/{project_id}/vpc/vpcs -
Querying VPCs by VPC ID
GET https://{Endpoint}/v3/{project_id}/vpc/vpcs?id=01ab4be1-4447-45fb-94be-3ee787ed4ebe&id=02cd5ef2-4447-36fb-75be-3ee787ed6adf -
Querying VPCs by VPC name
GET https://{Endpoint}/v3/{project_id}/vpc/vpcs?name=vpc-test -
Querying VPCs by page
GET https://{Endpoint}/v3/{project_id}/vpc/vpcs?limit=2&marker=01ab4be1-4447-45fb-94be-3ee787ed4ebe
Example Responses
Status code: 200
Normal response to the GET operation. For more status codes, see Status Code.
{
"request_id" : "9c1838ba498249547be43dd618b58d27",
"vpcs" : [ {
"id" : "01da5a65-0bb9-4638-8ab7-74c64e24a9a7",
"name" : "API-PERF-TEST-14bd44c121",
"description" : "",
"cidr" : "192.168.0.0/16",
"extend_cidrs" : [ ],
"status" : "ACTIVE",
"project_id" : "087679f0aa80d32a2f4ec0172f5e902b",
"enterprise_project_id" : "0",
"tags" : [ ],
"created_at" : "2020-06-16T02:32:18Z",
"updated_at" : "2020-06-16T02:32:18Z",
"cloud_resources" : [ {
"resource_type" : "routetable",
"resource_count" : 1
}, {
"resource_type" : "virsubnet",
"resource_count" : 0
} ]
}, {
"id" : "43fd79b0-f7d7-4e9b-828b-2d4d7bfae428",
"name" : "API-PERF-TEST_m2n33",
"description" : "",
"cidr" : "192.168.0.0/16",
"extend_cidrs" : [ ],
"status" : "ACTIVE",
"project_id" : "087679f0aa80d32a2f4ec0172f5e902b",
"enterprise_project_id" : "0",
"tags" : [ ],
"created_at" : "2020-06-15T06:29:40Z",
"updated_at" : "2020-06-15T06:29:41Z",
"cloud_resources" : [ {
"resource_type" : "routetable",
"resource_count" : 1
}, {
"resource_type" : "virsubnet",
"resource_count" : 1
} ]
}, {
"id" : "5ed053ba-b46c-4dce-a1ae-e9d8a7015f21",
"name" : "API-PERF-TEST-c34b1c4b12",
"description" : "",
"cidr" : "192.168.0.0/16",
"extend_cidrs" : [ ],
"status" : "ACTIVE",
"project_id" : "087679f0aa80d32a2f4ec0172f5e902b",
"enterprise_project_id" : "0",
"tags" : [ ],
"created_at" : "2020-06-16T02:32:33Z",
"updated_at" : "2020-06-16T02:32:33Z",
"cloud_resources" : [ {
"resource_type" : "routetable",
"resource_count" : 1
}, {
"resource_type" : "virsubnet",
"resource_count" : 0
} ]
} ],
"page_info" : {
"previous_marker" : "01da5a65-0bb9-4638-8ab7-74c64e24a9a7",
"current_count" : 3
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Normal response to the GET operation. For more status codes, see Status Code. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.