Skip to content

Commit e0e12f5

Browse files
authored
sdk: rolling update for 0.11.68 (#274)
1 parent 315030a commit e0e12f5

File tree

11 files changed

+545
-149
lines changed

11 files changed

+545
-149
lines changed

ucloud/services/pathx/schemas/models.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ class SrcAreaInfoSchema(schema.ResponseSchema):
135135
}
136136

137137

138+
class OutPublicIpInfoSchema(schema.ResponseSchema):
139+
"""OutPublicIpInfo - 线路回源IP信息"""
140+
141+
fields = {
142+
"Area": fields.Str(required=False, load_from="Area"),
143+
"IP": fields.Str(required=False, load_from="IP"),
144+
}
145+
146+
138147
class AccelerationAreaInfosSchema(schema.ResponseSchema):
139148
"""AccelerationAreaInfos -"""
140149

@@ -156,15 +165,6 @@ class ForwardTaskSchema(schema.ResponseSchema):
156165
}
157166

158167

159-
class OutPublicIpInfoSchema(schema.ResponseSchema):
160-
"""OutPublicIpInfo - 线路回源IP信息"""
161-
162-
fields = {
163-
"Area": fields.Str(required=False, load_from="Area"),
164-
"IP": fields.Str(required=False, load_from="IP"),
165-
}
166-
167-
168168
class ForwardInfoSchema(schema.ResponseSchema):
169169
"""ForwardInfo -"""
170170

@@ -231,15 +231,6 @@ class AccelerationInfoSchema(schema.ResponseSchema):
231231
}
232232

233233

234-
class UGAATaskSchema(schema.ResponseSchema):
235-
"""UGAATask - 用户在UGAA实例下配置的多端口任务"""
236-
237-
fields = {
238-
"Port": fields.Int(required=True, load_from="Port"),
239-
"Protocol": fields.Str(required=True, load_from="Protocol"),
240-
}
241-
242-
243234
class UPathSetSchema(schema.ResponseSchema):
244235
"""UPathSet - uga关联的upath信息"""
245236

@@ -277,6 +268,15 @@ class UGAL4ForwarderSchema(schema.ResponseSchema):
277268
}
278269

279270

271+
class UGAATaskSchema(schema.ResponseSchema):
272+
"""UGAATask - 用户在UGAA实例下配置的多端口任务"""
273+
274+
fields = {
275+
"Port": fields.Int(required=True, load_from="Port"),
276+
"Protocol": fields.Str(required=True, load_from="Protocol"),
277+
}
278+
279+
280280
class UGAAInfoSchema(schema.ResponseSchema):
281281
"""UGAAInfo - 全球加速实例信息"""
282282

@@ -342,16 +342,6 @@ class AlarmRulerSchema(schema.ResponseSchema):
342342
}
343343

344344

345-
class TrafficDailyRecentlySchema(schema.ResponseSchema):
346-
"""TrafficDailyRecently - 最近3个月日流量统计"""
347-
348-
fields = {
349-
"Day": fields.Str(required=False, load_from="Day"),
350-
"TrafficUnitGB": fields.Str(required=False, load_from="TrafficUnitGB"),
351-
"TrafficUnitMB": fields.Str(required=False, load_from="TrafficUnitMB"),
352-
}
353-
354-
355345
class TrafficDailySchema(schema.ResponseSchema):
356346
"""TrafficDaily -"""
357347

@@ -362,6 +352,16 @@ class TrafficDailySchema(schema.ResponseSchema):
362352
}
363353

364354

355+
class TrafficDailyRecentlySchema(schema.ResponseSchema):
356+
"""TrafficDailyRecently - 最近3个月日流量统计"""
357+
358+
fields = {
359+
"Day": fields.Str(required=False, load_from="Day"),
360+
"TrafficUnitGB": fields.Str(required=False, load_from="TrafficUnitGB"),
361+
"TrafficUnitMB": fields.Str(required=False, load_from="TrafficUnitMB"),
362+
}
363+
364+
365365
class MatricPointSchema(schema.ResponseSchema):
366366
"""MatricPoint -"""
367367

ucloud/services/ucdn/schemas/models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ class CacheAllConfigSchema(schema.ResponseSchema):
339339
}
340340

341341

