Querying VPCs¶
Function¶
This API is used to query VPCs using search criteria and to display the VPCs in a list.
URI¶
GET /v1/{project_id}/vpcs
Example:
GET https://{Endpoint}/v1/{project_id}/vpcs?limit=10&marker=13551d6b-755d-4757-b956-536f674975c0
Table 1 describes the parameters.
Name | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
marker | No | String | Specifies a resource ID for pagination query, indicating that the query starts from the next record of the specified resource ID. This parameter can work together with the parameter limit.
|
limit | No | Integer | Specifies the number of records that will be returned on each page. The value is from 0 to intmax (2^31-1). The default value is 2000. limit can be used together with marker. For details, see the parameter description of marker. |
Request Parameters¶
None
Example Request¶
GET https://{Endpoint}/v1/{project_id}/vpcs
Response Parameters¶
Name | Type | Description |
---|---|---|
id | String | Specifies a resource ID in UUID format. |
name | String |
|
description | String |
|
cidr | String |
|
status | String |
|
routes | Array of route objects |
|
enable_shared_snat | Boolean | Specifies whether the shared SNAT function is enabled. The value true indicates that the function is enabled, and the value false indicates that the function is not enabled. |
Name | Type | Description |
---|---|---|
destination | String |
|
nexthop | String |
|
Example Response¶
{
"vpcs": [
{
"id": "13551d6b-755d-4757-b956-536f674975c0",
"name": "default",
"description": "test",
"cidr": "172.16.0.0/16",
"status": "OK",
"routes": [],
"enable_shared_snat": false
},
{
"id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85",
"name": "222",
"description": "test",
"cidr": "192.168.0.0/16",
"status": "OK",
"routes": [],
"enable_shared_snat": false
},
{
"id": "99d9d709-8478-4b46-9f3f-2206b1023fd3",
"name": "vpc",
"description": "test",
"cidr": "192.168.0.0/16",
"status": "OK",
"routes": [],
"enable_shared_snat": false
}
]
}
Status Code¶
See Status Codes.
Error Code¶
See Error Codes.