Skip to content

Commit 7a3d7a4

Browse files
authored
sdk: rolling update for 0.11.59 (#263)
1 parent a90d1b7 commit 7a3d7a4

File tree

6 files changed

+191
-91
lines changed

6 files changed

+191
-91
lines changed

ucloud/services/uhost/schemas/models.py

+56-56
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ class KeyPairSchema(schema.ResponseSchema):
2020
}
2121

2222

23+
class FeatureModesSchema(schema.ResponseSchema):
24+
"""FeatureModes - 可以支持的模式类别"""
25+
26+
fields = {
27+
"MinimalCpuPlatform": fields.List(fields.Str()),
28+
"Name": fields.Str(required=False, load_from="Name"),
29+
"RelatedToImageFeature": fields.List(fields.Str()),
30+
}
31+
32+
2333
class DataDiskInfoSchema(schema.ResponseSchema):
2434
"""DataDiskInfo - 数据盘信息"""
2535

@@ -52,13 +62,12 @@ class CollectionSchema(schema.ResponseSchema):
5262
}
5363

5464

55-
class FeatureModesSchema(schema.ResponseSchema):
56-
"""FeatureModes - 可以支持的模式类别"""
65+
class FeaturesSchema(schema.ResponseSchema):
66+
"""Features - 虚机可支持的特性"""
5767

5868
fields = {
59-
"MinimalCpuPlatform": fields.List(fields.Str()),
69+
"Modes": fields.List(FeatureModesSchema()),
6070
"Name": fields.Str(required=False, load_from="Name"),
61-
"RelatedToImageFeature": fields.List(fields.Str()),
6271
}
6372

6473

@@ -72,49 +81,40 @@ class DisksSchema(schema.ResponseSchema):
7281
}
7382

7483

75-
class MachineSizesSchema(schema.ResponseSchema):
76-
"""MachineSizes - GPU、CPU和内存信息"""
84+
class CpuPlatformsSchema(schema.ResponseSchema):
85+
"""CpuPlatforms - CPU平台信息"""
7786

7887
fields = {
79-
"Collection": fields.List(CollectionSchema()),
80-
"Gpu": fields.Int(required=False, load_from="Gpu"),
88+
"Amd": fields.List(fields.Str()),
89+
"Ampere": fields.List(fields.Str()),
90+
"Intel": fields.List(fields.Str()),
8191
}
8292

8393

84-
class GraphicsMemorySchema(schema.ResponseSchema):
85-
"""GraphicsMemory - GPU的显存指标"""
94+
class PerformanceSchema(schema.ResponseSchema):
95+
"""Performance - GPU的性能指标"""
8696

8797
fields = {
8898
"Rate": fields.Int(required=False, load_from="Rate"),
89-
"Value": fields.Int(required=False, load_from="Value"),
90-
}
91-
92-
93-
class FeaturesSchema(schema.ResponseSchema):
94-
"""Features - 虚机可支持的特性"""
95-
96-
fields = {
97-
"Modes": fields.List(FeatureModesSchema()),
98-
"Name": fields.Str(required=False, load_from="Name"),
99+
"Value": fields.Float(required=False, load_from="Value"),
99100
}
100101

101102

102-
class CpuPlatformsSchema(schema.ResponseSchema):
103-
"""CpuPlatforms - CPU平台信息"""
103+
class MachineSizesSchema(schema.ResponseSchema):
104+
"""MachineSizes - GPU、CPU和内存信息"""
104105

105106
fields = {
106-
"Amd": fields.List(fields.Str()),
107-
"Ampere": fields.List(fields.Str()),
108-
"Intel": fields.List(fields.Str()),
107+
"Collection": fields.List(CollectionSchema()),
108+
"Gpu": fields.Int(required=False, load_from="Gpu"),
109109
}
110110

111111

112-
class PerformanceSchema(schema.ResponseSchema):
113-
"""Performance - GPU的性能指标"""
112+
class GraphicsMemorySchema(schema.ResponseSchema):
113+
"""GraphicsMemory - GPU的显存指标"""
114114

115115
fields = {
116116
"Rate": fields.Int(required=False, load_from="Rate"),
117-
"Value": fields.Float(required=False, load_from="Value"),
117+
"Value": fields.Int(required=False, load_from="Value"),
118118
}
119119

120120

@@ -188,15 +188,6 @@ class IsolationGroupSchema(schema.ResponseSchema):
188188
}
189189