342+
class AccessControlConfSchema(schema.ResponseSchema):
343+
"""AccessControlConf - 访问控制配置参数"""
344+
345+
fields = {
346+
"IpBlackList": fields.List(fields.Str()),
347+
"ReferConf": ReferConfSchema(),
348+
}
349+
350+
342351
class AdvancedConfSchema(schema.ResponseSchema):
343352
"""AdvancedConf - 域名高级配置"""
344353

@@ -382,15 +391,6 @@ class OriginConfSchema(schema.ResponseSchema):
382391
}
383392

384393

385-
class AccessControlConfSchema(schema.ResponseSchema):
386-
"""AccessControlConf - 访问控制配置参数"""
387-
388-
fields = {
389-
"IpBlackList": fields.List(fields.Str()),
390-
"ReferConf": ReferConfSchema(),
391-
}
392-
393-
394394
class DomainConfigInfoSchema(schema.ResponseSchema):
395395
"""DomainConfigInfo - 更新域名配置"""
396396

ucloud/services/ucompshare/client.py

Lines changed: 186 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def create_ul_host_instance(
3131
- **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
3232
- **Name** (str) - 轻量应用主机名称。默认:套餐ID。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定实例名称。
3333
- **Quantity** (int) - 购买时长。默认:1。不支持购买到月末
34+
- **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall <https://docs.ucloud.cn/api/ucompshare-api/api/unet-api/describe_firewall.html>`_ 。
35+
- **SubnetId** (str) - 子网 ID。默认为当前地域的默认子网。
36+
- **VPCId** (str) - VPC ID。默认为当前地域的默认VPC。
3437
3538
**Response**
3639
@@ -52,6 +55,121 @@ def create_ul_host_instance(
5255
resp = self.invoke("CreateULHostInstance", d, **kwargs)
5356
return apis.CreateULHostInstanceResponseSchema().loads(resp)
5457

58+
def describe_comp_share_instance(
59+
self, req: typing.Optional[dict] = None, **kwargs
60+
) -> dict:
61+
"""DescribeCompShareInstance - 获取用户所有地域下主机资源信息列表
62+
63+
**Request**
64+
65+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
66+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
67+
- **Limit** (int) - 返回数据长度,默认为20,最大100
68+
- **Offset** (int) - 列表起始位置偏移量,默认为0
69+
- **UHostIds** (list) - 【数组】UHost主机的资源ID,例如UHostIds.0代表希望获取信息 的主机1,UHostIds.1代表主机2。 如果不传入,则返回当前Region 所有符合条件的UHost实例。
70+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
71+
72+
**Response**
73+
74+
- **TotalCount** (int) - UHostInstance总数
75+
- **UHostSet** (list) - 见 **CompShareInstanceSet** 模型定义
76+
77+
**Response Model**
78+
79+
**UHostIPSet**
80+
- **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息)
81+
- **Default** (str) - 内网 Private 类型下,表示是否为默认网卡。true: 是默认网卡;其他值:不是。
82+
- **IP** (str) - IP地址
83+
- **IPId** (str) - 外网IP资源ID 。(内网IP无对应的资源ID)
84+
- **IPMode** (str) - IPv4/IPv6;
85+
- **Mac** (str) - 内网 Private 类型下,当前网卡的Mac。
86+
- **NetworkInterfaceId** (str) - 弹性网卡为默认网卡时,返回对应的 ID 值
87+
- **SubnetId** (str) - IP地址对应的子网 ID。(北京一不支持,字段返回为空)
88+
- **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private
89+
- **VPCId** (str) - IP地址对应的VPC ID。(北京一不支持,字段返回为空)
90+
- **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。
91+
92+
93+
**UHostDiskSet**
94+
- **BackupType** (str) - 备份方案。若开通了数据方舟,则为DATAARK
95+
- **DiskId** (str) - 磁盘ID
96+
- **DiskType** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
97+
- **Drive** (str) - 磁盘盘符
98+
- **Encrypted** (str) - "true": 加密盘 "false":非加密盘
99+
- **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
100+
- **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回)
101+
- **Size** (int) - 磁盘大小,单位: GB
102+
- **Type** (str) - 【建议不再使用】磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
103+
104+
105+
**GraphicsMemory**
106+
- **Rate** (int) - 交互展示参数,可忽略
107+
- **Value** (int) - 值,单位是GB
108+
109+
110+
**SoftwareAddr**
111+
- **Name** (str) - 软件名称
112+
- **URL** (str) - 软件地址
113+
114+
115+
**CompShareInstanceSet**
116+
- **AutoRenew** (str) - 是否自动续费,自动续费:“Yes”,不自动续费:“No”
117+
- **CPU** (int) - 虚拟CPU核数,单位: 个
118+
- **ChargeType** (str) - 计费模式,枚举值为: Year,按年付费; Month,按月付费; Dynamic,按时付费;Postpay,按需付费
119+
- **CompShareImageBillId** (str) - 用于镜像计费的Id
120+
- **CompShareImageId** (str) - 镜像Id
121+
- **CompShareImageName** (str) - 镜像名称
122+
- **CompShareImageOwnerAlias** (str) - 镜像来源
123+
- **CompShareImagePrice** (float) - 镜像价格
124+
- **CompShareImageStatus** (str) - 镜像状态
125+
- **CompShareImageType** (str) - 镜像类型- System 系统镜像- App 应用镜像- Custom 自制镜像- Community 社区镜像
126+
- **CpuArch** (str) - CPU架构。"x86_64"/"i386"等
127+
- **CpuPlatform** (str) - CPU平台。如"Intel/Auto"、"Amd/Auto"等等
128+
- **CreateTime** (str) - 创建时间
129+
- **DiskSet** (list) - 见 **UHostDiskSet** 模型定义
130+
- **ExpireTime** (str) - 过期时间
131+
- **GPU** (int) - GPU个数
132+
- **GpuType** (str) - GPU类型。如: "4090"
133+
- **GraphicsMemory** (dict) - 见 **GraphicsMemory** 模型定义
134+
- **HostIp** (str) - 【内部API返回】宿主IP
135+
- **HugepageCfg** (str) - 【内部API返回】大页内存
136+
- **IPSet** (list) - 见 **UHostIPSet** 模型定义
137+
- **InstancePrice** (float) - 主机价格
138+
- **InstanceType** (str) - 实例类型。"UHost": 普通主机;"Container": 容器主机
139+
- **IsExpire** (str) - 是否过期。Yes:已过期;No:未过期
140+
- **MachineType** (str) - 机型信息
141+
- **Memory** (str) - 内存大小,单位:MB
142+
- **Name** (str) - 实例名称
143+
- **OsName** (str) - 虚机镜像的名称
144+
- **OsType** (str) - 虚机镜像操作系统类型。"Linux"\"Windows"
145+
- **Password** (str) - 主机密码。由Base64编码
146+
- **PodId** (str) - 【内部API返回】udisk podId
147+
- **PostPayShutdown** (bool) - 【内部API返回】后付费关机
148+
- **QemuFullVersion** (str) - 【内部API返回】Qemu完整版本号
149+
- **QemuVersion** (str) - 【内部API返回】Qemu版本号
150+
- **Remark** (str) - 实例备注
151+
- **SetId** (int) - 【内部API返回】宿主所在Set Id
152+
- **Softwares** (list) - 见 **SoftwareAddr** 模型定义
153+
- **State** (str) - 实例状态,枚举值:\\ >初始化: Initializing; \\ >启动中: Starting; \\> 运行中: Running; \\> 关机中: Stopping; \\ >关机: Stopped \\ >安装失败: Install Fail; \\ >重启中: Rebooting; \\ >升级改配中: Resizing; \\ > 未知(空字符串,获取状态超时或出错):
154+
- **Tag** (str) - 实例业务组
155+
- **TotalDiskSpace** (int) - 总的数据盘存储空间
156+
- **UHostId** (str) - 实例Id
157+
- **UUID** (str) - 【内部API返回】资源长Id
158+
- **Zone** (str) - 可用区
159+
160+
161+
"""
162+
# build request
163+
d = {
164+
"ProjectId": self.config.project_id,
165+
"Region": self.config.region,
166+
}
167+
req and d.update(req)
168+
d = apis.DescribeCompShareInstanceRequestSchema().dumps(d)
169+
170+
resp = self.invoke("DescribeCompShareInstance", d, **kwargs)
171+
return apis.DescribeCompShareInstanceResponseSchema().loads(resp)
172+
55173
def describe_ul_host_bundles(
56174
self, req: typing.Optional[dict] = None, **kwargs
57175
) -> dict:
@@ -117,6 +235,7 @@ def describe_ul_host_instance(
117235
- **ChargeType** (str) - 计费模式。枚举值:Month/Year
118236
- **CreateTime** (int) - 创建时间。Unix时间戳
119237
- **DiskSet** (list) - 见 **ULHostDiskSet** 模型定义
238+
- **ExclusiveUTPInfo** (dict) - 见 **ExclusiveUTPInfo** 模型定义
120239
- **ExpireTime** (int) - 过期时间。Unix时间戳
121240
- **IPSet** (list) - 见 **UHostIPSet** 模型定义
122241
- **ImageId** (str) - 镜像Id。
@@ -154,6 +273,16 @@ def describe_ul_host_instance(
154273
- **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。
155274
156275
276+
**ExclusiveUTPInfo**
277+
- **AvailableSize** (int) - 当前周期剩余流量
278+
- **CreateTime** (int) - 创建时间
279+
- **ExcessSize** (int) - 当前周期超出限额的流量
280+
- **LastResetTime** (int) - 上次重置时间
281+
- **NextResetTime** (int) - 下次重置时间
282+
- **TotalSize** (int) - 当前周期总流量
283+
- **UsedSize** (int) - 当前周期已使用流量
284+
285+
157286
"""
158287
# build request
159288
d = {
@@ -335,7 +464,7 @@ def reinstall_ul_host_instance(
335464
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
336465
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
337466
- **ImageId** (str) - (Required) 镜像Id。暂不支持使用自定义镜像重装
338-
- **Password** (str) - (Required) 登陆密码
467+
- **Password** (str) - (Required) 登陆密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx
339468
- **ULHostId** (str) - (Required) 实例Id
340469
341470
**Response**
@@ -383,6 +512,34 @@ def reset_ul_host_instance_password(
383512
resp = self.invoke("ResetULHostInstancePassword", d, **kwargs)
384513
return apis.ResetULHostInstancePasswordResponseSchema().loads(resp)
385514

515+
def start_comp_share_instance(
516+
self, req: typing.Optional[dict] = None, **kwargs
517+
) -> dict:
518+
"""StartCompShareInstance - 启动算力平台实例
519+
520+
**Request**
521+
522+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
523+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
524+
- **UHostId** (str) - (Required) 实例Id
525+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
526+
527+
**Response**
528+
529+
- **UHostId** (str) - 实例Id
530+
531+
"""
532+
# build request
533+
d = {
534+
"ProjectId": self.config.project_id,
535+
"Region": self.config.region,
536+
}
537+
req and d.update(req)
538+
d = apis.StartCompShareInstanceRequestSchema().dumps(d)
539+
540+
resp = self.invoke("StartCompShareInstance", d, **kwargs)
541+
return apis.StartCompShareInstanceResponseSchema().loads(resp)
542+
386543
def start_ul_host_instance(
387544
self, req: typing.Optional[dict] = None, **kwargs
388545
) -> dict:
@@ -410,6 +567,34 @@ def start_ul_host_instance(
410567
resp = self.invoke("StartULHostInstance", d, **kwargs)
411568
return apis.StartULHostInstanceResponseSchema().loads(resp)
412569

570+
def stop_comp_share_instance(
571+
self, req: typing.Optional[dict] = None, **kwargs
572+
) -> dict:
573+
"""StopCompShareInstance - 关闭算力平台实例
574+
575+
**Request**
576+
577+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
578+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
579+
- **UHostId** (str) - (Required) 实例Id
580+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
581+
582+
**Response**
583+
584+
- **UHostId** (str) - 实例Id
585+
586+
"""
587+
# build request
588+
d = {
589+
"ProjectId": self.config.project_id,
590+
"Region": self.config.region,
591+
}
592+
req and d.update(req)
593+
d = apis.StopCompShareInstanceRequestSchema().dumps(d)
594+
595+
resp = self.invoke("StopCompShareInstance", d, **kwargs)
596+
return apis.StopCompShareInstanceResponseSchema().loads(resp)
597+
413598
def stop_ul_host_instance(
414599
self, req: typing.Optional[dict] = None, **kwargs
415600
) -> dict:

0 commit comments

Comments
 (0)