Skip to content

Commit 3ad32bf

Browse files
authored
auto codegen for UNet
1 parent e54d099 commit 3ad32bf

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

ucloud/services/unet/client.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ def allocate_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
2121
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。
2222
- **Region** (str) - (Config) 地域。
2323
- **Bandwidth** (int) - (Required) 弹性IP的外网带宽, 单位为Mbps. 共享带宽模式必须指定0M带宽, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-10000]
24-
- **OperatorName** (str) - (Required) 弹性IP线路,枚举值:国际线路, International;BGP线路:Bgp。使用BGP线路的地域:北京二、上海金融云、上海二、广州等,其他地域均使用国际线路。
24+
- **OperatorName** (str) - (Required) 弹性IP线路,枚举值:国际线路, International;BGP线路:Bgp;精品BGP:BGPPro。使用BGP线路的地域:北京二、上海金融云、上海二、广州等,其他地域均使用国际线路。使用BGPPro线路的地域:香港
2525
- **ChargeType** (str) - 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费,默认为按月付费。
26+
- **Count** (int) - 购买EIP数量,默认值为1
2627
- **CouponId** (str) - 代金券ID, 默认不使用
2728
- **Name** (str) - 弹性IP的名称, 默认为 "EIP"
2829
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. 默认为 "Bandwidth".“PostAccurateBandwidth”:带宽后付费模式
@@ -44,7 +45,7 @@ def allocate_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
4445
4546
**UnetEIPAddrSet**
4647
- **IP** (str) - IP地址
47-
- **OperatorName** (str) - 运营商信息如: 国际: International, BGP: BGP
48+
- **OperatorName** (str) - 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp
4849
4950
5051
"""
@@ -134,6 +135,7 @@ def bind_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
134135
- **EIPId** (str) - (Required) 弹性IP的资源Id
135136
- **ResourceId** (str) - (Required) 弹性IP请求绑定的资源ID
136137
- **ResourceType** (str) - (Required) 弹性IP请求绑定的资源类型, 枚举值为: uhost: 云主机; ulb, 负载均衡器 upm: 物理机; hadoophost: 大数据集群;fortresshost:堡垒机;udockhost:容器;udhost:私有专区主机;natgw:natgw;udb:udb;vpngw:ipsec vpn;ucdr:云灾备;dbaudit:数据库审计;uni:虚拟网卡;cube,Cube容器。如果EIP为普通带宽计费,且带宽值高于2G,则只允许绑定在快杰型云主机和ULB
138+
- **PrivateIP** (str) - EIP与内网IP进行绑定时需要传入UNI下未绑定过EIP的内网IP
137139
138140
**Response**
139141
@@ -394,7 +396,7 @@ def describe_eip(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
394396
395397
**UnetEIPAddrSet**
396398
- **IP** (str) - IP地址
397-
- **OperatorName** (str) - 运营商信息如: 国际: International, BGP: BGP
399+
- **OperatorName** (str) - 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp
398400
399401
400402
**UnetEIPResourceSet**

ucloud/services/unet/schemas/apis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class AllocateEIPRequestSchema(schema.RequestSchema):
2121
fields = {
2222
"Bandwidth": fields.Int(required=True, dump_to="Bandwidth"),
2323
"ChargeType": fields.Str(required=False, dump_to="ChargeType"),
24+
"Count": fields.Int(required=False, dump_to="Count"),
2425
"CouponId": fields.Str(required=False, dump_to="CouponId"),
2526
"Name": fields.Str(required=False, dump_to="Name"),
2627
"OperatorName": fields.Str(required=True, dump_to="OperatorName"),
@@ -124,6 +125,7 @@ class BindEIPRequestSchema(schema.RequestSchema):
124125

125126
fields = {
126127
"EIPId": fields.Str(required=True, dump_to="EIPId"),
128+
"PrivateIP": fields.Str(required=False, dump_to="PrivateIP"),
127129
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
128130
"Region": fields.Str(required=True, dump_to="Region"),
129131
"ResourceId": fields.Str(required=True, dump_to="ResourceId"),

ucloud/services/unet/schemas/models.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class UnetEIPAddrSetSchema(schema.ResponseSchema):
7-
"""UnetEIPAddrSet - AllocateEIP"""
7+
"""UnetEIPAddrSet - DescribeEIP"""
88

99
fields = {
1010
"IP": fields.Str(required=False, load_from="IP"),
@@ -55,6 +55,22 @@ class UnetBandwidthUsageEIPSetSchema(schema.ResponseSchema):
5555
}
5656

5757

58+
class ShareBandwidthSetSchema(schema.ResponseSchema):
59+
"""ShareBandwidthSet - DescribeEIP"""
60+
61+
fields = {
62+
"ShareBandwidth": fields.Int(
63+
required=False, load_from="ShareBandwidth"
64+
),
65+
"ShareBandwidthId": fields.Str(
66+
required=False, load_from="ShareBandwidthId"
67+
),
68+
"ShareBandwidthName": fields.Str(
69+
required=False, load_from="ShareBandwidthName"
70+
),
71+
}
72+
73+
5874
class UnetEIPResourceSetSchema(schema.ResponseSchema):
5975
"""UnetEIPResourceSet - DescribeEIP"""
6076

@@ -76,22 +92,6 @@ class UnetEIPResourceSetSchema(schema.ResponseSchema):
7692
}
7793

7894

79-
class ShareBandwidthSetSchema(schema.ResponseSchema):
80-
"""ShareBandwidthSet - DescribeEIP"""
81-
82-
fields = {
83-
"ShareBandwidth": fields.Int(
84-
required=False, load_from="ShareBandwidth"
85-
),
86-
"ShareBandwidthId": fields.Str(
87-
required=False, load_from="ShareBandwidthId"
88-
),
89-
"ShareBandwidthName": fields.Str(
90-
required=False, load_from="ShareBandwidthName"
91-
),
92-
}
93-
94-
9595
class UnetEIPSetSchema(schema.ResponseSchema):
9696
"""UnetEIPSet - DescribeEIP"""
9797

0 commit comments

Comments
 (0)