190190

191-
class UHostKeyPairSchema(schema.ResponseSchema):
192-
"""UHostKeyPair - 主机密钥信息"""
193-
194-
fields = {
195-
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
196-
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
197-
}
198-
199-
200191
class UDSetUDHostAttributeSchema(schema.ResponseSchema):
201192
"""UDSetUDHostAttribute - 私有专区对应的宿主机属性"""
202193

@@ -207,27 +198,12 @@ class UDSetUDHostAttributeSchema(schema.ResponseSchema):
207198
}
208199

209200

210-
class UHostDiskSetSchema(schema.ResponseSchema):
211-
"""UHostDiskSet - DescribeUHostInstance"""
212-
213-
fields = {
214-
"BackupType": fields.Str(required=False, load_from="BackupType"),
215-
"DiskId": fields.Str(required=False, load_from="DiskId"),
216-
"DiskType": fields.Str(required=True, load_from="DiskType"),
217-
"Drive": fields.Str(required=False, load_from="Drive"),
218-
"Encrypted": fields.Str(required=False, load_from="Encrypted"),
219-
"IsBoot": fields.Str(required=True, load_from="IsBoot"),
220-
"Name": fields.Str(required=False, load_from="Name"),
221-
"Size": fields.Int(required=False, load_from="Size"),
222-
"Type": fields.Str(required=False, load_from="Type"),
223-
}
224-
225-
226-
class SpotAttributeSchema(schema.ResponseSchema):
227-
"""SpotAttribute - 竞价实例属性"""
201+
class UHostKeyPairSchema(schema.ResponseSchema):
202+
"""UHostKeyPair - 主机密钥信息"""
228203

229204
fields = {
230-
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
205+
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
206+
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
231207
}
232208

233209

@@ -251,6 +227,30 @@ class UHostIPSetSchema(schema.ResponseSchema):
251227
}
252228

253229

230+
class SpotAttributeSchema(schema.ResponseSchema):
231+
"""SpotAttribute - 竞价实例属性"""
232+
233+
fields = {
234+
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
235+
}
236+
237+
238+
class UHostDiskSetSchema(schema.ResponseSchema):
239+
"""UHostDiskSet - DescribeUHostInstance"""
240+
241+
fields = {
242+
"BackupType": fields.Str(required=False, load_from="BackupType"),
243+
"DiskId": fields.Str(required=False, load_from="DiskId"),
244+
"DiskType": fields.Str(required=True, load_from="DiskType"),
245+
"Drive": fields.Str(required=False, load_from="Drive"),
246+
"Encrypted": fields.Str(required=False, load_from="Encrypted"),
247+
"IsBoot": fields.Str(required=True, load_from="IsBoot"),
248+
"Name": fields.Str(required=False, load_from="Name"),
249+
"Size": fields.Int(required=False, load_from="Size"),
250+
"Type": fields.Str(required=False, load_from="Type"),
251+
}
252+
253+
254254
class UHostInstanceSetSchema(schema.ResponseSchema):
255255
"""UHostInstanceSet - DescribeUHostInstance"""
256256

ucloud/services/umem/schemas/models.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ class UDRedisSlowlogSetSchema(schema.ResponseSchema):
2525
}
2626

2727

28+
class UMemSpaceAddressSetSchema(schema.ResponseSchema):
29+
"""UMemSpaceAddressSet - DescribeUMemSpace"""
30+
31+
fields = {
32+
"IP": fields.Str(required=False, load_from="IP"),
33+
"Port": fields.Int(required=False, load_from="Port"),
34+
}
35+
36+
2837
class UMemSlaveDataSetSchema(schema.ResponseSchema):
2938
"""UMemSlaveDataSet - DescribeUMem"""
3039

@@ -55,15 +64,6 @@ class UMemSlaveDataSetSchema(schema.ResponseSchema):
5564
}
5665

5766

58-
class UMemSpaceAddressSetSchema(schema.ResponseSchema):
59-
"""UMemSpaceAddressSet - DescribeUMemSpace"""
60-
61-
fields = {
62-
"IP": fields.Str(required=False, load_from="IP"),
63-
"Port": fields.Int(required=False, load_from="Port"),
64-
}
65-
66-
6767
class UMemDataSetSchema(schema.ResponseSchema):
6868
"""UMemDataSet - DescribeUMem"""
6969

