Skip to content

Commit a90d1b7

Browse files
authored
sdk: rolling update for 0.11.58 (#262)
1 parent 0a2d44e commit a90d1b7

File tree

4 files changed

+54
-50
lines changed

4 files changed

+54
-50
lines changed

ucloud/services/uhost/client.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,27 @@ def create_uhost_instance(
124124
- **ImageId** (str) - (Required) 镜像ID。 请通过 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_ 获取
125125
- **LoginMode** (str) - (Required) 主机登陆模式。密码(默认选项): Password,密钥:KeyPair。
126126
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
127-
- **AlarmTemplateId** (int) - 告警模板id,如果传了告警模板id,且告警模板id正确,则绑定告警模板。绑定告警模板失败只会在后台有日志,不会影响创建主机流程,也不会在前端报错
127+
- **AlarmTemplateId** (int) - 告警模板id,如果传了告警模板id,且告警模板id正确,则绑定告警模板。绑定告警模板失败不会影响创建主机流程
128128
- **AutoDataDiskInit** (str) - 数据盘是否需要自动分区挂载。当镜像支持“Cloud-init”Feature时可填写此字段。取值 >“On” 自动挂载(默认值)> “Off” 不自动挂载。
129129
- **CPU** (int) - 虚拟CPU核数。可选参数:1-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
130130
- **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ > Spot计费为抢占式实例(内测阶段) \\ 默认为月付
131131
- **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
132132
- **Disks** (list) - 见 **CreateUHostInstanceParamDisks** 模型定义
133133
- **Features** (dict) - 见 **CreateUHostInstanceParamFeatures** 模型定义
134134
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
135-
- **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","A100"]MachineType为G时必填
135+
- **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "V100S",2080","2080TiS","2080TiPro","3090","4090","A100"]MachineType为G时必填
136136
- **HostBinding** (bool) - 【私有专区属性】专区云主机开启宿住关联属性
137137
- **HotplugFeature** (bool) - 热升级特性。True为开启,False为未开启,默认False。
138138
- **IsolationGroup** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
139139
- **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
140-
- **MachineType** (str) - 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OS", "OM", "OPRO", "OMAX", "O.BM", "O.EPC"]。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
140+
- **MachineType** (str) - 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OM", "OMEM", "OPRO", "OPROG"]。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
141141
- **MaxCount** (int) - 本次最大创建主机数量,取值范围是[1,100],默认值为1。- 库存数量不足时,按库存数量创建。- 配额不足时,返回错误。- 使用隔离组时,以隔离组可用数量为准。
142142
- **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
143-
- **MinimalCpuPlatform** (str) - 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake", "Intel/CascadelakeR", "Intel/IceLake", "Amd/Epyc2", "Amd/Auto","Ampere/Auto","Ampere/Altra"],默认值是"Intel/Auto"。
143+
- **MinimalCpuPlatform** (str) - 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake", "Intel/CascadelakeR", "Intel/IceLake", "Intel/SapphireRapids", "Amd/Epyc2", "Amd/Auto","Ampere/Auto","Ampere/Altra"],默认值是"Intel/Auto"。
144144
- **Name** (str) - UHost实例名称。默认:UHost。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定实例名称。
145-
- **NetCapability** (str) - 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档)
145+
- **NetCapability** (str) - 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0;Extreme,开启网络增强3.0(详情参考官网文档)
146146
- **NetworkInterface** (list) - 见 **CreateUHostInstanceParamNetworkInterface** 模型定义
147-
- **Password** (str) - UHost密码。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx
147+
- **Password** (str) - UHost密码。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64 UGFzc3dvcmQx
148148
- **PrivateIp** (list) - 【数组】创建云主机时指定内网IP。若不传值,则随机分配当前子网下的IP。调用方式举例:PrivateIp.0=x.x.x.x。当前只支持一个内网IP。
149149
- **Quantity** (int) - 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
150150
- **SecGroupId** (list) - 见 **CreateUHostInstanceParamSecGroupId** 模型定义
@@ -169,7 +169,7 @@ def create_uhost_instance(
169169
170170
171171
**CreateUHostInstanceParamDisks**
172-
- **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > DATAARK,数据方舟【已下线,不再支持】 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ ,默认值:NONE
172+
- **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ ,默认值:NONE
173173
- **CouponId** (str) - 云盘代金券id。不适用于系统盘/本地盘。请通过DescribeCoupon接口查询,或登录用户中心查看
174174
- **Encrypted** (bool) - 【功能仅部分可用区开放,详询技术支持】磁盘是否加密。加密:true, 不加密: false加密必须传入对应的的KmsKeyId,默认值false
175175
- **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
@@ -180,7 +180,7 @@ def create_uhost_instance(
180180
181181
182182
**CreateUHostInstanceParamFeatures**
183-
- **UNI** (bool) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启,仅与 NetCapability Normal 兼容
183+
- **UNI** (bool) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。
184184
185185
186186
**CreateUHostInstanceParamNetworkInterfaceEIPGlobalSSH**
@@ -441,6 +441,7 @@ def describe_image(
441441
442442
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
443443
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
444+
- **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像。FuncType传参错误会被忽略
444445
- **ImageId** (str) - 镜像Id
445446
- **ImageType** (str) - 镜像类型。标准镜像:Base,镜像市场:Business, 自定义镜像:Custom,默认返回所有类型
446447
- **Limit** (int) - 返回数据长度,默认为20
@@ -459,14 +460,15 @@ def describe_image(
459460
**UHostImageSet**
460461
- **CreateTime** (int) - 创建时间,格式为Unix时间戳
461462
- **Features** (list) - 特殊状态标识,目前包含NetEnhnced(网络增强1.0), NetEnhanced_Ultra(网络增强2.0), NetEnhanced_Extreme(网络增强3.0), HotPlug(热升级), GPU(GPU镜像),CloudInit, IPv6(支持IPv6网络),RssdAttachable(支持RSSD云盘),Vgpu_AMD(支持AMD的vgpu),Vgpu_NVIDIA(支持NVIDIA的vgpu),Aarch64_Type(支持arm64架构)
462-
- **FuncType** (str) - 行业镜像类型(仅行业镜像将返回这个值)
463+
- **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像
463464
- **ImageDescription** (str) - 镜像描述
464465
- **ImageId** (str) - 镜像ID
465466
- **ImageName** (str) - 镜像名称
466467
- **ImageSize** (int) - 镜像大小
467468
- **ImageType** (str) - 镜像类型 标准镜像:Base, 行业镜像:Business,自定义镜像:Custom
468469
- **IntegratedSoftware** (str) - 集成软件名称(仅行业镜像将返回这个值)
469470
- **Links** (str) - 介绍链接(仅行业镜像将返回这个值)
471+
- **MaintainEol** (str) - 系统EOL的时间,格式:YYYY/MM/DD
470472
- **MinimalCPU** (str) - 默认值为空'''。当CentOS 7.3/7.4/7.5等镜像会标记为“Broadwell”
471473
- **OsName** (str) - 操作系统名称
472474
- **OsType** (str) - 操作系统类型:Linux,Windows
@@ -1004,7 +1006,7 @@ def get_uhost_upgrade_price(
10041006
- **CPU** (int) - 虚拟CPU核数。可选参数:1-64(可选范围参考控制台)。默认值为当前实例的CPU核数。
10051007
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
10061008
- **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值为当前实例的内存大小。
1007-
- **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)
1009+
- **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)。仅支持网络增强1.0和网络增强2.0的开启和关闭,不支持网络增强特性互相转换,如网络增强1.0升级到网络增强2.0是不被支持的。
10081010
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
10091011
10101012
**Response**

ucloud/services/uhost/schemas/apis.py

+1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ class DescribeImageRequestSchema(schema.RequestSchema):
452452
"""DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。"""
453453

454454
fields = {
455+
"FuncType": fields.Str(required=False, dump_to="FuncType"),
455456
"ImageId": fields.Str(required=False, dump_to="ImageId"),
456457
"ImageType": fields.Str(required=False, dump_to="ImageType"),
457458
"Limit": fields.Int(required=False, dump_to="Limit"),

ucloud/services/uhost/schemas/models.py

+40-39
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,25 @@ class FeatureModesSchema(schema.ResponseSchema):
6262
}
6363

6464

65+
class DisksSchema(schema.ResponseSchema):
66+
"""Disks - 磁盘信息"""
67+
68+
fields = {
69+
"BootDisk": fields.List(BootDiskInfoSchema()),
70+
"DataDisk": fields.List(DataDiskInfoSchema()),
71+
"Name": fields.Str(required=False, load_from="Name"),
72+
}
73+
74+
75+
class MachineSizesSchema(schema.ResponseSchema):
76+
"""MachineSizes - GPU、CPU和内存信息"""
77+
78+
fields = {
79+
"Collection": fields.List(CollectionSchema()),
80+
"Gpu": fields.Int(required=False, load_from="Gpu"),
81+
}
82+
83+
6584
class GraphicsMemorySchema(schema.ResponseSchema):
6685
"""GraphicsMemory - GPU的显存指标"""
6786

@@ -71,12 +90,11 @@ class GraphicsMemorySchema(schema.ResponseSchema):
7190
}
7291

7392

74-
class DisksSchema(schema.ResponseSchema):
75-
"""Disks - 磁盘信息"""
93+
class FeaturesSchema(schema.ResponseSchema):
94+
"""Features - 虚机可支持的特性"""
7695

7796
fields = {
78-
"BootDisk": fields.List(BootDiskInfoSchema()),
79-
"DataDisk": fields.List(DataDiskInfoSchema()),
97+
"Modes": fields.List(FeatureModesSchema()),
8098
"Name": fields.Str(required=False, load_from="Name"),
8199
}
82100

@@ -100,24 +118,6 @@ class PerformanceSchema(schema.ResponseSchema):
100118
}
101119

102120

103-
class MachineSizesSchema(schema.ResponseSchema):
104-
"""MachineSizes - GPU、CPU和内存信息"""
105-
106-
fields = {
107-
"Collection": fields.List(CollectionSchema()),
108-
"Gpu": fields.Int(required=False, load_from="Gpu"),
109-
}
110-
111-
112-
class FeaturesSchema(schema.ResponseSchema):
113-
"""Features - 虚机可支持的特性"""
114-
115-
fields = {
116-
"Modes": fields.List(FeatureModesSchema()),
117-
"Name": fields.Str(required=False, load_from="Name"),
118-
}
119-
120-
121121
class AvailableInstanceTypesSchema(schema.ResponseSchema):
122122
"""AvailableInstanceTypes - https://ushare.ucloudadmin.com/pages/viewpage.action?pageId=104662646"""
123123

@@ -153,6 +153,7 @@ class UHostImageSetSchema(schema.ResponseSchema):
153153
required=False, load_from="IntegratedSoftware"
154154
),
155155
"Links": fields.Str(required=False, load_from="Links"),
156+
"MaintainEol": fields.Str(required=False, load_from="MaintainEol"),
156157
"MinimalCPU": fields.Str(required=False, load_from="MinimalCPU"),
157158
"OsName": fields.Str(required=False, load_from="OsName"),
158159
"OsType": fields.Str(required=False, load_from="OsType"),
@@ -187,21 +188,22 @@ class IsolationGroupSchema(schema.ResponseSchema):
187188
}
188189

189190

190-
class UDSetUDHostAttributeSchema(schema.ResponseSchema):
191-
"""UDSetUDHostAttribute - 私有专区对应的宿主机属性"""
191+
class UHostKeyPairSchema(schema.ResponseSchema):
192+
"""UHostKeyPair - 主机密钥信息"""
192193

193194
fields = {
194-
"HostBinding": fields.Bool(required=False, load_from="HostBinding"),
195-
"UDHostId": fields.Str(required=False, load_from="UDHostId"),
196-
"UDSetId": fields.Str(required=False, load_from="UDSetId"),
195+
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
196+
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
197197
}
198198

199199

200-
class SpotAttributeSchema(schema.ResponseSchema):
201-
"""SpotAttribute - 竞价实例属性"""
200+
class UDSetUDHostAttributeSchema(schema.ResponseSchema):
201+
"""UDSetUDHostAttribute - 私有专区对应的宿主机属性"""
202202

203203
fields = {
204-
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
204+
"HostBinding": fields.Bool(required=False, load_from="HostBinding"),
205+
"UDHostId": fields.Str(required=False, load_from="UDHostId"),
206+
"UDSetId": fields.Str(required=False, load_from="UDSetId"),
205207
}
206208

207209

@@ -221,6 +223,14 @@ class UHostDiskSetSchema(schema.ResponseSchema):
221223
}
222224

223225

226+
class SpotAttributeSchema(schema.ResponseSchema):
227+
"""SpotAttribute - 竞价实例属性"""
228+
229+
fields = {
230+
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
231+
}
232+
233+
224234
class UHostIPSetSchema(schema.ResponseSchema):
225235
"""UHostIPSet - DescribeUHostInstance"""
226236

@@ -241,15 +251,6 @@ class UHostIPSetSchema(schema.ResponseSchema):
241251
}
242252

243253

244-
class UHostKeyPairSchema(schema.ResponseSchema):
245-
"""UHostKeyPair - 主机密钥信息"""
246-
247-
fields = {
248-
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
249-
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
250-
}
251-
252-
253254
class UHostInstanceSetSchema(schema.ResponseSchema):
254255
"""UHostInstanceSet - DescribeUHostInstance"""
255256

ucloud/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.11.57"
1+
version = "0.11.58"

0 commit comments

Comments
 (0)