@@ -31,6 +31,9 @@ def create_ul_host_instance(
31
31
- **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
32
32
- **Name** (str) - 轻量应用主机名称。默认:套餐ID。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定实例名称。
33
33
- **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。
34
37
35
38
**Response**
36
39
@@ -52,6 +55,121 @@ def create_ul_host_instance(
52
55
resp = self .invoke ("CreateULHostInstance" , d , ** kwargs )
53
56
return apis .CreateULHostInstanceResponseSchema ().loads (resp )
54
57
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
+
55
173
def describe_ul_host_bundles (
56
174
self , req : typing .Optional [dict ] = None , ** kwargs
57
175
) -> dict :
@@ -117,6 +235,7 @@ def describe_ul_host_instance(
117
235
- **ChargeType** (str) - 计费模式。枚举值:Month/Year
118
236
- **CreateTime** (int) - 创建时间。Unix时间戳
119
237
- **DiskSet** (list) - 见 **ULHostDiskSet** 模型定义
238
+ - **ExclusiveUTPInfo** (dict) - 见 **ExclusiveUTPInfo** 模型定义
120
239
- **ExpireTime** (int) - 过期时间。Unix时间戳
121
240
- **IPSet** (list) - 见 **UHostIPSet** 模型定义
122
241
- **ImageId** (str) - 镜像Id。
@@ -154,6 +273,16 @@ def describe_ul_host_instance(
154
273
- **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。
155
274
156
275
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
+
157
286
"""
158
287
# build request
159
288
d = {
@@ -335,7 +464,7 @@ def reinstall_ul_host_instance(
335
464
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
336
465
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
337
466
- **ImageId** (str) - (Required) 镜像Id。暂不支持使用自定义镜像重装
338
- - **Password** (str) - (Required) 登陆密码
467
+ - **Password** (str) - (Required) 登陆密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx
339
468
- **ULHostId** (str) - (Required) 实例Id
340
469
341
470
**Response**
@@ -383,6 +512,34 @@ def reset_ul_host_instance_password(
383
512
resp = self .invoke ("ResetULHostInstancePassword" , d , ** kwargs )
384
513
return apis .ResetULHostInstancePasswordResponseSchema ().loads (resp )
385
514
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
+
386
543
def start_ul_host_instance (
387
544
self , req : typing .Optional [dict ] = None , ** kwargs
388
545
) -> dict :
@@ -410,6 +567,34 @@ def start_ul_host_instance(
410
567
resp = self .invoke ("StartULHostInstance" , d , ** kwargs )
411
568
return apis .StartULHostInstanceResponseSchema ().loads (resp )
412
569
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
+
413
598
def stop_ul_host_instance (
414
599
self , req : typing .Optional [dict ] = None , ** kwargs
415
600
) -> dict :
0 commit comments