ucloud/services/unet/client.py

+57-9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def allocate_share_bandwidth(
7878
- **IPVersion** (str) - 共享带宽类型,IPv4或者IPv6,不传默认IPv4
7979
- **OperatorName** (str) - 共享带宽线路:BGP 国内多线,International 国际多线,ChinaMobile 移动单线,Unicom 联通单线,Telecom 电信单线,BGPPro 精品BGP(仅香港支持精品BGP)
8080
- **Quantity** (int) - 购买时长
81+
- **Tag** (str) - 业务组名称, 默认为 "Default"
8182
8283
**Response**
8384
@@ -197,7 +198,7 @@ def create_firewall(
197198
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写
198199
- **Region** (str) - (Config) 地域
199200
- **Name** (str) - (Required) 防火墙名称
200-
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注,bj1不支持添加备注
201+
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注,备注最大长度64
201202
- **Remark** (str) - 防火墙描述,默认为空
202203
- **Tag** (str) - 防火墙业务组,默认为Default
203204
@@ -325,9 +326,11 @@ def describe_bandwidth_usage(
325326
326327
**Request**
327328
328-
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
329-
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
329+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
330+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
331+
- **BeginTime** (int) - 统计开始时间
330332
- **EIPIds** (list) - 弹性IP的资源Id. 如果为空, 则返回当前 Region中符合条件的所有EIP的带宽用量, n为自然数
333+
- **EndTime** (int) - 统计结束时间
331334
- **Limit** (int) - 返回数据分页值, 取值范围为 [0,10000000] 之间的整数, 默认为20
332335
- **OffSet** (int) - 返回数据偏移量, 默认为0
333336
@@ -447,8 +450,8 @@ def describe_firewall(
447450
- **FWId** (str) - 防火墙ID,默认为返回所有防火墙
448451
- **Limit** (int) - 返回数据长度,默认为20,最大10000000
449452
- **Offset** (int) - 列表起始位置偏移量,默认为0
450-
- **ResourceId** (str) - 绑定防火墙组的资源ID
451-
- **ResourceType** (str) - 绑定防火墙组的资源类型,默认为全部资源类型。枚举值为:"unatgw",NAT网关; "uhost",云主机;“uni”,虚拟网卡; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计.
453+
- **ResourceId** (str) - 绑定防火墙组的资源ID
454+
- **ResourceType** (str) - 绑定防火墙的资源类型,仅获取资源对应防火墙信息时需要。枚举值为:"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计;”uni“,虚拟网卡;“cube”,Cube容器实例;“ulb”,负载均衡实例。
452455
453456
**Response**
454457
@@ -536,6 +539,51 @@ def describe_firewall_resource(
536539
resp = self.invoke("DescribeFirewallResource", d, **kwargs)
537540
return apis.DescribeFirewallResourceResponseSchema().loads(resp)
538541

542+
def describe_private_ip(
543+
self, req: typing.Optional[dict] = None, **kwargs
544+
) -> dict:
545+
"""DescribePrivateIP - 获取资源绑定的内网IP信息
546+
547+
**Request**
548+
549+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
550+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
551+
- **Limit** (int) - 获取信息数量 ,默认20;不允许为0
552+
- **ObjectId** (str) - 虚拟网卡的资源ID; ObjectId为空时,则获取项目下所有的虚拟网卡主辅IP信息
553+
- **Offset** (int) - 列表起始位置偏移量,默认为0
554+
- **SubnetId** (str) - 子网的ID
555+
- **VPCId** (str) - VPC的ID
556+
557+
**Response**
558+
559+
- **DataSet** (list) - 见 **DescribeSecondaryIPDataSet** 模型定义
560+
- **TotalCount** (int) - 返回资源数量
561+
562+
**Response Model**
563+
564+
**DescribeSecondaryIPDataSet**
565+
- **EIP** (str) - 外网IP
566+
- **EIPId** (str) - EIP资源ID
567+
- **PrivateIP** (str) - 内网IP
568+
- **PrivateIPType** (str) - 内网IP类型;枚举值:PrimaryIP:主内网IP,SecondaryIP:辅助内网IP
569+
- **ResourceID** (str) - 资源ID
570+
- **ResourceName** (str) - 资源名称
571+
- **SubnetID** (str) - 子网ID
572+
- **VPCID** (str) - VPCID
573+
574+
575+
"""
576+
# build request
577+
d = {
578+
"ProjectId": self.config.project_id,
579+
"Region": self.config.region,
580+
}
581+
req and d.update(req)
582+
d = apis.DescribePrivateIPRequestSchema().dumps(d)
583+
584+
resp = self.invoke("DescribePrivateIP", d, **kwargs)
585+
return apis.DescribePrivateIPResponseSchema().loads(resp)
586+
539587
def describe_share_bandwidth(
540588
self, req: typing.Optional[dict] = None, **kwargs
541589
) -> dict:
@@ -900,7 +948,7 @@ def grant_firewall(
900948
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
901949
- **FWId** (str) - (Required) 防火墙资源ID
902950
- **ResourceId** (str) - (Required) 所应用资源ID
903-
- **ResourceType** (str) - (Required) 绑定防火墙组的资源类型,默认为全部资源类型。枚举值为:"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计”uni“,虚拟网卡“cube”,Cube容器实例。
951+
- **ResourceType** (str) - (Required) 绑定防火墙的资源类型,枚举值为:"unatgw",NAT网关; "uhost",云主机; "upm",物理云主机; "hadoophost",hadoop节点; "fortresshost",堡垒机; "udhost",私有专区主机;"udockhost",容器;"dbaudit",数据库审计”uni“,虚拟网卡“cube”,Cube容器实例;“ulb”,负载均衡实例
904952
905953
**Response**
906954
@@ -1140,10 +1188,10 @@ def update_firewall(
11401188
11411189
**Request**
11421190
1143-
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
1144-
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
1191+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1192+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
11451193
- **FWId** (str) - (Required) 防火墙资源ID
1146-
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注
1194+
- **Rule** (list) - (Required) 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注, 备注最大长度64
11471195
11481196
**Response**
11491197

ucloud/services/unet/schemas/apis.py

+37
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class AllocateShareBandwidthRequestSchema(schema.RequestSchema):
7474
"ShareBandwidthGuarantee": fields.Int(
7575
required=False, dump_to="ShareBandwidthGuarantee"
7676
), # Deprecated, will be removed at 1.0
77+
"Tag": fields.Str(required=False, dump_to="Tag"),
7778
}
7879

7980

@@ -291,7 +292,9 @@ class DescribeBandwidthUsageRequestSchema(schema.RequestSchema):
291292
"""DescribeBandwidthUsage - 获取带宽用量信息"""
292293

293294
fields = {
295+
"BeginTime": fields.Int(required=False, dump_to="BeginTime"),
294296
"EIPIds": fields.List(fields.Str()),
297+
"EndTime": fields.Int(required=False, dump_to="EndTime"),
295298
"Limit": fields.Int(required=False, dump_to="Limit"),
296299
"OffSet": fields.Int(required=False, dump_to="OffSet"),
297300
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
@@ -409,6 +412,40 @@ class DescribeFirewallResourceResponseSchema(schema.ResponseSchema):
409412
}
410413

411414

415+
"""
416+
API: DescribePrivateIP
417+
418+
获取资源绑定的内网IP信息
419+
"""
420+
421+
422+
class DescribePrivateIPRequestSchema(schema.RequestSchema):
423+
"""DescribePrivateIP - 获取资源绑定的内网IP信息"""
424+
425+
fields = {
426+
"Limit": fields.Int(required=False, dump_to="Limit"),
427+
"ObjectId": fields.Str(required=False, dump_to="ObjectId"),
428+
"Offset": fields.Int(required=False, dump_to="Offset"),
429+
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
430+
"Region": fields.Str(required=True, dump_to="Region"),
431+
"SubnetId": fields.Str(required=False, dump_to="SubnetId"),
432+
"VPCId": fields.Str(required=False, dump_to="VPCId"),
433+
}
434+
435+
436+
class DescribePrivateIPResponseSchema(schema.ResponseSchema):
437+
"""DescribePrivateIP - 获取资源绑定的内网IP信息"""
438+
439+
fields = {
440+
"DataSet": fields.List(
441+
models.DescribeSecondaryIPDataSetSchema(),
442+
required=True,
443+
load_from="DataSet",
444+
),
445+
"TotalCount": fields.Int(required=True, load_from="TotalCount"),
446+
}
447+
448+
412449
"""
413450
API: DescribeShareBandwidth
414451

0 commit comments

Comments
 (0)