Skip to content

Commit

Permalink
sdk: rolling update for 0.11.62 (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucloud-bot authored Sep 23, 2024
1 parent 653ea79 commit 75de781
Show file tree
Hide file tree
Showing 12 changed files with 316 additions and 84 deletions.
18 changes: 9 additions & 9 deletions ucloud/services/udb/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
from ucloud.core.typesystem import schema, fields


class UFileDataSetSchema(schema.ResponseSchema):
"""UFileDataSet - 增加ufile的描述"""

fields = {
"Bucket": fields.Str(required=False, load_from="Bucket"),
"TokenID": fields.Str(required=False, load_from="TokenID"),
}


class UDBSlaveInstanceSetSchema(schema.ResponseSchema):
"""UDBSlaveInstanceSet - DescribeUDBSlaveInstance"""

Expand Down Expand Up @@ -69,15 +78,6 @@ class UDBSlaveInstanceSetSchema(schema.ResponseSchema):
}


class UFileDataSetSchema(schema.ResponseSchema):
"""UFileDataSet - 增加ufile的描述"""

fields = {
"Bucket": fields.Str(required=False, load_from="Bucket"),
"TokenID": fields.Str(required=False, load_from="TokenID"),
}


class MongoDBShardedClusterSetSchema(schema.ResponseSchema):
"""MongoDBShardedClusterSet -"""

Expand Down
6 changes: 5 additions & 1 deletion ucloud/services/uhost/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,11 @@ def reset_uhost_instance_password(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **Password** (str) - (Required) UHost新密码(密码格式使用BASE64编码)
- **UHostId** (str) - (Required) UHost实例ID
- **AutoStart** (bool) - 修改密码结束后是否立即开机,默认为false, 如果设置为true,则修改密码成功后立即开机; 抢占式和后付费云主机暂不支持当前功能;
- **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
- **LoginMode** (str) - 主机登陆模式。密码(默认选项): Password,密钥 KeyPair。
- **Password** (str) - UHost新密码(密码格式使用BASE64编码)
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
**Response**
Expand Down Expand Up @@ -1410,6 +1413,7 @@ def resize_uhost_instance(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
- **AutoStart** (bool) - 扩容结束后是否立即开机,默认为false,如果设置为true,则扩容成功后立即开机;抢占式和后付费云主机暂不支持当前功能;
- **CPU** (int) - 虚拟CPU核数。可选参数:1-240(可选范围与UHostType相关)。默认值为当前实例的CPU核数
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
- **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 1966080],取值为1024的倍数(可选范围与UHostType相关)。默认值为当前实例的内存大小。
Expand Down
6 changes: 5 additions & 1 deletion ucloud/services/uhost/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,10 @@ class ResetUHostInstancePasswordRequestSchema(schema.RequestSchema):
"""ResetUHostInstancePassword - 重置UHost实例的管理员密码。"""

fields = {
"Password": fields.Base64(required=True, dump_to="Password"),
"AutoStart": fields.Bool(required=False, dump_to="AutoStart"),
"KeyPairId": fields.Str(required=False, dump_to="KeyPairId"),
"LoginMode": fields.Str(required=False, dump_to="LoginMode"),
"Password": fields.Base64(required=False, dump_to="Password"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"UHostId": fields.Str(required=True, dump_to="UHostId"),
Expand Down Expand Up @@ -1279,6 +1282,7 @@ class ResizeUHostInstanceRequestSchema(schema.RequestSchema):
"""ResizeUHostInstance - 修改指定UHost实例的资源配置,如CPU核心数,内存容量大小,网络增强等。可选配置范围请参考[[api:uhost-api:uhost_type|云主机机型说明]]。"""

fields = {
"AutoStart": fields.Bool(required=False, dump_to="AutoStart"),
"BootDiskSpace": fields.Int(
required=False, dump_to="BootDiskSpace"
), # Deprecated, will be removed at 1.0
Expand Down
76 changes: 38 additions & 38 deletions ucloud/services/uhost/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ class KeyPairSchema(schema.ResponseSchema):
}


class DataDiskInfoSchema(schema.ResponseSchema):
"""DataDiskInfo - 数据盘信息"""

fields = {
"Features": fields.List(fields.Str()),
"MaximalSize": fields.Int(required=False, load_from="MaximalSize"),
"MinimalSize": fields.Int(required=False, load_from="MinimalSize"),
"Name": fields.Str(required=False, load_from="Name"),
}


class BootDiskInfoSchema(schema.ResponseSchema):
"""BootDiskInfo - 系统盘信息"""

fields = {
"Features": fields.List(fields.Str()),
"InstantResize": fields.Bool(required=False, load_from="InstantResize"),
"MaximalSize": fields.Int(required=False, load_from="MaximalSize"),
"Name": fields.Str(required=False, load_from="Name"),
}


class CollectionSchema(schema.ResponseSchema):
"""Collection - CPU和内存可支持的规格"""

Expand All @@ -62,21 +40,24 @@ class FeatureModesSchema(schema.ResponseSchema):
}


class PerformanceSchema(schema.ResponseSchema):
"""Performance - GPU的性能指标"""
class DataDiskInfoSchema(schema.ResponseSchema):
"""DataDiskInfo - 数据盘信息"""

fields = {
"Rate": fields.Int(required=False, load_from="Rate"),
"Value": fields.Float(required=False, load_from="Value"),
"Features": fields.List(fields.Str()),
"MaximalSize": fields.Int(required=False, load_from="MaximalSize"),
"MinimalSize": fields.Int(required=False, load_from="MinimalSize"),
"Name": fields.Str(required=False, load_from="Name"),
}


class DisksSchema(schema.ResponseSchema):
"""Disks - 磁盘信息"""
class BootDiskInfoSchema(schema.ResponseSchema):
"""BootDiskInfo - 系统盘信息"""

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

Expand Down Expand Up @@ -108,6 +89,16 @@ class FeaturesSchema(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 CpuPlatformsSchema(schema.ResponseSchema):
"""CpuPlatforms - CPU平台信息"""

Expand All @@ -118,6 +109,15 @@ class CpuPlatformsSchema(schema.ResponseSchema):
}


class PerformanceSchema(schema.ResponseSchema):
"""Performance - GPU的性能指标"""

fields = {
"Rate": fields.Int(required=False, load_from="Rate"),
"Value": fields.Float(required=False, load_from="Value"),
}


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

Expand Down Expand Up @@ -205,14 +205,6 @@ class UHostDiskSetSchema(schema.ResponseSchema):
}


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

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


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

Expand All @@ -232,6 +224,14 @@ class UDSetUDHostAttributeSchema(schema.ResponseSchema):
}


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

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


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

