获取子网信息-DescribeSubnet

获取子网信息

Request Parameters

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
ProjectIdstring项目ID。不填写为默认项目,子帐号必须填写。 请参考GetProjectList接口No
SubnetIds.nstring子网id数组,适用于一次查询多个子网信息No
SubnetIdstring子网id,适用于一次查询一个子网信息No
VPCIdstringVPC资源idNo
Tagstring业务组名称,默认为DefaultNo
Offsetint偏移量,默认为0No
Limitint列表长度,默认为20No

Response Elements

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
TotalCountint子网总数量Yes
DataSetarray子网信息数组,具体资源见下方SubnetInfoYes

SubnetInfo

Parameter nameTypeDescriptionRequired
Zonestring可用区名称No
VPCIdstringVPCIdNo
VPCNamestringVPC名称No
SubnetIdstring子网IdNo
SubnetNamestring子网名称No
Remarkstring备注No
Tagstring业务组No
SubnetTypeint子网类型No
Subnetstring子网网段No
Netmaskint子网掩码No
Gatewaystring子网网关No
CreateTimeint创建时间No
HasNATGWbool是否有natgwNo
RouteTableIdstring路由表IdNo

Request Example

https://api.ucloud.cn/?Action=DescribeSubnet
&ProjectId=org-XXXX
&Region=cn-sh2
&SubnetId=subnet-XXX
&VPCId=uvnet-XXXX
&Tag=tag
&Offset=0
&Limit=20

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
}