Skip to content

sdk: rolling update for 0.11.58 #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024
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
22 changes: 12 additions & 10 deletions ucloud/services/uhost/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,27 @@ def create_uhost_instance(
- **ImageId** (str) - (Required) 镜像ID。 请通过 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_ 获取
- **LoginMode** (str) - (Required) 主机登陆模式。密码(默认选项): Password,密钥:KeyPair。
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **AlarmTemplateId** (int) - 告警模板id,如果传了告警模板id,且告警模板id正确,则绑定告警模板。绑定告警模板失败只会在后台有日志,不会影响创建主机流程,也不会在前端报错
- **AlarmTemplateId** (int) - 告警模板id,如果传了告警模板id,且告警模板id正确,则绑定告警模板。绑定告警模板失败不会影响创建主机流程
- **AutoDataDiskInit** (str) - 数据盘是否需要自动分区挂载。当镜像支持“Cloud-init”Feature时可填写此字段。取值 >“On” 自动挂载(默认值)> “Off” 不自动挂载。
- **CPU** (int) - 虚拟CPU核数。可选参数:1-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
- **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ > Spot计费为抢占式实例(内测阶段) \\ 默认为月付
- **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
- **Disks** (list) - 见 **CreateUHostInstanceParamDisks** 模型定义
- **Features** (dict) - 见 **CreateUHostInstanceParamFeatures** 模型定义
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
- **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","A100"]MachineType为G时必填
- **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "V100S",2080","2080TiS","2080TiPro","3090","4090","A100"]MachineType为G时必填
- **HostBinding** (bool) - 【私有专区属性】专区云主机开启宿住关联属性
- **HotplugFeature** (bool) - 热升级特性。True为开启,False为未开启,默认False。
- **IsolationGroup** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
- **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
- **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>`_ 。
- **MachineType** (str) - 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OM", "OMEM", "OPRO", "OPROG"]。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
- **MaxCount** (int) - 本次最大创建主机数量,取值范围是[1,100],默认值为1。- 库存数量不足时,按库存数量创建。- 配额不足时,返回错误。- 使用隔离组时,以隔离组可用数量为准。
- **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
- **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"。
- **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"。
- **Name** (str) - UHost实例名称。默认:UHost。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定实例名称。
- **NetCapability** (str) - 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档)
- **NetCapability** (str) - 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0;Extreme,开启网络增强3.0(详情参考官网文档)
- **NetworkInterface** (list) - 见 **CreateUHostInstanceParamNetworkInterface** 模型定义
- **Password** (str) - UHost密码。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx
- **Password** (str) - UHost密码。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64 UGFzc3dvcmQx
- **PrivateIp** (list) - 【数组】创建云主机时指定内网IP。若不传值,则随机分配当前子网下的IP。调用方式举例:PrivateIp.0=x.x.x.x。当前只支持一个内网IP。
- **Quantity** (int) - 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
- **SecGroupId** (list) - 见 **CreateUHostInstanceParamSecGroupId** 模型定义
Expand All @@ -169,7 +169,7 @@ def create_uhost_instance(


**CreateUHostInstanceParamDisks**
- **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > DATAARK,数据方舟【已下线,不再支持】 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ ,默认值:NONE
- **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ ,默认值:NONE
- **CouponId** (str) - 云盘代金券id。不适用于系统盘/本地盘。请通过DescribeCoupon接口查询,或登录用户中心查看
- **Encrypted** (bool) - 【功能仅部分可用区开放,详询技术支持】磁盘是否加密。加密:true, 不加密: false加密必须传入对应的的KmsKeyId,默认值false
- **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
Expand All @@ -180,7 +180,7 @@ def create_uhost_instance(


**CreateUHostInstanceParamFeatures**
- **UNI** (bool) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启,仅与 NetCapability Normal 兼容
- **UNI** (bool) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。


**CreateUHostInstanceParamNetworkInterfaceEIPGlobalSSH**
Expand Down Expand Up @@ -441,6 +441,7 @@ def describe_image(

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像。FuncType传参错误会被忽略
- **ImageId** (str) - 镜像Id
- **ImageType** (str) - 镜像类型。标准镜像:Base,镜像市场:Business, 自定义镜像:Custom,默认返回所有类型
- **Limit** (int) - 返回数据长度,默认为20
Expand All @@ -459,14 +460,15 @@ def describe_image(
**UHostImageSet**
- **CreateTime** (int) - 创建时间,格式为Unix时间戳
- **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架构)
- **FuncType** (str) - 行业镜像类型(仅行业镜像将返回这个值)
- **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像
- **ImageDescription** (str) - 镜像描述
- **ImageId** (str) - 镜像ID
- **ImageName** (str) - 镜像名称
- **ImageSize** (int) - 镜像大小
- **ImageType** (str) - 镜像类型 标准镜像:Base, 行业镜像:Business,自定义镜像:Custom
- **IntegratedSoftware** (str) - 集成软件名称(仅行业镜像将返回这个值)
- **Links** (str) - 介绍链接(仅行业镜像将返回这个值)
- **MaintainEol** (str) - 系统EOL的时间,格式:YYYY/MM/DD
- **MinimalCPU** (str) - 默认值为空'''。当CentOS 7.3/7.4/7.5等镜像会标记为“Broadwell”
- **OsName** (str) - 操作系统名称
- **OsType** (str) - 操作系统类型:Linux,Windows
Expand Down Expand Up @@ -1004,7 +1006,7 @@ def get_uhost_upgrade_price(
- **CPU** (int) - 虚拟CPU核数。可选参数:1-64(可选范围参考控制台)。默认值为当前实例的CPU核数。
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
- **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值为当前实例的内存大小。
- **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)
- **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)。仅支持网络增强1.0和网络增强2.0的开启和关闭,不支持网络增强特性互相转换,如网络增强1.0升级到网络增强2.0是不被支持的。
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_

**Response**
Expand Down
1 change: 1 addition & 0 deletions ucloud/services/uhost/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ class DescribeImageRequestSchema(schema.RequestSchema):
"""DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。"""

fields = {
"FuncType": fields.Str(required=False, dump_to="FuncType"),
"ImageId": fields.Str(required=False, dump_to="ImageId"),
"ImageType": fields.Str(required=False, dump_to="ImageType"),
"Limit": fields.Int(required=False, dump_to="Limit"),
Expand Down
79 changes: 40 additions & 39 deletions ucloud/services/uhost/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ class FeatureModesSchema(schema.ResponseSchema):
}


class DisksSchema(schema.ResponseSchema):
"""Disks - 磁盘信息"""

fields = {
"BootDisk": fields.List(BootDiskInfoSchema()),
"DataDisk": fields.List(DataDiskInfoSchema()),
"Name": fields.Str(required=False, load_from="Name"),
}


class MachineSizesSchema(schema.ResponseSchema):
"""MachineSizes - GPU、CPU和内存信息"""

fields = {
"Collection": fields.List(CollectionSchema()),
"Gpu": fields.Int(required=False, load_from="Gpu"),
}


class GraphicsMemorySchema(schema.ResponseSchema):
"""GraphicsMemory - GPU的显存指标"""

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


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

fields = {
"BootDisk": fields.List(BootDiskInfoSchema()),
"DataDisk": fields.List(DataDiskInfoSchema()),
"Modes": fields.List(FeatureModesSchema()),
"Name": fields.Str(required=False, load_from="Name"),
}

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


class MachineSizesSchema(schema.ResponseSchema):
"""MachineSizes - GPU、CPU和内存信息"""

fields = {
"Collection": fields.List(CollectionSchema()),
"Gpu": fields.Int(required=False, load_from="Gpu"),
}


class FeaturesSchema(schema.ResponseSchema):
"""Features - 虚机可支持的特性"""

fields = {
"Modes": fields.List(FeatureModesSchema()),
"Name": fields.Str(required=False, load_from="Name"),
}


class AvailableInstanceTypesSchema(schema.ResponseSchema):
"""AvailableInstanceTypes - https://ushare.ucloudadmin.com/pages/viewpage.action?pageId=104662646"""

Expand Down Expand Up @@ -153,6 +153,7 @@ class UHostImageSetSchema(schema.ResponseSchema):
required=False, load_from="IntegratedSoftware"
),
"Links": fields.Str(required=False, load_from="Links"),
"MaintainEol": fields.Str(required=False, load_from="MaintainEol"),
"MinimalCPU": fields.Str(required=False, load_from="MinimalCPU"),
"OsName": fields.Str(required=False, load_from="OsName"),
"OsType": fields.Str(required=False, load_from="OsType"),
Expand Down Expand Up @@ -187,21 +188,22 @@ class IsolationGroupSchema(schema.ResponseSchema):
}


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

fields = {
"HostBinding": fields.Bool(required=False, load_from="HostBinding"),
"UDHostId": fields.Str(required=False, load_from="UDHostId"),
"UDSetId": fields.Str(required=False, load_from="UDSetId"),
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
}


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

fields = {
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
"HostBinding": fields.Bool(required=False, load_from="HostBinding"),
"UDHostId": fields.Str(required=False, load_from="UDHostId"),
"UDSetId": fields.Str(required=False, load_from="UDSetId"),
}


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


class SpotAttributeSchema(schema.ResponseSchema):
"""SpotAttribute - 竞价实例属性"""

fields = {
"RecycleTime": fields.Int(required=False, load_from="RecycleTime"),
}


class UHostIPSetSchema(schema.ResponseSchema):
"""UHostIPSet - DescribeUHostInstance"""

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


class UHostKeyPairSchema(schema.ResponseSchema):
"""UHostKeyPair - 主机密钥信息"""

fields = {
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
}


class UHostInstanceSetSchema(schema.ResponseSchema):
"""UHostInstanceSet - DescribeUHostInstance"""

Expand Down
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.11.57"
version = "0.11.58"