Expand Down
39 changes: 39 additions & 0 deletions ucloud/services/umem/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,7 @@ def describe_umem_upgrade_price(
- **IsSplit** (str) - 如果是拆分按钮查询价格就填 true, 否则就填 false,默认为 false
- **NewCPU** (int) - 代理升级后CPU核数
- **ProxyId** (str) - 代理id
- **ReplicaSize** (int) - 新增读写分离节点容量大小
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
**Response**
Expand Down Expand Up @@ -1487,6 +1488,44 @@ def modify_uredis_group_password(
resp = self.invoke("ModifyURedisGroupPassword", d, **kwargs)
return apis.ModifyURedisGroupPasswordResponseSchema().loads(resp)

def register_umem_defrag(
self, req: typing.Optional[dict] = None, **kwargs
) -> dict:
"""RegisterUMemDefrag - 动态开关redis碎片整理选项
**Request**
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **ResourceId** (str) - (Required) 资源ID
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **EndHour** (int) - 结束整点数值(分布式实例该参数无效)。
- **EndMin** (int) - 结束分钟数(分布式实例该参数无效)。
- **EndTime** (int) - 关闭时间戳
- **FragSize** (int) - 碎片整理阈值,范围为 100-200(分布式实例该参数无效)。
- **FragTime** (int) - 任务时间周期,单位为分钟。
- **IsUnion** (bool) - AND逻辑字段,表示 阈值和时间段都满足(分布式实例该参数无效)。
- **OperateType** (str) - 操作类型:“Once”: 表示单次执行, “Open”:表示开启策略“Close”: 表示关闭策略(分布式实例只支持Once)。
- **StartHour** (int) - 开始整点数值(分布式实例该参数无效)。
- **StartMin** (int) - 开始分钟数(分布式实例该参数无效)。
- **StartTime** (int) - 开始时间戳
**Response**
"""
# build request
d = {
"Region": self.config.region,
}
req and d.update(req)
d = apis.RegisterUMemDefragRequestSchema().dumps(d)

# build options
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent

resp = self.invoke("RegisterUMemDefrag", d, **kwargs)
return apis.RegisterUMemDefragResponseSchema().loads(resp)

def remove_ud_redis_data(
self, req: typing.Optional[dict] = None, **kwargs
) -> dict:
Expand Down
34 changes: 34 additions & 0 deletions ucloud/services/umem/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ class DescribeUMemUpgradePriceRequestSchema(schema.RequestSchema):
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"ProxyId": fields.Str(required=False, dump_to="ProxyId"),
"Region": fields.Str(required=True, dump_to="Region"),
"ReplicaSize": fields.Int(required=False, dump_to="ReplicaSize"),
"Size": fields.Int(required=True, dump_to="Size"),
"SpaceId": fields.Str(required=True, dump_to="SpaceId"),
"Type": fields.Str(required=True, dump_to="Type"),
Expand Down Expand Up @@ -1176,6 +1177,39 @@ class ModifyURedisGroupPasswordResponseSchema(schema.ResponseSchema):
fields = {}


"""
API: RegisterUMemDefrag
动态开关redis碎片整理选项
"""


class RegisterUMemDefragRequestSchema(schema.RequestSchema):
"""RegisterUMemDefrag - 动态开关redis碎片整理选项"""

fields = {
"EndHour": fields.Int(required=False, dump_to="EndHour"),
"EndMin": fields.Int(required=False, dump_to="EndMin"),
"EndTime": fields.Int(required=False, dump_to="EndTime"),
"FragSize": fields.Int(required=False, dump_to="FragSize"),
"FragTime": fields.Int(required=False, dump_to="FragTime"),
"IsUnion": fields.Bool(required=False, dump_to="IsUnion"),
"OperateType": fields.Str(required=False, dump_to="OperateType"),
"Region": fields.Str(required=True, dump_to="Region"),
"ResourceId": fields.Str(required=True, dump_to="ResourceId"),
"StartHour": fields.Int(required=False, dump_to="StartHour"),
"StartMin": fields.Int(required=False, dump_to="StartMin"),
"StartTime": fields.Int(required=False, dump_to="StartTime"),
"Zone": fields.Str(required=True, dump_to="Zone"),
}


class RegisterUMemDefragResponseSchema(schema.ResponseSchema):
"""RegisterUMemDefrag - 动态开关redis碎片整理选项"""

fields = {}


"""
API: RemoveUDRedisData
Expand Down
18 changes: 9 additions & 9 deletions ucloud/services/umem/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ class UDRedisSlowlogSetSchema(schema.ResponseSchema):
}


class UMemSpaceAddressSetSchema(schema.ResponseSchema):
"""UMemSpaceAddressSet - DescribeUMemSpace"""

fields = {
"IP": fields.Str(required=False, load_from="IP"),
"Port": fields.Int(required=False, load_from="Port"),
}


class UMemSlaveDataSetSchema(schema.ResponseSchema):
"""UMemSlaveDataSet - DescribeUMem"""

Expand Down Expand Up @@ -55,15 +64,6 @@ class UMemSlaveDataSetSchema(schema.ResponseSchema):
}


class UMemSpaceAddressSetSchema(schema.ResponseSchema):
"""UMemSpaceAddressSet - DescribeUMemSpace"""

fields = {
"IP": fields.Str(required=False, load_from="IP"),
"Port": fields.Int(required=False, load_from="Port"),
}


class UMemDataSetSchema(schema.ResponseSchema):
"""UMemDataSet - DescribeUMem"""

Expand Down
50 changes: 25 additions & 25 deletions ucloud/services/usms/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,6 @@ class ReceiptPerSessionSchema(schema.ResponseSchema):
}


class StatisticsDataSchema(schema.ResponseSchema):
"""StatisticsData - 统计信息"""

fields = {
"FailCostCount": fields.Int(required=True, load_from="FailCostCount"),
"FailCount": fields.Int(required=True, load_from="FailCount"),
"SendCostCount": fields.Int(required=True, load_from="SendCostCount"),
"SendCount": fields.Int(required=True, load_from="SendCount"),
"SubmitFailCostCount": fields.Int(
required=True, load_from="SubmitFailCostCount"
),
"SubmitFailCount": fields.Int(
required=True, load_from="SubmitFailCount"
),
"SuccessCostCount": fields.Int(
required=True, load_from="SuccessCostCount"
),
"SuccessCount": fields.Int(required=True, load_from="SuccessCount"),
"UnknownCostCount": fields.Int(
required=True, load_from="UnknownCostCount"
),
"UnknownCount": fields.Int(required=True, load_from="UnknownCount"),
}


class StatisticsDataInfoSchema(schema.ResponseSchema):
"""StatisticsDataInfo - 统计信息按天聚合"""

Expand Down Expand Up @@ -82,6 +57,31 @@ class StatisticsDataInfoSchema(schema.ResponseSchema):
}


class StatisticsDataSchema(schema.ResponseSchema):
"""StatisticsData - 统计信息"""

fields = {
"FailCostCount": fields.Int(required=True, load_from="FailCostCount"),
"FailCount": fields.Int(required=True, load_from="FailCount"),
"SendCostCount": fields.Int(required=True, load_from="SendCostCount"),
"SendCount": fields.Int(required=True, load_from="SendCount"),
"SubmitFailCostCount": fields.Int(
required=True, load_from="SubmitFailCostCount"
),
"SubmitFailCount": fields.Int(
required=True, load_from="SubmitFailCount"
),
"SuccessCostCount": fields.Int(
required=True, load_from="SuccessCostCount"
),
"SuccessCount": fields.Int(required=True, load_from="SuccessCount"),
"UnknownCostCount": fields.Int(
required=True, load_from="UnknownCostCount"
),
"UnknownCount": fields.Int(required=True, load_from="UnknownCount"),
}


class OutSignatureSchema(schema.ResponseSchema):
"""OutSignature - 短信签名"""

Expand Down
Loading

0 comments on commit 75de781

Please sign in to comment.