Obtain Subnet Information - DescribeSubnet
Overview
Obtain Subnet Information
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is DescribeSubnet . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, and the sub-account must be filled in. Please refer to the GetProjectList interface. | No |
SubnetIds.N | string | Array of subnet IDs, suitable for querying multiple subnet information at once. | No |
SubnetId | string | Subnet id, applicable for querying information of one subnet at a time. | No |
RouteTableId | string | Routing Table Id | No |
VPCId | string | VPC Resource ID | No |
Tag | string | Business group name, default is Default | No |
Offset | int | Offset, default is 0 | No |
Limit | int | List length, default is 20 | No |
ShowAvailableIPs | boolean | Whether to return the number of available IPs in the subnet, true for yes, false for no, not returned by default. | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
TotalCount | int | Total number of subnets | Yes |
DataSet | array[SubnetInfo] | Array of subnet information, see SubnetInfo for specific resources | Yes |
Data Model
SubnetInfo
Field Name | Type | Description Information | Required |
---|---|---|---|
Zone | string | Availability Zone Name | No |
IPv6Network | string | IPv6 segment associated with the subnet | No |
VPCId | string | VPCId | No |
VPCName | string | VPC Name | No |
SubnetId | string | Subnet Id | No |
SubnetName | string | Subnet Name | No |
Remark | string | Note | No |
Tag | string | Business Group | No |
SubnetType | int | Subnet Type | No |
Subnet | string | Subnet Segment | No |
Netmask | string | Subnet Mask | No |
Gateway | string | Subnet Gateway | No |
CreateTime | int | Creation Time | No |
HasNATGW | boolean | Is there a natgw? | No |
RouteTableId | string | Routing Table Id | No |
AvailableIPs | int | Available IP Quantity | No |
Example
Request Example
https://api.ucloud-global.com/?Action=DescribeSubnet
&ProjectId=org-XXXX
&Region=cn-sh2
&SubnetId=subnet-XXX
&VPCId=uvnet-XXXX
&Tag=tag
&Offset=0
&Limit=20
&RouteTableId=KbKrefnV
&ShowAvailableIPs=false
Response Example
{
"Action": "DescribeSubnetResponse",
"DataSet": [
{
"CreateTime": 1528353483,
"Gateway": "172.16.XX.1",
"HasNATGW": false,
"Name": "test-s1",
"Netmask": "24",
"Remark": "test",
"RouteTableId": "routetable-XXXX",
"Subnet": "172.16.XXX.0",
"SubnetId": "subnet-XXXXX",
"SubnetName": "test-s1",
"SubnetType": 2,
"Tag": "Default",
"VPCId": "uvnet-XXXX",
"VPCName": "test",
"VRouterId": "Default_VRouter",
"Zone": "cn-sh2-01"
}
],
"RetCode": 0,
"TotalCount": 1
}