github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/vpc/describe_subnets.go (about) 1 package vpc 2 3 import ( 4 github_com_morlay_goqcloud "github.com/morlay/goqcloud" 5 ) 6 7 // 查询子网列表 8 // https://cloud.tencent.com/document/api/215/15784 9 10 type DescribeSubnetsRequest struct { 11 // 过滤条件,参数不支持同时指定SubnetIds和Filters。subnet-id - String - (过滤条件)Subnet实例名称。vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。cidr-block - String - (过滤条件)vpc的cidr。is-default - Boolean - (过滤条件)是否是默认子网。subnet-name - String - (过滤条件)子网名称。zone - String - (过滤条件)可用区。 12 Filters []*Filter `name:"Filters,omitempty"` 13 // 返回数量 14 Limit *string `name:"Limit,omitempty"` 15 // 偏移量 16 Offset *string `name:"Offset,omitempty"` 17 // 区域 18 Region string `name:"Region"` 19 // 子网实例ID查询。形如:subnet-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定SubnetIds和Filters。 20 SubnetIds []*string `name:"SubnetIds,omitempty"` 21 } 22 23 func (req *DescribeSubnetsRequest) Invoke(client github_com_morlay_goqcloud.Client) (*DescribeSubnetsResponse, error) { 24 resp := &DescribeSubnetsResponse{} 25 err := client.Request("vpc", "DescribeSubnets", "2017-03-12").Do(req, resp) 26 return resp, err 27 } 28 29 type DescribeSubnetsResponse struct { 30 github_com_morlay_goqcloud.TencentCloudBaseResponse 31 // 子网对象。 32 SubnetSet []*Subnet `json:"SubnetSet"` 33 // 符合条件的实例数量。 34 TotalCount int64 `json:"TotalCount"` 35 }