Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
20 KiB
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
GET https://{Endpoint}/v1/{project_id}/vpcs?limit=10&marker=13551d6b-755d-4757-b956-536f674975c0
Name |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the 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. |
enterprise_project_id |
No |
String |
|
Request Parameters
None
Example Request
GET https://{Endpoint}/v1/{project_id}/vpcs
Response Parameters
Name |
Type |
Description |
---|---|---|
vpcs |
Array of vpcs objects |
Specifies the VPCs. |
Name |
Type |
Description |
---|---|---|
id |
String |
Specifies a resource ID in UUID format. |
name |
String |
|
description |
String |
|
cidr |
String |
|
status |
String |
|
enterprise_project_id |
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", "enterprise_project_id": "0", "routes": [], "enable_shared_snat": false }, { "id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85", "name": "222", "description": "test", "cidr": "192.168.0.0/16", "status": "OK", "enterprise_project_id": "0635d733-c12d-4308-ba5a-4dc27ec21038", "routes": [], "enable_shared_snat": false }, { "id": "99d9d709-8478-4b46-9f3f-2206b1023fd3", "name": "vpc", "description": "test", "cidr": "192.168.0.0/16", "status": "OK", "enterprise_project_id": "0", "routes": [], "enable_shared_snat": false } ] }
Status Code
See Status Codes.
Error Code
See Error Codes.