Querying Details About a Virtual Subnet
Function
This API is used to query details about a subnet, including the subnet name, ID, and status.
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:get
Read
subnet *
-
g:ResourceTag/<tag-key>
-
vpc:SubnetId
-
vpc:VpcId
-
vpc:AvailabilityZone
-
g:EnterpriseProjectId
-
-
-
URI
GET /v3/{project_id}/vpc/virsubnets/{virsubnet_id}
|
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 |
|
virsubnet_id |
Yes |
String |
Definition: Subnet ID. Range: N/A |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
request_id |
String |
Definition: Request ID. Range: N/A |
|
virsubnet |
Virsubnet object |
Definition: Response body for querying subnet details. 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:
|
Example Requests
Query details about a subnet.
GET https://{Endpoint}/v3/{project_id}/vpc/virsubnets/fafb85b7-3b32-c8a8-53d7-84740c40ac1d
Example Responses
Status code: 200
The GET operation is successful. For more status codes, see Status Codes.
{
"virsubnet" : {
"name" : "subnet-test",
"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" : "",
"available_ip_address_count" : 250
}
}
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