Querying Virtual Subnets
Function
This API is used to query information about all subnets, including the subnet name and ID.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
vpc:subnets:list
List
subnet *
-
- vpc:subnets:get
-
-
g:EnterpriseProjectId
URI
GET /v3/{project_id}/vpc/virsubnets
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: ID of the project that the subnet belongs to. For details about how to obtain a project ID, see Obtaining a Project ID. Range: N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
Definition: Number of resources on each page. Range: 0 to 2000 |
|
marker |
No |
String |
Definition: Start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried. Range: Subnet ID. |
|
id |
No |
Array of strings |
Definition: ID of the subnet, which can be used to filter the subnet. Multiple IDs can be specified for filtering. Range: N/A |
|
name |
No |
Array of strings |
Definition: Subnet name, which can be used to filter the subnet. Multiple names can be specified for filtering. Range: N/A |
|
vpc_id |
No |
Array of strings |
Definition: ID of the VPC that the subnet belongs to, which can be used to filter the subnet. Multiple IDs can be specified for filtering. Range: N/A |
|
status |
No |
String |
Definition: Subnet status, which can be used to filter the subnet. Only one status can be specified for filtering. Range:
|
|
scope |
No |
Array of strings |
Definition: Scope of the subnet. If this parameter is specified, the subnet can be filtered by scope. Multiple scopes can be specified for filtering. Range:
|
|
zone_id |
No |
Array of strings |
Definition: AZ ID of the subnet. If this parameter is specified, the subnet can be filtered by AZ ID. Multiple AZ IDs can be specified for filtering. Range: N/A |
|
description |
No |
Array of strings |
Definition: Description of the subnet, which can be used to filter the subnet. Multiple descriptions can be specified for filtering. Range: N/A |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Definition: Request ID. Range: N/A. |
|
virsubnets |
Array of Virsubnet objects |
Definition: Response body for querying the subnets. Range: N/A. |
|
page_info |
PageInfo object |
Definition: Pagination information. Range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Subnet ID. After a subnet is created, a subnet ID is generated, which uniquely identifies the subnet. Range: The value is in UUID format with hyphens (-). |
|
name |
String |
Definition: Subnet name. Range: The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.). |
|
description |
String |
Definition: Supplementary information about a subnet. Range: The value can contain 0 to 255 characters and cannot contain angle brackets (< or >). |
|
dns_nameservers |
Array of strings |
Definition: DNS server addresses of a subnet. Range: N/A. |
|
zone_id |
String |
Definition: ID of the AZ that the subnet belongs to. Range: N/A |
|
vpc_id |
String |
Definition: ID of the VPC that the subnet belongs to. Range: N/A |
|
status |
String |
Definition: Subnet status. Range:
|
|
project_id |
String |
Definition: ID of the project that the subnet belongs to. Range: N/A |
|
scope |
String |
Definition: Scope of the subnet (edge cloud scenario). Range:
|
|
subnet_cidrs |
Array of SubnetCidr objects |
Definition: OpenStack Neutron subnet information. Range: N/A |
|
tags |
Array of ResponseTag objects |
Definition: Tags of a subnet, including tag keys and tag values, which can be used to classify and identify resources. For details, see the tag objects. Range: N/A |
|
extra_dhcp_opts |
Array of SubnetExtraDhcpOpt objects |
Definition: DHCP attributes of a subnet. You can configure the NTP address, DNS domain name, or lease expiration time. Range: N/A. |
|
created_at |
String |
Definition: Time when a subnet was created. Range: The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss. |
|
updated_at |
String |
Definition: Time when a subnet was updated. Range: The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: ID of the OpenStack Neutron subnet. Range: The value is in UUID format with hyphens (-). |
|
ip_version |
String |
Definition: IP address version of the OpenStack Neutron subnet. Range:
|
|
cidr |
String |
Definition: IP address range of the OpenStack Neutron subnet. Range: The value is in CIDR format, for example, 192.168.23.0/24 for IPv4 and 2420:2023:410:d5d::/64 for IPv6. |
|
gateway_ip |
String |
Definition: Gateway IP address of the OpenStack Neutron subnet. Range: N/A |
|
enable_dhcp |
Boolean |
Definition: Whether the DHCP function is enabled for the OpenStack Neutron subnet. Range:
|
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Tag key. Range:
|
|
value |
String |
Definition: Tag value. Range:
|
|
Parameter |
Type |
Description |
|---|---|---|
|
opt_name |
String |
Definition: Name of the NTP server address, domain name, or DHCP lease expiration time configured for the subnet. Range:
|
|
opt_value |
String |
Definition: NTP server address, domain name, or DHCP lease expiration time configured for the subnet. Range:
|
|
ip_version |
Integer |
Definition: IP address version of a subnet. 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
Query subnets.
GET https://{Endpoint}/v3/{project_id}/vpc/virsubnets
Example Responses
Status code: 200
The GET operation is successful. For more status codes, see Status Codes.
{
"request_id" : "83ce7c3aebc450bc40316e5856eff16e",
"virsubnets" : [ {
"name" : "subnet-1",
"id" : "26c31230-6c2e-4dc3-b423-97ea75abac7c",
"project_id" : "11e8dd119c77479db890e266e68c1ecf",
"status" : "ACTIVE",
"tags" : [ ],
"description" : "",
"created_at" : "2025-11-26T07:21:25",
"updated_at" : "2025-12-05T09:11:19",
"subnet_cidrs" : [ {
"id" : "0ab40e38-edd2-46ff-bfec-d092d417275b",
"ip_version" : "4",
"cidr" : "192.168.23.0/24",
"gateway_ip" : "192.168.23.1",
"enable_dhcp" : true
}, {
"id" : "37fcba97-5fab-4328-906e-fc2b3f261796",
"ip_version" : "6",
"cidr" : "2420:2023:410:d5d::/64",
"gateway_ip" : "2420:2023:410:d5d::1",
"enable_dhcp" : true
} ],
"dns_nameservers" : [ "100.125.3.250", "100.125.3.251" ],
"vpc_id" : "1e8a8ea6-c641-4461-810c-5851868f98be",
"extra_dhcp_opts" : [ {
"opt_value" : "10.0.0.1,10.0.0.2",
"opt_name" : "42",
"ip_version" : 4
}, {
"opt_value" : "2h",
"opt_name" : "651",
"ip_version" : 6
}, {
"opt_value" : "87600h",
"opt_name" : "51",
"ip_version" : 4
}, {
"opt_value" : "domain.com",
"opt_name" : "15",
"ip_version" : 4
} ],
"scope" : "center",
"zone_id" : ""
}, {
"name" : "subnet-2",
"id" : "518a60c6-06a1-427c-88b7-3e4fc98e2998",
"project_id" : "11e8dd119c77479db890e266e68c1ecf",
"status" : "ACTIVE",
"tags" : [ {
"key" : "a",
"value" : "a"
} ],
"description" : "",
"created_at" : "2025-11-14T03:57:02",
"updated_at" : "2025-11-14T03:57:02",
"subnet_cidrs" : [ {
"id" : "eded5d66-4f57-4f9e-82f9-26796b00c526",
"ip_version" : "4",
"cidr" : "192.168.12.0/24",
"gateway_ip" : "192.168.12.1",
"enable_dhcp" : true
} ],
"dns_nameservers" : [ "100.125.3.250", "100.125.3.251" ],
"vpc_id" : "a45cbb45-a36c-4d49-8616-0517aa158b14",
"extra_dhcp_opts" : [ {
"opt_value" : "87600h",
"opt_name" : "51",
"ip_version" : 4
} ],
"scope" : "center",
"zone_id" : ""
} ],
"page_info" : {
"previous_marker" : "26c31230-6c2e-4dc3-b423-97ea75abac7c",
"current_count" : 2
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The GET operation is successful. For more status codes, see Status Codes. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot