Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions ucloud/services/ipv6gw/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,48 @@ def describe_ipv_6gateway_attribute(
resp = self.invoke("DescribeIpv6GatewayAttribute", d, **kwargs)
return apis.DescribeIpv6GatewayAttributeResponseSchema().loads(resp)

def describe_ipv_6gateways(
self, req: typing.Optional[dict] = None, **kwargs
) -> dict:
"""DescribeIpv6Gateways - ipv6网关列表

**Request**

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **Ipv6GatewayIds** (list) - ipv6网关ID列表,最大长度为20。指定Ipv6GatewayIds查询时,将忽略其他条件
- **Limit** (int) - 返回数据长度,默认值为20,最大值为100
- **Offset** (int) - 列表起始位置偏移量,默认值为0
- **VPCId** (str) - vpc ID

**Response**

- **Ipv6GatewayInfos** (list) - 见 **IPv6GateWayInfo** 模型定义
- **TotalCount** (int) - Ipv6Gateway总数。指定Ipv6GatewayIds / VPCId时,返回数量受限

**Response Model**

**IPv6GateWayInfo**
- **CreateTime** (int) - 创建时间
- **Ipv6GatewayId** (str) - ipv6 网关 ID
- **Name** (str) - 名称
- **Remark** (str) - 备注
- **Tag** (str) - 业务组
- **VPCId** (str) - vpc ID


"""
# build request
d = {
"ProjectId": self.config.project_id,
"Region": self.config.region,
}
req and d.update(req)
d = apis.DescribeIpv6GatewaysRequestSchema().dumps(d)

resp = self.invoke("DescribeIpv6Gateways", d, **kwargs)
return apis.DescribeIpv6GatewaysResponseSchema().loads(resp)

def modify_ipv_6internet_bandwidth(
self, req: typing.Optional[dict] = None, **kwargs
) -> dict:
Expand Down
33 changes: 33 additions & 0 deletions ucloud/services/ipv6gw/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,39 @@ class DescribeIpv6GatewayAttributeResponseSchema(schema.ResponseSchema):
}


"""
API: DescribeIpv6Gateways

ipv6网关列表
"""


class DescribeIpv6GatewaysRequestSchema(schema.RequestSchema):
"""DescribeIpv6Gateways - ipv6网关列表"""

fields = {
"Ipv6GatewayIds": fields.List(fields.Str()),
"Limit": fields.Int(required=False, dump_to="Limit"),
"Offset": fields.Int(required=False, dump_to="Offset"),
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"VPCId": fields.Str(required=False, dump_to="VPCId"),
}


class DescribeIpv6GatewaysResponseSchema(schema.ResponseSchema):
"""DescribeIpv6Gateways - ipv6网关列表"""

fields = {
"Ipv6GatewayInfos": fields.List(
models.IPv6GateWayInfoSchema(),
required=False,
load_from="Ipv6GatewayInfos",
),
"TotalCount": fields.Int(required=False, load_from="TotalCount"),
}


"""
API: ModifyIpv6InternetBandwidth

Expand Down
13 changes: 13 additions & 0 deletions ucloud/services/ipv6gw/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ class IPv6AddressInfoSchema(schema.ResponseSchema):
"Status": fields.Str(required=False, load_from="Status"),
"SubnetId": fields.Str(required=False, load_from="SubnetId"),
}


class IPv6GateWayInfoSchema(schema.ResponseSchema):
"""IPv6GateWayInfo - ipv6 网关信息"""

fields = {
"CreateTime": fields.Int(required=False, load_from="CreateTime"),
"Ipv6GatewayId": fields.Str(required=False, load_from="Ipv6GatewayId"),
"Name": fields.Str(required=False, load_from="Name"),
"Remark": fields.Str(required=False, load_from="Remark"),
"Tag": fields.Str(required=False, load_from="Tag"),
"VPCId": fields.Str(required=False, load_from="VPCId"),
}
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.11.84"
version = "0.11.85"