Skip to content

Commit

Permalink
migrate from py3 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeiminds authored Mar 12, 2020
1 parent 819ca44 commit 57e3e0b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions ucloud/services/vpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,39 @@ def describe_subnet(self, req=None, **kwargs):
resp = self.invoke("DescribeSubnet", d, **kwargs)
return apis.DescribeSubnetResponseSchema().loads(resp)

def describe_subnet_resource(self, req=None, **kwargs):
""" DescribeSubnetResource - 展示子网资源
**Request**
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
- **SubnetId** (str) - (Required) 子网id
- **Limit** (int) - 单页返回数据长度,默认为20
- **Offset** (int) - 列表起始位置偏移量,默认为0
- **ResourceType** (str) - 资源类型,默认为全部资源类型。枚举值为:UHOST,云主机;PHOST,物理云主机;ULB,负载均衡;UHADOOP_HOST,hadoop节点;UFORTRESS_HOST,堡垒机;UNATGW,NAT网关;UKAFKA,Kafka消息队列;UMEM,内存存储;DOCKER,容器集群;UDB,数据库;UDW,数据仓库;VIP,内网VIP.
**Response**
- **DataSet** (list) - 见 **SubnetResource** 模型定义
- **TotalCount** (int) - 总数
**Response Model**
**SubnetResource**
- **IP** (str) - 资源ip
- **IPv6Address** (str) - 资源的IPv6地址
- **Name** (str) - 资源名称
- **ResourceId** (str) - 资源Id
- **ResourceType** (str) - 资源类型。对应的资源类型:UHOST,云主机;PHOST,物理云主机;ULB,负载均衡;UHADOOP_HOST,hadoop节点;UFORTRESS_HOST,堡垒机;UNATGW,NAT网关;UKAFKA,Kafka消息队列;UMEM,内存存储;DOCKER,容器集群;UDB,数据库;UDW,数据仓库;VIP,内网VIP.
- **SubResourceId** (str) - 资源绑定的虚拟网卡的实例ID
- **SubResourceName** (str) - 资源绑定的虚拟网卡的实例名称
- **SubResourceType** (str) - 资源绑定的虚拟网卡的类型
"""
d = {"ProjectId": self.config.project_id, "Region": self.config.region}
req and d.update(req)
d = apis.DescribeSubnetResourceRequestSchema().dumps(d)
resp = self.invoke("DescribeSubnetResource", d, **kwargs)
return apis.DescribeSubnetResourceResponseSchema().loads(resp)

def describe_vpc(self, req=None, **kwargs):
""" DescribeVPC - 获取VPC信息
Expand Down
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-

version = "0.8.1"
version = "0.8.2"

0 comments on commit 57e3e0b

Please sign in to comment.