From 57e3e0b769772bdf7fdc40389e34afcf3fae8205 Mon Sep 17 00:00:00 2001 From: Yufei Li Date: Thu, 12 Mar 2020 17:58:36 +0800 Subject: [PATCH] migrate from py3 (#15) --- ucloud/services/vpc/client.py | 33 +++++++++++++++++++++++++++++++++ ucloud/version.py | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/ucloud/services/vpc/client.py b/ucloud/services/vpc/client.py index df820e5..0b22082 100644 --- a/ucloud/services/vpc/client.py +++ b/ucloud/services/vpc/client.py @@ -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接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **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信息 diff --git a/ucloud/version.py b/ucloud/version.py index f57a59f..8c1bf01 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -version = "0.8.1" +version = "0.8.2"