ucloud-sdk-python3 0.11.81__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. ucloud/__init__.py +0 -0
  2. ucloud/client.py +469 -0
  3. ucloud/core/__init__.py +0 -0
  4. ucloud/core/auth/__init__.py +3 -0
  5. ucloud/core/auth/_cfg.py +72 -0
  6. ucloud/core/client/__init__.py +8 -0
  7. ucloud/core/client/_cfg.py +96 -0
  8. ucloud/core/client/_client.py +176 -0
  9. ucloud/core/exc/__init__.py +9 -0
  10. ucloud/core/exc/_exc.py +94 -0
  11. ucloud/core/transport/__init__.py +4 -0
  12. ucloud/core/transport/_requests.py +135 -0
  13. ucloud/core/transport/http.py +120 -0
  14. ucloud/core/transport/utils.py +40 -0
  15. ucloud/core/typesystem/__init__.py +0 -0
  16. ucloud/core/typesystem/abstract.py +60 -0
  17. ucloud/core/typesystem/encoder.py +33 -0
  18. ucloud/core/typesystem/fields.py +149 -0
  19. ucloud/core/typesystem/schema.py +97 -0
  20. ucloud/core/utils/__init__.py +0 -0
  21. ucloud/core/utils/compat.py +15 -0
  22. ucloud/core/utils/deco.py +31 -0
  23. ucloud/core/utils/log.py +29 -0
  24. ucloud/core/utils/middleware.py +63 -0
  25. ucloud/helpers/__init__.py +0 -0
  26. ucloud/helpers/utils.py +90 -0
  27. ucloud/helpers/wait.py +108 -0
  28. ucloud/services/__init__.py +0 -0
  29. ucloud/services/cube/__init__.py +0 -0
  30. ucloud/services/cube/client.py +618 -0
  31. ucloud/services/cube/schemas/__init__.py +0 -0
  32. ucloud/services/cube/schemas/apis.py +548 -0
  33. ucloud/services/cube/schemas/models.py +58 -0
  34. ucloud/services/iam/__init__.py +0 -0
  35. ucloud/services/iam/client.py +1078 -0
  36. ucloud/services/iam/schemas/__init__.py +0 -0
  37. ucloud/services/iam/schemas/apis.py +973 -0
  38. ucloud/services/iam/schemas/models.py +127 -0
  39. ucloud/services/ipsecvpn/__init__.py +0 -0
  40. ucloud/services/ipsecvpn/client.py +522 -0
  41. ucloud/services/ipsecvpn/schemas/__init__.py +0 -0
  42. ucloud/services/ipsecvpn/schemas/apis.py +455 -0
  43. ucloud/services/ipsecvpn/schemas/models.py +134 -0
  44. ucloud/services/ipv6gw/__init__.py +0 -0
  45. ucloud/services/ipv6gw/client.py +44 -0
  46. ucloud/services/ipv6gw/schemas/__init__.py +0 -0
  47. ucloud/services/ipv6gw/schemas/apis.py +34 -0
  48. ucloud/services/ipv6gw/schemas/models.py +3 -0
  49. ucloud/services/isms/__init__.py +0 -0
  50. ucloud/services/isms/client.py +330 -0
  51. ucloud/services/isms/schemas/__init__.py +0 -0
  52. ucloud/services/isms/schemas/apis.py +272 -0
  53. ucloud/services/isms/schemas/models.py +50 -0
  54. ucloud/services/pathx/__init__.py +0 -0
  55. ucloud/services/pathx/client.py +1656 -0
  56. ucloud/services/pathx/schemas/__init__.py +0 -0
  57. ucloud/services/pathx/schemas/apis.py +1289 -0
  58. ucloud/services/pathx/schemas/models.py +420 -0
  59. ucloud/services/stepflow/__init__.py +0 -0
  60. ucloud/services/stepflow/client.py +98 -0
  61. ucloud/services/stepflow/schemas/__init__.py +0 -0
  62. ucloud/services/stepflow/schemas/apis.py +67 -0
  63. ucloud/services/stepflow/schemas/models.py +37 -0
  64. ucloud/services/sts/__init__.py +0 -0
  65. ucloud/services/sts/client.py +46 -0
  66. ucloud/services/sts/schemas/__init__.py +0 -0
  67. ucloud/services/sts/schemas/apis.py +35 -0
  68. ucloud/services/sts/schemas/models.py +16 -0
  69. ucloud/services/tidb/__init__.py +0 -0
  70. ucloud/services/tidb/client.py +120 -0
  71. ucloud/services/tidb/schemas/__init__.py +0 -0
  72. ucloud/services/tidb/schemas/apis.py +103 -0
  73. ucloud/services/tidb/schemas/models.py +11 -0
  74. ucloud/services/uaaa/__init__.py +0 -0
  75. ucloud/services/uaaa/client.py +311 -0
  76. ucloud/services/uaaa/schemas/__init__.py +0 -0
  77. ucloud/services/uaaa/schemas/apis.py +252 -0
  78. ucloud/services/uaaa/schemas/models.py +47 -0
  79. ucloud/services/uaccount/__init__.py +0 -0
  80. ucloud/services/uaccount/client.py +547 -0
  81. ucloud/services/uaccount/schemas/__init__.py +0 -0
  82. ucloud/services/uaccount/schemas/apis.py +442 -0
  83. ucloud/services/uaccount/schemas/models.py +128 -0
  84. ucloud/services/uads/__init__.py +0 -0
  85. ucloud/services/uads/client.py +1148 -0
  86. ucloud/services/uads/schemas/__init__.py +0 -0
  87. ucloud/services/uads/schemas/apis.py +983 -0
  88. ucloud/services/uads/schemas/models.py +199 -0
  89. ucloud/services/ubill/__init__.py +0 -0
  90. ucloud/services/ubill/client.py +248 -0
  91. ucloud/services/ubill/schemas/__init__.py +0 -0
  92. ucloud/services/ubill/schemas/apis.py +183 -0
  93. ucloud/services/ubill/schemas/models.py +107 -0
  94. ucloud/services/ucdn/__init__.py +0 -0
  95. ucloud/services/ucdn/client.py +1964 -0
  96. ucloud/services/ucdn/schemas/__init__.py +0 -0
  97. ucloud/services/ucdn/schemas/apis.py +1395 -0
  98. ucloud/services/ucdn/schemas/models.py +576 -0
  99. ucloud/services/ucloudstack/__init__.py +0 -0
  100. ucloud/services/ucloudstack/client.py +3352 -0
  101. ucloud/services/ucloudstack/schemas/__init__.py +0 -0
  102. ucloud/services/ucloudstack/schemas/apis.py +2887 -0
  103. ucloud/services/ucloudstack/schemas/models.py +560 -0
  104. ucloud/services/ucompshare/__init__.py +0 -0
  105. ucloud/services/ucompshare/client.py +820 -0
  106. ucloud/services/ucompshare/schemas/__init__.py +0 -0
  107. ucloud/services/ucompshare/schemas/apis.py +623 -0
  108. ucloud/services/ucompshare/schemas/models.py +241 -0
  109. ucloud/services/udb/__init__.py +0 -0
  110. ucloud/services/udb/client.py +2463 -0
  111. ucloud/services/udb/schemas/__init__.py +0 -0
  112. ucloud/services/udb/schemas/apis.py +2053 -0
  113. ucloud/services/udb/schemas/models.py +319 -0
  114. ucloud/services/udbproxy/__init__.py +0 -0
  115. ucloud/services/udbproxy/client.py +67 -0
  116. ucloud/services/udbproxy/schemas/__init__.py +0 -0
  117. ucloud/services/udbproxy/schemas/apis.py +38 -0
  118. ucloud/services/udbproxy/schemas/models.py +31 -0
  119. ucloud/services/uddb/__init__.py +0 -0
  120. ucloud/services/uddb/client.py +456 -0
  121. ucloud/services/uddb/schemas/__init__.py +0 -0
  122. ucloud/services/uddb/schemas/apis.py +520 -0
  123. ucloud/services/uddb/schemas/models.py +96 -0
  124. ucloud/services/udi/__init__.py +0 -0
  125. ucloud/services/udi/client.py +250 -0
  126. ucloud/services/udi/schemas/__init__.py +0 -0
  127. ucloud/services/udi/schemas/apis.py +205 -0
  128. ucloud/services/udi/schemas/models.py +58 -0
  129. ucloud/services/udisk/__init__.py +0 -0
  130. ucloud/services/udisk/client.py +832 -0
  131. ucloud/services/udisk/schemas/__init__.py +0 -0
  132. ucloud/services/udisk/schemas/apis.py +741 -0
  133. ucloud/services/udisk/schemas/models.py +100 -0
  134. ucloud/services/udns/__init__.py +0 -0
  135. ucloud/services/udns/client.py +380 -0
  136. ucloud/services/udns/schemas/__init__.py +0 -0
  137. ucloud/services/udns/schemas/apis.py +293 -0
  138. ucloud/services/udns/schemas/models.py +58 -0
  139. ucloud/services/udpn/__init__.py +0 -0
  140. ucloud/services/udpn/client.py +240 -0
  141. ucloud/services/udpn/schemas/__init__.py +0 -0
  142. ucloud/services/udpn/schemas/apis.py +203 -0
  143. ucloud/services/udpn/schemas/models.py +29 -0
  144. ucloud/services/udts/__init__.py +0 -0
  145. ucloud/services/udts/client.py +410 -0
  146. ucloud/services/udts/schemas/__init__.py +0 -0
  147. ucloud/services/udts/schemas/apis.py +403 -0
  148. ucloud/services/udts/schemas/models.py +93 -0
  149. ucloud/services/uec/__init__.py +0 -0
  150. ucloud/services/uec/client.py +1510 -0
  151. ucloud/services/uec/schemas/__init__.py +0 -0
  152. ucloud/services/uec/schemas/apis.py +1195 -0
  153. ucloud/services/uec/schemas/models.py +316 -0
  154. ucloud/services/ufile/__init__.py +0 -0
  155. ucloud/services/ufile/client.py +698 -0
  156. ucloud/services/ufile/schemas/__init__.py +0 -0
  157. ucloud/services/ufile/schemas/apis.py +542 -0
  158. ucloud/services/ufile/schemas/models.py +139 -0
  159. ucloud/services/ufs/__init__.py +0 -0
  160. ucloud/services/ufs/client.py +328 -0
  161. ucloud/services/ufs/schemas/__init__.py +0 -0
  162. ucloud/services/ufs/schemas/apis.py +265 -0
  163. ucloud/services/ufs/schemas/models.py +52 -0
  164. ucloud/services/ugn/__init__.py +0 -0
  165. ucloud/services/ugn/client.py +857 -0
  166. ucloud/services/ugn/schemas/__init__.py +0 -0
  167. ucloud/services/ugn/schemas/apis.py +678 -0
  168. ucloud/services/ugn/schemas/models.py +191 -0
  169. ucloud/services/uhost/__init__.py +0 -0
  170. ucloud/services/uhost/client.py +1647 -0
  171. ucloud/services/uhost/schemas/__init__.py +0 -0
  172. ucloud/services/uhost/schemas/apis.py +1483 -0
  173. ucloud/services/uhost/schemas/models.py +427 -0
  174. ucloud/services/uhub/__init__.py +0 -0
  175. ucloud/services/uhub/client.py +229 -0
  176. ucloud/services/uhub/schemas/__init__.py +0 -0
  177. ucloud/services/uhub/schemas/apis.py +194 -0
  178. ucloud/services/uhub/schemas/models.py +39 -0
  179. ucloud/services/uk8s/__init__.py +0 -0
  180. ucloud/services/uk8s/client.py +729 -0
  181. ucloud/services/uk8s/schemas/__init__.py +0 -0
  182. ucloud/services/uk8s/schemas/apis.py +639 -0
  183. ucloud/services/uk8s/schemas/models.py +179 -0
  184. ucloud/services/ulb/__init__.py +0 -0
  185. ucloud/services/ulb/client.py +2285 -0
  186. ucloud/services/ulb/schemas/__init__.py +0 -0
  187. ucloud/services/ulb/schemas/apis.py +1678 -0
  188. ucloud/services/ulb/schemas/models.py +591 -0
  189. ucloud/services/ulighthost/__init__.py +0 -0
  190. ucloud/services/ulighthost/client.py +576 -0
  191. ucloud/services/ulighthost/schemas/__init__.py +0 -0
  192. ucloud/services/ulighthost/schemas/apis.py +445 -0
  193. ucloud/services/ulighthost/schemas/models.py +133 -0
  194. ucloud/services/umem/__init__.py +0 -0
  195. ucloud/services/umem/client.py +1829 -0
  196. ucloud/services/umem/schemas/__init__.py +0 -0
  197. ucloud/services/umem/schemas/apis.py +1477 -0
  198. ucloud/services/umem/schemas/models.py +327 -0
  199. ucloud/services/umongodb/__init__.py +0 -0
  200. ucloud/services/umongodb/client.py +752 -0
  201. ucloud/services/umongodb/schemas/__init__.py +0 -0
  202. ucloud/services/umongodb/schemas/apis.py +567 -0
  203. ucloud/services/umongodb/schemas/models.py +220 -0
  204. ucloud/services/unet/__init__.py +0 -0
  205. ucloud/services/unet/client.py +1278 -0
  206. ucloud/services/unet/schemas/__init__.py +0 -0
  207. ucloud/services/unet/schemas/apis.py +1006 -0
  208. ucloud/services/unet/schemas/models.py +275 -0
  209. ucloud/services/unvs/__init__.py +0 -0
  210. ucloud/services/unvs/client.py +87 -0
  211. ucloud/services/unvs/schemas/__init__.py +0 -0
  212. ucloud/services/unvs/schemas/apis.py +66 -0
  213. ucloud/services/unvs/schemas/models.py +19 -0
  214. ucloud/services/upfs/__init__.py +0 -0
  215. ucloud/services/upfs/client.py +252 -0
  216. ucloud/services/upfs/schemas/__init__.py +0 -0
  217. ucloud/services/upfs/schemas/apis.py +204 -0
  218. ucloud/services/upfs/schemas/models.py +36 -0
  219. ucloud/services/upgsql/__init__.py +0 -0
  220. ucloud/services/upgsql/client.py +1007 -0
  221. ucloud/services/upgsql/schemas/__init__.py +0 -0
  222. ucloud/services/upgsql/schemas/apis.py +827 -0
  223. ucloud/services/upgsql/schemas/models.py +158 -0
  224. ucloud/services/uphone/__init__.py +0 -0
  225. ucloud/services/uphone/client.py +2122 -0
  226. ucloud/services/uphone/schemas/__init__.py +0 -0
  227. ucloud/services/uphone/schemas/apis.py +1799 -0
  228. ucloud/services/uphone/schemas/models.py +357 -0
  229. ucloud/services/uphost/__init__.py +0 -0
  230. ucloud/services/uphost/client.py +847 -0
  231. ucloud/services/uphost/schemas/__init__.py +0 -0
  232. ucloud/services/uphost/schemas/apis.py +689 -0
  233. ucloud/services/uphost/schemas/models.py +175 -0
  234. ucloud/services/urocketmq/__init__.py +0 -0
  235. ucloud/services/urocketmq/client.py +117 -0
  236. ucloud/services/urocketmq/schemas/__init__.py +0 -0
  237. ucloud/services/urocketmq/schemas/apis.py +92 -0
  238. ucloud/services/urocketmq/schemas/models.py +14 -0
  239. ucloud/services/uslk/__init__.py +0 -0
  240. ucloud/services/uslk/client.py +249 -0
  241. ucloud/services/uslk/schemas/__init__.py +0 -0
  242. ucloud/services/uslk/schemas/apis.py +191 -0
  243. ucloud/services/uslk/schemas/models.py +74 -0
  244. ucloud/services/usms/__init__.py +0 -0
  245. ucloud/services/usms/client.py +759 -0
  246. ucloud/services/usms/schemas/__init__.py +0 -0
  247. ucloud/services/usms/schemas/apis.py +653 -0
  248. ucloud/services/usms/schemas/models.py +215 -0
  249. ucloud/services/utsdb/__init__.py +0 -0
  250. ucloud/services/utsdb/client.py +604 -0
  251. ucloud/services/utsdb/schemas/__init__.py +0 -0
  252. ucloud/services/utsdb/schemas/apis.py +515 -0
  253. ucloud/services/utsdb/schemas/models.py +61 -0
  254. ucloud/services/uvms/__init__.py +0 -0
  255. ucloud/services/uvms/client.py +119 -0
  256. ucloud/services/uvms/schemas/__init__.py +0 -0
  257. ucloud/services/uvms/schemas/apis.py +88 -0
  258. ucloud/services/uvms/schemas/models.py +40 -0
  259. ucloud/services/vpc/__init__.py +0 -0
  260. ucloud/services/vpc/client.py +3233 -0
  261. ucloud/services/vpc/schemas/__init__.py +0 -0
  262. ucloud/services/vpc/schemas/apis.py +2529 -0
  263. ucloud/services/vpc/schemas/models.py +651 -0
  264. ucloud/testing/__init__.py +0 -0
  265. ucloud/testing/driver/__init__.py +5 -0
  266. ucloud/testing/driver/_scenario.py +93 -0
  267. ucloud/testing/driver/_specification.py +57 -0
  268. ucloud/testing/driver/_step.py +166 -0
  269. ucloud/testing/env.py +28 -0
  270. ucloud/testing/exc.py +18 -0
  271. ucloud/testing/funcs.py +68 -0
  272. ucloud/testing/mock.py +28 -0
  273. ucloud/testing/op.py +177 -0
  274. ucloud/testing/utest.py +195 -0
  275. ucloud/version.py +1 -0
  276. ucloud_sdk_python3-0.11.81.dist-info/LICENSE +202 -0
  277. ucloud_sdk_python3-0.11.81.dist-info/METADATA +71 -0
  278. ucloud_sdk_python3-0.11.81.dist-info/RECORD +280 -0
  279. ucloud_sdk_python3-0.11.81.dist-info/WHEEL +5 -0
  280. ucloud_sdk_python3-0.11.81.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1647 @@
1
+ """ Code is generated by ucloud-model, DO NOT EDIT IT. """
2
+
3
+ import typing
4
+
5
+
6
+ from ucloud.core.client import Client
7
+ from ucloud.services.uhost.schemas import apis
8
+
9
+
10
+ class UHostClient(Client):
11
+ def __init__(
12
+ self, config: dict, transport=None, middleware=None, logger=None
13
+ ):
14
+ super(UHostClient, self).__init__(config, transport, middleware, logger)
15
+
16
+ def add_uhost_to_isolation_group(
17
+ self, req: typing.Optional[dict] = None, **kwargs
18
+ ) -> dict:
19
+ """AddUHostToIsolationGroup -
20
+
21
+ **Request**
22
+
23
+ - **ProjectId** (str) - (Config)
24
+ - **Region** (str) - (Config)
25
+ - **GroupId** (str) - (Required)
26
+ - **UHostId** (str) - (Required)
27
+ - **Zone** (str) - (Required)
28
+
29
+ **Response**
30
+
31
+ - **UHostId** (str) -
32
+
33
+ """
34
+ # build request
35
+ d = {
36
+ "ProjectId": self.config.project_id,
37
+ "Region": self.config.region,
38
+ }
39
+ req and d.update(req)
40
+ d = apis.AddUHostToIsolationGroupRequestSchema().dumps(d)
41
+
42
+ # build options
43
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
44
+
45
+ resp = self.invoke("AddUHostToIsolationGroup", d, **kwargs)
46
+ return apis.AddUHostToIsolationGroupResponseSchema().loads(resp)
47
+
48
+ def copy_custom_image(
49
+ self, req: typing.Optional[dict] = None, **kwargs
50
+ ) -> dict:
51
+ """CopyCustomImage - 复制自制镜像
52
+
53
+ **Request**
54
+
55
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
56
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
57
+ - **SourceImageId** (str) - (Required) 源镜像Id, 参见 DescribeImage
58
+ - **TargetProjectId** (str) - (Required) 目标项目Id, 参见 GetProjectList
59
+ - **TargetImageDescription** (str) - 目标镜像描述
60
+ - **TargetImageName** (str) - 目标镜像名称
61
+ - **TargetImageTag** (str) - 目标镜像业务组
62
+ - **TargetRegion** (str) - 目标地域,不跨地域可不填
63
+ - **TargetRegionList** (list) - 目标地域的集合,批量复制时填写
64
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
65
+
66
+ **Response**
67
+
68
+ - **Infos** (list) - 见 **CopyImageTaskInfo** 模型定义
69
+ - **TargetImageId** (str) - 目标镜像Id,只有非批量复制的时候该字段才存在
70
+ - **TaskId** (str) - 目标镜像复制的任务Id,只有非批量复制的时候该字段才存在
71
+
72
+ **Response Model**
73
+
74
+ **CopyImageTaskInfo**
75
+ - **TargetImageId** (str) - 目标镜像Id
76
+ - **TargetRegion** (str) - 目标地域
77
+ - **TaskId** (str) - 目标镜像复制的任务Id
78
+
79
+
80
+ """
81
+ # build request
82
+ d = {
83
+ "ProjectId": self.config.project_id,
84
+ "Region": self.config.region,
85
+ }
86
+ req and d.update(req)
87
+ d = apis.CopyCustomImageRequestSchema().dumps(d)
88
+
89
+ # build options
90
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
91
+
92
+ resp = self.invoke("CopyCustomImage", d, **kwargs)
93
+ return apis.CopyCustomImageResponseSchema().loads(resp)
94
+
95
+ def create_custom_image(
96
+ self, req: typing.Optional[dict] = None, **kwargs
97
+ ) -> dict:
98
+ """CreateCustomImage - 从指定UHost实例,生成自定义镜像。
99
+
100
+ **Request**
101
+
102
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
103
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
104
+ - **ImageName** (str) - (Required) 镜像名称
105
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
106
+ - **DataUDiskIds** (list) - 【数组】关联的云盘数据盘id列表。注意: 云盘数据盘需要开启快照服务
107
+ - **ImageDescription** (str) - 镜像描述
108
+ - **Tag** (str) - 镜像业务组。默认:Default
109
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
110
+
111
+ **Response**
112
+
113
+ - **DataSnapshotIds** (list) - 云盘数据盘快照id列表
114
+ - **ImageId** (str) - 镜像Id
115
+
116
+ """
117
+ # build request
118
+ d = {
119
+ "ProjectId": self.config.project_id,
120
+ "Region": self.config.region,
121
+ }
122
+ req and d.update(req)
123
+ d = apis.CreateCustomImageRequestSchema().dumps(d)
124
+
125
+ # build options
126
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
127
+
128
+ resp = self.invoke("CreateCustomImage", d, **kwargs)
129
+ return apis.CreateCustomImageResponseSchema().loads(resp)
130
+
131
+ def create_isolation_group(
132
+ self, req: typing.Optional[dict] = None, **kwargs
133
+ ) -> dict:
134
+ """CreateIsolationGroup - 创建硬件隔离组,组内机器严格隔离在不同宿主机上。
135
+
136
+ **Request**
137
+
138
+ - **ProjectId** (str) - (Config) 项目id
139
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
140
+ - **GroupName** (str) - (Required) 硬件隔离组名称。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定隔离组名称。
141
+ - **Remark** (str) - 备注。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定隔离组备注。
142
+
143
+ **Response**
144
+
145
+ - **GroupId** (str) - 硬件隔离组id
146
+
147
+ """
148
+ # build request
149
+ d = {
150
+ "ProjectId": self.config.project_id,
151
+ "Region": self.config.region,
152
+ }
153
+ req and d.update(req)
154
+ d = apis.CreateIsolationGroupRequestSchema().dumps(d)
155
+
156
+ # build options
157
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
158
+
159
+ resp = self.invoke("CreateIsolationGroup", d, **kwargs)
160
+ return apis.CreateIsolationGroupResponseSchema().loads(resp)
161
+
162
+ def create_uhost_instance(
163
+ self, req: typing.Optional[dict] = None, **kwargs
164
+ ) -> dict:
165
+ """CreateUHostInstance - 创建UHost实例。
166
+
167
+ **Request**
168
+
169
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
170
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
171
+ - **ImageId** (str) - (Required) 镜像ID。 请通过 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_ 获取
172
+ - **LoginMode** (str) - (Required) 主机登陆模式。密码(默认选项): Password,密钥:KeyPair。
173
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
174
+ - **AlarmTemplateId** (int) - 告警模板id,如果传了告警模板id,且告警模板id正确,则绑定告警模板。绑定告警模板失败不会影响创建主机流程。
175
+ - **AutoDataDiskInit** (str) - 数据盘是否需要自动分区挂载。当镜像支持“Cloud-init”Feature时可填写此字段。取值 >“On” 自动挂载(默认值)> “Off” 不自动挂载。
176
+ - **CPU** (int) - 虚拟CPU核数。可选参数:1-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
177
+ - **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ > Spot计费为抢占式实例(内测阶段) \\ 默认为月付
178
+ - **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
179
+ - **Disks** (list) - 见 **CreateUHostInstanceParamDisks** 模型定义
180
+ - **Features** (dict) - 见 **CreateUHostInstanceParamFeatures** 模型定义
181
+ - **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
182
+ - **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "V100S",2080","2080TiS","2080TiPro","3090","4090","4090Pro","A100","A800"]。MachineType为G时必填
183
+ - **HostBinding** (bool) - 【私有专区属性】专区云主机开启宿住关联属性
184
+ - **HotplugFeature** (bool) - 热升级特性。True为开启,False为未开启,默认False。
185
+ - **IsolationGroup** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
186
+ - **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
187
+ - **MachineType** (str) - 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OM", "OMEM", "OPRO", "OPROG"]。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
188
+ - **MaxCount** (int) - 本次最大创建主机数量,取值范围是[1,100],默认值为1。- 库存数量不足时,按库存数量创建。- 配额不足时,返回错误。- 使用隔离组时,以隔离组可用数量为准。
189
+ - **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
190
+ - **MinCount** (int) - 本次最小创建主机数量,取值范围是[1,100],默认值为1。- 配额不足时,返回错误。
191
+ - **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"。
192
+ - **Name** (str) - UHost实例名称。默认:UHost。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定实例名称。
193
+ - **NetCapability** (str) - 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0;Extreme,开启网络增强3.0(详情参考官网文档)
194
+ - **NetworkInterface** (list) - 见 **CreateUHostInstanceParamNetworkInterface** 模型定义
195
+ - **Password** (str) - UHost密码。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64 UGFzc3dvcmQx。
196
+ - **PrivateIp** (list) - 【数组】创建云主机时指定内网IP。若不传值,则随机分配当前子网下的IP。调用方式举例:PrivateIp.0=x.x.x.x。当前只支持一个内网IP。
197
+ - **Quantity** (int) - 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
198
+ - **SecGroupId** (list) - 见 **CreateUHostInstanceParamSecGroupId** 模型定义
199
+ - **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall <https://docs.ucloud.cn/api/uhost-api/api/unet-api/describe_firewall.html>`_ 。
200
+ - **SecurityMode** (str) - 主机安全模式。Firewall:防火墙;SecGroup:安全组;默认值:Firewall。
201
+ - **SubnetId** (str) - 子网 ID。默认为当前地域的默认子网。
202
+ - **Tag** (str) - 业务组。默认:Default(Default即为未分组)。请遵照 `字段规范 <https://docs.ucloud.cn/api/uhost-api/specification>`_ 设定业务组。
203
+ - **UDHostId** (str) - 【私有专区属性】专区宿主机id
204
+ - **UDSetId** (str) - 【私有专区属性】专区id
205
+ - **UHostType** (str) - 【建议后续不再使用】云主机机型(V1.0),在本字段和字段MachineType中,仅需要其中1个字段即可。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
206
+ - **UserData** (str) - 用户自定义数据。当镜像支持Cloud-init Feature时可填写此字段。注意:1、总数据量大小不超过 16K;2、使用base64编码
207
+ - **VPCId** (str) - VPC ID。默认为当前地域的默认VPC。
208
+
209
+ **Response**
210
+
211
+ - **IPs** (list) - 【批量创建不会返回】IP信息
212
+ - **UHostIds** (list) - UHost实例Id集合
213
+
214
+ **Request Model**
215
+
216
+ **CreateUHostInstanceParamSecGroupId**
217
+ - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。
218
+ - **Priority** (int) - 安全组优先级。取值范围[1, 5]
219
+
220
+
221
+ **CreateUHostInstanceParamFeatures**
222
+ - **UNI** (bool) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。
223
+
224
+
225
+ **CreateUHostInstanceParamNetworkInterfaceEIPGlobalSSH**
226
+ - **Area** (str) -
227
+ - **AreaCode** (str) -
228
+ - **Port** (int) -
229
+
230
+
231
+ **CreateUHostInstanceParamNetworkInterfaceEIP**
232
+ - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
233
+ - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
234
+ - **OperatorName** (str) - 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International BGP: Bgp 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
235
+ - **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
236
+ - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
237
+
238
+
239
+ **CreateUHostInstanceParamNetworkInterfaceIPv6**
240
+
241
+
242
+ **CreateUHostInstanceParamNetworkInterface**
243
+ - **CreateCernetIp** (bool) - 申请并绑定一个教育网EIP。True为申请并绑定,False为不会申请绑定,默认False。当前只支持具有HPC特性的机型。
244
+ - **EIP** (dict) - 见 **CreateUHostInstanceParamNetworkInterfaceEIP** 模型定义
245
+
246
+
247
+ **CreateUHostInstanceParamDisksCustomBackup**
248
+
249
+
250
+ **CreateUHostInstanceParamDisks**
251
+ - **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ ,默认值:NONE
252
+ - **CouponId** (str) - 云盘代金券id。不适用于系统盘/本地盘。请通过DescribeCoupon接口查询,或登录用户中心查看
253
+ - **Encrypted** (bool) - 【功能仅部分可用区开放,详询技术支持】磁盘是否加密。加密:true, 不加密: false加密必须传入对应的的KmsKeyId,默认值false
254
+ - **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
255
+ - **KmsKeyId** (str) - 【功能仅部分可用区开放,详询技术支持】kms key id。选择加密盘时必填。
256
+ - **Size** (int) - 磁盘大小,单位GB。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
257
+ - **SnapshotId** (str) - 从快照创建盘时所用快照id,目前仅支持数据盘
258
+ - **Type** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
259
+
260
+
261
+ **CreateUHostInstanceParamVolumes**
262
+
263
+
264
+ """
265
+ # build request
266
+ d = {
267
+ "ProjectId": self.config.project_id,
268
+ "Region": self.config.region,
269
+ }
270
+ req and d.update(req)
271
+ d = apis.CreateUHostInstanceRequestSchema().dumps(d)
272
+
273
+ # build options
274
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
275
+
276
+ resp = self.invoke("CreateUHostInstance", d, **kwargs)
277
+ return apis.CreateUHostInstanceResponseSchema().loads(resp)
278
+
279
+ def create_uhost_key_pair(
280
+ self, req: typing.Optional[dict] = None, **kwargs
281
+ ) -> dict:
282
+ """CreateUHostKeyPair - 创建主机密钥对信息
283
+
284
+ **Request**
285
+
286
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
287
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
288
+ - **KeyPairName** (str) - (Required) 密钥对名称。 由字母,数字,符号组成,长度为1-63位。
289
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
290
+
291
+ **Response**
292
+
293
+ - **KeyPair** (dict) - 见 **KeyPair** 模型定义
294
+
295
+ **Response Model**
296
+
297
+ **KeyPair**
298
+ - **CreateTime** (int) - 密钥对的创建时间,格式为Unix Timestamp。
299
+ - **KeyPairFingerPrint** (str) - 密钥对指纹。md5(ProjectId|KeyPairId|PublicKey)
300
+ - **KeyPairId** (str) - 密钥对ID。
301
+ - **KeyPairName** (str) - 密钥对名称。 长度为1~63个英文或中文字符。
302
+ - **PrivateKeyBody** (str) - 密钥对的私钥内容。只有创建接口才会返回。
303
+ - **ProjectId** (str) - 项目ID。
304
+
305
+
306
+ """
307
+ # build request
308
+ d = {
309
+ "ProjectId": self.config.project_id,
310
+ "Region": self.config.region,
311
+ }
312
+ req and d.update(req)
313
+ d = apis.CreateUHostKeyPairRequestSchema().dumps(d)
314
+
315
+ # build options
316
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
317
+
318
+ resp = self.invoke("CreateUHostKeyPair", d, **kwargs)
319
+ return apis.CreateUHostKeyPairResponseSchema().loads(resp)
320
+
321
+ def delete_isolation_group(
322
+ self, req: typing.Optional[dict] = None, **kwargs
323
+ ) -> dict:
324
+ """DeleteIsolationGroup - 删除硬件隔离组。
325
+
326
+ **Request**
327
+
328
+ - **ProjectId** (str) - (Config) 项目id
329
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
330
+ - **GroupId** (str) - (Required) 硬件隔离组id
331
+
332
+ **Response**
333
+
334
+ - **GroupId** (str) - 硬件隔离组id
335
+
336
+ """
337
+ # build request
338
+ d = {
339
+ "ProjectId": self.config.project_id,
340
+ "Region": self.config.region,
341
+ }
342
+ req and d.update(req)
343
+ d = apis.DeleteIsolationGroupRequestSchema().dumps(d)
344
+
345
+ resp = self.invoke("DeleteIsolationGroup", d, **kwargs)
346
+ return apis.DeleteIsolationGroupResponseSchema().loads(resp)
347
+
348
+ def delete_uhost_key_pairs(
349
+ self, req: typing.Optional[dict] = None, **kwargs
350
+ ) -> dict:
351
+ """DeleteUHostKeyPairs - 删除一对或者多对密钥对。
352
+
353
+ **Request**
354
+
355
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
356
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
357
+ - **KeyPairIds** (list) - (Required) 密钥对ID,最多支持 100 对。
358
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
359
+
360
+ **Response**
361
+
362
+
363
+ """
364
+ # build request
365
+ d = {
366
+ "ProjectId": self.config.project_id,
367
+ "Region": self.config.region,
368
+ }
369
+ req and d.update(req)
370
+ d = apis.DeleteUHostKeyPairsRequestSchema().dumps(d)
371
+
372
+ resp = self.invoke("DeleteUHostKeyPairs", d, **kwargs)
373
+ return apis.DeleteUHostKeyPairsResponseSchema().loads(resp)
374
+
375
+ def describe_available_instance_types(
376
+ self, req: typing.Optional[dict] = None, **kwargs
377
+ ) -> dict:
378
+ """DescribeAvailableInstanceTypes - DescribeAvailableInstanceTypes
379
+
380
+ **Request**
381
+
382
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。
383
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
384
+ - **MachineTypes** (list) - 指定机型列表
385
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
386
+
387
+ **Response**
388
+
389
+ - **AvailableInstanceTypes** (list) - 见 **AvailableInstanceTypes** 模型定义
390
+ - **Status** (str) - 当前区域是否可售
391
+
392
+ **Response Model**
393
+
394
+ **Performance**
395
+ - **Rate** (int) - 交互展示参数,可忽略
396
+ - **Value** (float) - 值,单位是TFlops
397
+
398
+
399
+ **BootDiskInfo**
400
+ - **Features** (list) - 磁盘可支持的服务
401
+ - **InstantResize** (bool) - 系统盘是否允许扩容,如果是本地盘,则不允许扩容,InstantResize为false。
402
+ - **MaximalSize** (int) - MaximalSize为磁盘最大值
403
+ - **Name** (str) - 系统盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。
404
+
405
+
406
+ **DataDiskInfo**
407
+ - **Features** (list) - 数据盘可支持的服务
408
+ - **MaximalSize** (int) - MaximalSize为磁盘最大值
409
+ - **MinimalSize** (int) - 磁盘最小值,如果没有该字段,最小值取基础镜像Size值即可(linux为20G,windows为40G)。
410
+ - **Name** (str) - 数据盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。
411
+
412
+
413
+ **Disks**
414
+ - **BootDisk** (list) - 见 **BootDiskInfo** 模型定义
415
+ - **DataDisk** (list) - 见 **DataDiskInfo** 模型定义
416
+ - **Name** (str) - 磁盘介质类别信息,磁盘主要分类如下:云盘|cloudDisk、普通本地盘|normalLocalDisk和SSD本地盘|ssdLocalDisk。
417
+
418
+
419
+ **CpuPlatforms**
420
+ - **Amd** (list) - 返回AMD的CPU平台信息,例如:AMD: ['Amd/Epyc2']
421
+ - **Ampere** (list) - 返回Arm的CPU平台信息,例如:Ampere: ['Ampere/Altra']
422
+ - **Intel** (list) - 返回Intel的CPU平台信息,例如:Intel: ['Intel/CascadeLake','Intel/CascadelakeR','Intel/IceLake']
423
+
424
+
425
+ **GraphicsMemory**
426
+ - **Rate** (int) - 交互展示参数,可忽略
427
+ - **Value** (int) - 值,单位是GB
428
+
429
+
430
+ **Collection**
431
+ - **Cpu** (int) - CPU规格
432
+ - **Memory** (list) - 内存规格
433
+ - **MinimalCpuPlatform** (list) - CPU和内存规格只能在列出来的CPU平台支持
434
+
435
+
436
+ **MachineSizes**
437
+ - **Collection** (list) - 见 **Collection** 模型定义
438
+ - **Gpu** (int) - Gpu为GPU可支持的规格即GPU颗数,非GPU机型,Gpu为0
439
+
440
+
441
+ **FeatureModes**
442
+ - **MinimalCpuPlatform** (list) - 这个特性必须是列出来的CPU平台及以上的CPU才支持
443
+ - **Name** (str) - 模式|特性名称
444
+ - **RelatedToImageFeature** (list) - 为镜像上支持这个特性的标签。例如DescribeImage返回的字段Features包含HotPlug,说明该镜像支持热升级。
445
+
446
+
447
+ **Features**
448
+ - **Modes** (list) - 见 **FeatureModes** 模型定义
449
+ - **Name** (str) - 可支持的特性名称。目前支持的特性网络增强|NetCapability、热升级|Hotplug
450
+
451
+
452
+ **AvailableInstanceTypes**
453
+ - **CpuPlatforms** (dict) - 见 **CpuPlatforms** 模型定义
454
+ - **Description** (str) - 机型描述
455
+ - **Disks** (list) - 见 **Disks** 模型定义
456
+ - **Features** (list) - 见 **Features** 模型定义
457
+ - **GraphicsMemory** (dict) - 见 **GraphicsMemory** 模型定义
458
+ - **InstanceType** (str) - 实例类型,枚举值["uhost", "spot"]
459
+ - **MachineClass** (str) - 区分是否是GPU机型:GPU机型|GPU,非GPU机型|Normal。
460
+ - **MachineSizes** (list) - 见 **MachineSizes** 模型定义
461
+ - **Name** (str) - 机型名称:快杰O型|O 、快杰共享型|OM 、快杰内存型|OMEM 、 快杰PRO型|OPRO、通用N型|N、高主频C型|C和GPU G型|G等
462
+ - **ParentType** (str) - 父机型
463
+ - **Performance** (dict) - 见 **Performance** 模型定义
464
+ - **Status** (str) - 机型状态:可售|Normal 、 公测|Beta、售罄|Soldout、隐藏|Hidden
465
+ - **Zone** (str) - 可用区信息
466
+
467
+
468
+ """
469
+ # build request
470
+ d = {
471
+ "ProjectId": self.config.project_id,
472
+ "Region": self.config.region,
473
+ }
474
+ req and d.update(req)
475
+ d = apis.DescribeAvailableInstanceTypesRequestSchema().dumps(d)
476
+
477
+ resp = self.invoke("DescribeAvailableInstanceTypes", d, **kwargs)
478
+ return apis.DescribeAvailableInstanceTypesResponseSchema().loads(resp)
479
+
480
+ def describe_image(
481
+ self, req: typing.Optional[dict] = None, **kwargs
482
+ ) -> dict:
483
+ """DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。
484
+
485
+ **Request**
486
+
487
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
488
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
489
+ - **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像。FuncType传参错误会被忽略
490
+ - **ImageId** (str) - 镜像Id
491
+ - **ImageIds** (list) - 镜像Id列表
492
+ - **ImageType** (str) - 镜像类型。标准镜像:Base,镜像市场:Business, 自定义镜像:Custom,默认返回所有类型
493
+ - **Limit** (int) - 返回数据长度,默认为20
494
+ - **Offset** (int) - 列表起始位置偏移量,默认为0
495
+ - **OsType** (str) - 操作系统类型:Linux, Windows 默认返回所有类型
496
+ - **PriceSet** (int) - 是否返回价格:1返回,0不返回;默认不返回
497
+ - **Tag** (str) - 业务组Id。默认:Default
498
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
499
+
500
+ **Response**
501
+
502
+ - **ImageSet** (list) - 见 **UHostImageSet** 模型定义
503
+ - **TotalCount** (int) - 满足条件的镜像总数
504
+
505
+ **Response Model**
506
+
507
+ **BasePriceSet**
508
+ - **ChargeType** (str) - 计费类型
509
+ - **OriginalPrice** (float) - 限时优惠的折前原价(即列表价乘以商务折扣后的单价)。
510
+ - **Price** (float) - 价格,单位: 元,保留小数点后两位有效数字
511
+
512
+
513
+ **UHostImageSet**
514
+ - **CreateTime** (int) - 创建时间,格式为Unix时间戳
515
+ - **DataSnapshotIds** (list) - 关联的云盘数据盘快照Id列表
516
+ - **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架构)
517
+ - **FuncType** (str) - 镜像归属,枚举值:["gpu","app","uhost"]。"gpu": 对gpu进行处理过的行业镜像;"app":轻量云主机专用的镜像;"uhost":云主机镜像市场的行业镜像
518
+ - **ImageDescription** (str) - 镜像描述
519
+ - **ImageId** (str) - 镜像ID
520
+ - **ImageName** (str) - 镜像名称
521
+ - **ImageSize** (int) - 镜像大小
522
+ - **ImageType** (str) - 镜像类型 标准镜像:Base, 行业镜像:Business,自定义镜像:Custom
523
+ - **IntegratedSoftware** (str) - 集成软件名称(仅行业镜像将返回这个值)
524
+ - **Links** (str) - 介绍链接(仅行业镜像将返回这个值)
525
+ - **MaintainEol** (str) - 系统EOL的时间,格式:YYYY/MM/DD
526
+ - **MinimalCPU** (str) - 默认值为空'''。当CentOS 7.3/7.4/7.5等镜像会标记为“Broadwell”
527
+ - **OsName** (str) - 操作系统名称
528
+ - **OsType** (str) - 操作系统类型:Linux,Windows
529
+ - **PriceSet** (list) - 见 **BasePriceSet** 模型定义
530
+ - **PrimarySoftware** (str) - 主要安装软件
531
+ - **SceneCategories** (list) - 场景分类,目前包含Featured(精选),PreInstalledDrivers(预装驱动),AIPainting(AI绘画),AIModels(AI模型),HPC(高性能计算)
532
+ - **State** (str) - 镜像状态, 可用:Available,制作中:Making, 不可用:Unavailable,复制中:Copying
533
+ - **SupportedGPUTypes** (list) - 支持的GPU机型
534
+ - **Tag** (str) - 业务组
535
+ - **Vendor** (str) - 供应商(仅行业镜像将返回这个值)
536
+ - **Zone** (str) - 可用区,参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
537
+
538
+
539
+ """
540
+ # build request
541
+ d = {
542
+ "ProjectId": self.config.project_id,
543
+ "Region": self.config.region,
544
+ }
545
+ req and d.update(req)
546
+ d = apis.DescribeImageRequestSchema().dumps(d)
547
+
548
+ resp = self.invoke("DescribeImage", d, **kwargs)
549
+ return apis.DescribeImageResponseSchema().loads(resp)
550
+
551
+ def describe_isolation_group(
552
+ self, req: typing.Optional[dict] = None, **kwargs
553
+ ) -> dict:
554
+ """DescribeIsolationGroup - 查询硬件隔离组列表。
555
+
556
+ **Request**
557
+
558
+ - **ProjectId** (str) - (Config) 项目id
559
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
560
+ - **GroupId** (str) - 待查的硬件隔离组id
561
+ - **Limit** (int) - 返回数据长度,默认为20,最大100
562
+ - **Offset** (int) - 列表起始位置偏移量,默认为0
563
+
564
+ **Response**
565
+
566
+ - **IsolationGroupSet** (list) - 见 **IsolationGroup** 模型定义
567
+ - **TotalCount** (int) - 硬件隔离组总数
568
+
569
+ **Response Model**
570
+
571
+ **SpreadInfo**
572
+ - **UHostCount** (int) - 当前地域所有可用区中硬件隔离组中云主机的数量,不超过7。
573
+ - **Zone** (str) - 可用区信息
574
+
575
+
576
+ **IsolationGroup**
577
+ - **GroupId** (str) - 硬件隔离组id
578
+ - **GroupName** (str) - 硬件隔离组名称
579
+ - **Remark** (str) - 备注
580
+ - **SpreadInfoSet** (list) - 见 **SpreadInfo** 模型定义
581
+
582
+
583
+ """
584
+ # build request
585
+ d = {
586
+ "ProjectId": self.config.project_id,
587
+ "Region": self.config.region,
588
+ }
589
+ req and d.update(req)
590
+ d = apis.DescribeIsolationGroupRequestSchema().dumps(d)
591
+
592
+ resp = self.invoke("DescribeIsolationGroup", d, **kwargs)
593
+ return apis.DescribeIsolationGroupResponseSchema().loads(resp)
594
+
595
+ def describe_uhost_instance(
596
+ self, req: typing.Optional[dict] = None, **kwargs
597
+ ) -> dict:
598
+ """DescribeUHostInstance - 获取主机或主机列表信息,并可根据数据中心,主机ID等参数进行过滤。
599
+
600
+ **Request**
601
+
602
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
603
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
604
+ - **IsolationGroup** (str) - 硬件隔离组id。通过硬件隔离组筛选主机。
605
+ - **Limit** (int) - 返回数据长度,默认为20,最大100
606
+ - **Offset** (int) - 列表起始位置偏移量,默认为0
607
+ - **SubnetId** (str) - 子网id。通过子网筛选主机。北京一地域无效。
608
+ - **Tag** (str) - 要查询的业务组名称
609
+ - **UDiskIdForAttachment** (str) - 要挂载的云盘id,过滤返回能被UDiskId挂载的云主机。目前主要针对rssd云盘使用
610
+ - **UHostIds** (list) - 【数组】UHost主机的资源ID,例如UHostIds.0代表希望获取信息 的主机1,UHostIds.1代表主机2。 如果不传入,则返回当前Region 所有符合条件的UHost实例。
611
+ - **VPCId** (str) - vpc id。通过VPC筛选主机。北京一地域无效。
612
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
613
+
614
+ **Response**
615
+
616
+ - **TotalCount** (int) - UHostInstance总数
617
+ - **UHostSet** (list) - 见 **UHostInstanceSet** 模型定义
618
+
619
+ **Response Model**
620
+
621
+ **UHostKeyPair**
622
+ - **KeyPairId** (str) - 密钥对ID
623
+ - **KeyPairState** (str) - 主机密钥对状态,Normal 正常,Deleted 删除
624
+
625
+
626
+ **UHostDiskSet**
627
+ - **BackupType** (str) - 备份方案。若开通了数据方舟,则为DATAARK
628
+ - **DiskId** (str) - 磁盘ID
629
+ - **DiskType** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
630
+ - **Drive** (str) - 磁盘盘符
631
+ - **Encrypted** (str) - "true": 加密盘 "false":非加密盘
632
+ - **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
633
+ - **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回)
634
+ - **Size** (int) - 磁盘大小,单位: GB
635
+ - **Type** (str) - 【建议不再使用】磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
636
+
637
+
638
+ **UHostIPSet**
639
+ - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息)
640
+ - **Default** (str) - 内网 Private 类型下,表示是否为默认网卡。true: 是默认网卡;其他值:不是。
641
+ - **IP** (str) - IP地址
642
+ - **IPId** (str) - 外网IP资源ID 。(内网IP无对应的资源ID)
643
+ - **IPMode** (str) - IPv4/IPv6;
644
+ - **Mac** (str) - 内网 Private 类型下,当前网卡的Mac。
645
+ - **NetworkInterfaceId** (str) - 弹性网卡为默认网卡时,返回对应的 ID 值
646
+ - **SubnetId** (str) - IP地址对应的子网 ID。(北京一不支持,字段返回为空)
647
+ - **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private
648
+ - **VPCId** (str) - IP地址对应的VPC ID。(北京一不支持,字段返回为空)
649
+ - **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。
650
+
651
+
652
+ **SpotAttribute**
653
+ - **RecycleTime** (int) - 回收时间
654
+
655
+
656
+ **UDSetUDHostAttribute**
657
+ - **HostBinding** (bool) - 是否绑定私有专区宿主机
658
+ - **UDHostId** (str) - 私有专区宿主机
659
+ - **UDSetId** (str) - 私有专区
660
+
661
+
662
+ **UHostInstanceSet**
663
+ - **AutoRenew** (str) - 是否自动续费,自动续费:“Yes”,不自动续费:“No”
664
+ - **BasicImageId** (str) - 基础镜像ID(指当前自定义镜像的来源镜像)
665
+ - **BasicImageName** (str) - 基础镜像名称(指当前自定义镜像的来源镜像)
666
+ - **BootDiskState** (str) - 系统盘状态 Normal表示初始化完成;Initializing表示在初始化。仍在初始化的系统盘无法制作镜像。
667
+ - **CPU** (int) - 虚拟CPU核数,单位: 个
668
+ - **ChargeType** (str) - 计费模式,枚举值为: Year,按年付费; Month,按月付费; Dynamic,按需付费(需开启权限);Preemptive 为抢占式实例;
669
+ - **CloudInitFeature** (bool) - true: 支持cloutinit方式初始化;false: 不支持
670
+ - **CpuPlatform** (str) - 云主机CPU平台。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type#主机概念20版本>`_ 。
671
+ - **CreateTime** (int) - 创建时间,格式为Unix时间戳
672
+ - **DiskSet** (list) - 见 **UHostDiskSet** 模型定义
673
+ - **EpcInstance** (bool) - true: 高性能计算主机;false: 不是
674
+ - **ExpireTime** (int) - 到期时间,格式为Unix时间戳
675
+ - **GPU** (int) - GPU个数
676
+ - **GpuType** (str) - GPU类型;枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","4090","4090Pro","A100","A800","H20"]
677
+ - **HiddenKvm** (bool) - true: 开启 hidden kvm 功能;false: 不是
678
+ - **HostType** (str) - 【建议不再使用】主机系列:N2,表示系列2;N1,表示系列1
679
+ - **HotPlugMaxCpu** (int) - 热升级支持的最大CPU个数
680
+ - **HotplugFeature** (bool) - true: 开启热升级; false,未开启热升级
681
+ - **HpcFeature** (bool) - true: 开启 hpc 系列功能;false: 未开启
682
+ - **IPSet** (list) - 见 **UHostIPSet** 模型定义
683
+ - **IPv6Feature** (bool) - true: 有ipv6特性;false,没有ipv6特性
684
+ - **ImageId** (str) - 【建议不再使用】主机的系统盘ID。
685
+ - **IsolationGroup** (str) - 隔离组id,不在隔离组则返回""
686
+ - **KeyPair** (dict) - 见 **UHostKeyPair** 模型定义
687
+ - **LifeCycle** (str) - 主机的生命周期类型。目前仅支持Normal:普通;
688
+ - **MachineType** (str) - 云主机机型(新)。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type#主机概念20版本>`_ 。
689
+ - **Memory** (int) - 内存大小,单位: MB
690
+ - **Name** (str) - UHost实例名称
691
+ - **NetCapability** (str) - 网络增强。Normal: 无;Super: 网络增强1.0; Ultra: 网络增强2.0
692
+ - **NetFeatureTag** (str) - Firewall:防火墙,SecGroup:安全组,Acl:acl
693
+ - **NetworkState** (str) - 【建议不再使用】网络状态。 连接:Connected, 断开:NotConnected
694
+ - **OsName** (str) - 创建主机的最初来源镜像的操作系统名称(若直接通过基础镜像创建,此处返回和BasicImageName一致)
695
+ - **OsType** (str) - 操作系统类别。返回"Linux"或者"Windows"
696
+ - **RdmaClusterId** (str) - RDMA集群id,仅快杰云主机返回该值;其他类型云主机返回""。当云主机的此值与RSSD云盘的RdmaClusterId相同时,RSSD可以挂载到这台云主机。
697
+ - **Remark** (str) - 备注
698
+ - **RestrictMode** (str) - 仅抢占式实例返回,LowSpeed为低速模式,PowerOff为关机模式
699
+ - **SecGroupInstance** (bool) - 【待废弃】true: 绑定了安全组的主机;false: 不是
700
+ - **SpotAttribute** (dict) - 见 **SpotAttribute** 模型定义
701
+ - **State** (str) - 实例状态,枚举值:\\ >初始化: Initializing; \\ >启动中: Starting; \\> 运行中: Running; \\> 关机中: Stopping; \\ >关机: Stopped \\ >安装失败: Install Fail; \\ >重启中: Rebooting; \\ > 未知(空字符串,获取状态超时或出错):""
702
+ - **StorageType** (str) - 【建议不再使用】主机磁盘类型。 枚举值为:\\ > LocalDisk,本地磁盘; \\ > UDisk 云盘。\\只要有一块磁盘为本地盘,即返回LocalDisk。
703
+ - **SubnetType** (str) - 【建议不再使用】仅北京A的云主机会返回此字段。基础网络模式:Default;子网模式:Private
704
+ - **Tag** (str) - 业务组名称
705
+ - **TimemachineFeature** (str) - 【建议不再使用】数据方舟模式。枚举值:\\ > Yes: 开启方舟; \\ > no,未开启方舟
706
+ - **TotalDiskSpace** (int) - 总的数据盘存储空间。
707
+ - **UDHostAttribute** (dict) - 见 **UDSetUDHostAttribute** 模型定义
708
+ - **UHostId** (str) - UHost实例ID
709
+ - **UHostType** (str) - 【建议不再使用】云主机机型(旧)。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
710
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
711
+
712
+
713
+ """
714
+ # build request
715
+ d = {
716
+ "ProjectId": self.config.project_id,
717
+ "Region": self.config.region,
718
+ }
719
+ req and d.update(req)
720
+ d = apis.DescribeUHostInstanceRequestSchema().dumps(d)
721
+
722
+ resp = self.invoke("DescribeUHostInstance", d, **kwargs)
723
+ return apis.DescribeUHostInstanceResponseSchema().loads(resp)
724
+
725
+ def describe_uhost_instance_snapshot(
726
+ self, req: typing.Optional[dict] = None, **kwargs
727
+ ) -> dict:
728
+ """DescribeUHostInstanceSnapshot -
729
+
730
+ **Request**
731
+
732
+ - **ProjectId** (str) - (Config)
733
+ - **Region** (str) - (Config)
734
+ - **UHostId** (str) - (Required)
735
+ - **Zone** (str) -
736
+
737
+ **Response**
738
+
739
+ - **SnapshotSet** (list) - 见 **UHostSnapshotSet** 模型定义
740
+ - **UhostId** (str) -
741
+
742
+ **Response Model**
743
+
744
+ **UHostSnapshotSet**
745
+ - **SnapshotName** (str) -
746
+ - **SnapshotState** (str) -
747
+ - **SnapshotTime** (str) -
748
+
749
+
750
+ """
751
+ # build request
752
+ d = {
753
+ "ProjectId": self.config.project_id,
754
+ "Region": self.config.region,
755
+ }
756
+ req and d.update(req)
757
+ d = apis.DescribeUHostInstanceSnapshotRequestSchema().dumps(d)
758
+
759
+ # build options
760
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
761
+
762
+ resp = self.invoke("DescribeUHostInstanceSnapshot", d, **kwargs)
763
+ return apis.DescribeUHostInstanceSnapshotResponseSchema().loads(resp)
764
+
765
+ def describe_uhost_key_pairs(
766
+ self, req: typing.Optional[dict] = None, **kwargs
767
+ ) -> dict:
768
+ """DescribeUHostKeyPairs - 查询一个或多个密钥对。
769
+
770
+ **Request**
771
+
772
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
773
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
774
+ - **KeyPairFingerPrint** (str) - 密钥对的指纹。
775
+ - **KeyPairName** (str) - 密钥对名称。
776
+ - **Limit** (int) - 返回数据长度,默认为20,最大100
777
+ - **Offset** (int) - 列表起始位置偏移量,默认为0
778
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
779
+
780
+ **Response**
781
+
782
+ - **KeyPairs** (list) - 见 **KeyPairDesc** 模型定义
783
+ - **TotalCount** (int) - 密钥对总数
784
+
785
+ **Response Model**
786
+
787
+ **KeyPairDesc**
788
+ - **CreateTime** (int) - 密钥对的创建时间,格式为Unix Timestamp。
789
+ - **KeyPairFingerPrint** (str) - 密钥对指纹。md5(ProjectId|KeyPairId|PublicKey)
790
+ - **KeyPairId** (str) - 密钥对ID。
791
+ - **KeyPairName** (str) - 密钥对名称。 长度为1~63个英文或中文字符。
792
+ - **ProjectId** (str) - 项目ID。
793
+
794
+
795
+ """
796
+ # build request
797
+ d = {
798
+ "ProjectId": self.config.project_id,
799
+ "Region": self.config.region,
800
+ }
801
+ req and d.update(req)
802
+ d = apis.DescribeUHostKeyPairsRequestSchema().dumps(d)
803
+
804
+ resp = self.invoke("DescribeUHostKeyPairs", d, **kwargs)
805
+ return apis.DescribeUHostKeyPairsResponseSchema().loads(resp)
806
+
807
+ def describe_uhost_tags(
808
+ self, req: typing.Optional[dict] = None, **kwargs
809
+ ) -> dict:
810
+ """DescribeUHostTags - 获取指定数据中心的业务组列表。
811
+
812
+ **Request**
813
+
814
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
815
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
816
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
817
+
818
+ **Response**
819
+
820
+ - **TagSet** (list) - 见 **UHostTagSet** 模型定义
821
+ - **TotalCount** (int) - 已有主机的业务组总数
822
+
823
+ **Response Model**
824
+
825
+ **UHostTagSet**
826
+ - **Tag** (str) - 业务组名称
827
+ - **TotalCount** (int) - 该业务组中包含的主机个数
828
+ - **Zone** (str) - 可用区
829
+
830
+
831
+ """
832
+ # build request
833
+ d = {
834
+ "ProjectId": self.config.project_id,
835
+ "Region": self.config.region,
836
+ }
837
+ req and d.update(req)
838
+ d = apis.DescribeUHostTagsRequestSchema().dumps(d)
839
+
840
+ resp = self.invoke("DescribeUHostTags", d, **kwargs)
841
+ return apis.DescribeUHostTagsResponseSchema().loads(resp)
842
+
843
+ def get_attached_disk_upgrade_price(
844
+ self, req: typing.Optional[dict] = None, **kwargs
845
+ ) -> dict:
846
+ """GetAttachedDiskUpgradePrice - 获取挂载磁盘的升级价格
847
+
848
+ **Request**
849
+
850
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
851
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
852
+ - **DiskId** (str) - (Required) 磁盘ID。参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_ 返回值中的DiskSet。
853
+ - **DiskSpace** (int) - (Required) 磁盘大小,单位GB。取值范围需大于当前磁盘大小,最大值请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
854
+ - **UHostId** (str) - (Required) UHost实例ID。 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_ 。
855
+ - **BackupMode** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > DATAARK,数据方舟 \\> SNAPSHOT(SNAPSHOT模式目前仅在上海C支持),快照 \\ 当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认值为当前的备份模式。
856
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
857
+
858
+ **Response**
859
+
860
+ - **ListPrice** (float) - 原价。精度为小数点后2位。
861
+ - **ListPriceDetail** (dict) - 见 **DiskUpgradePriceDetail** 模型定义
862
+ - **OriginalPrice** (float) - 用户折后价。精度为小数点后2位。
863
+ - **OriginalPriceDetail** (dict) - 见 **DiskUpgradePriceDetail** 模型定义
864
+ - **Price** (float) - 升级差价。精度为小数点后2位。
865
+ - **PriceDetail** (dict) - 见 **DiskUpgradePriceDetail** 模型定义
866
+
867
+ **Response Model**
868
+
869
+ **DiskUpgradePriceDetail**
870
+ - **Snapshot** (float) - 快照的价格
871
+ - **UDisk** (float) - 磁盘的价格
872
+
873
+
874
+ """
875
+ # build request
876
+ d = {
877
+ "ProjectId": self.config.project_id,
878
+ "Region": self.config.region,
879
+ }
880
+ req and d.update(req)
881
+ d = apis.GetAttachedDiskUpgradePriceRequestSchema().dumps(d)
882
+
883
+ resp = self.invoke("GetAttachedDiskUpgradePrice", d, **kwargs)
884
+ return apis.GetAttachedDiskUpgradePriceResponseSchema().loads(resp)
885
+
886
+ def get_uhost_instance_price(
887
+ self, req: typing.Optional[dict] = None, **kwargs
888
+ ) -> dict:
889
+ """GetUHostInstancePrice - 根据UHost实例配置,获取UHost实例的价格。
890
+
891
+ **Request**
892
+
893
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
894
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
895
+ - **CPU** (int) - (Required) CPU核数。可选参数:1-64。可选范围参照控制台。默认值: 4
896
+ - **Count** (int) - (Required) 购买台数,范围[1,5]
897
+ - **Memory** (int) - (Required) 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参照好控制台)。默认值:8192
898
+ - **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时付费 // >Preemptive 抢占式实例 \\ 如果不传某个枚举值,默认返回年付、月付、时付的价格组合集。
899
+ - **CpuPlatform** (str) - 取值"Intel" "Amd",默认值“Intel”
900
+ - **Disks** (list) - 见 **GetUHostInstancePriceParamDisks** 模型定义
901
+ - **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段。
902
+ - **GpuType** (str) - GPU类型,枚举值["K80", "P40", "V100", "T4","T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4","MI100","V100S"]
903
+ - **ImageId** (str) - 镜像Id,可通过 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_ 获取镜像ID, 如果镜像ID不传,系统盘大小必传
904
+ - **MachineType** (str) - 云主机机型(V2版本概念)。枚举值["N", "C", "G", "O", "OS", "OPRO", "OMAX", "O.BM", "O.EPC"]。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
905
+ - **NetCapability** (str) - 网络增强。枚举值:Normal,不开启; Super,开启网络增强1.0。 默认值为Normal。
906
+ - **Quantity** (int) - 购买时长。默认: 1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。
907
+ - **ShowPriceDetails** (bool) - 返回价格详细信息
908
+ - **UDSetUHostInstance** (bool) - 专区云主机。如果要在专区宿主机上创建云主机,该参数可以填写为true
909
+ - **UHostType** (str) - 【待废弃】云主机机型(V1版本概念)。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
910
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
911
+
912
+ **Response**
913
+
914
+ - **PriceSet** (list) - 见 **UHostPriceSet** 模型定义
915
+
916
+ **Request Model**
917
+
918
+ **GetUHostInstancePriceParamVolumes**
919
+
920
+
921
+ **GetUHostInstancePriceParamDisks**
922
+ - **BackupType** (str) - 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > DATAARK,数据方舟 \\ > SNAPSHOT,快照\\ 当前磁盘支持的备份模式参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_
923
+ - **IsBoot** (str) - 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
924
+ - **Size** (int) - 磁盘大小,单位GB。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
925
+ - **Type** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
926
+
927
+
928
+ **Response Model**
929
+
930
+ **PriceDetail**
931
+ - **Snapshot** (float) - 快照价格
932
+ - **UDisk** (float) - 云盘价格
933
+ - **UHost** (float) - 主机价格
934
+ - **Volume** (float) - 数据卷价格
935
+
936
+
937
+ **UHostPriceSet**
938
+ - **ChargeType** (str) - 计费类型。Year,Month,Dynamic
939
+ - **ListPrice** (float) - 产品列表价。
940
+ - **ListPriceDetail** (dict) - 见 **PriceDetail** 模型定义
941
+ - **OriginalPrice** (float) - 限时优惠的折前原价(即列表价乘以商务折扣后的单价)。
942
+ - **OriginalPriceDetail** (dict) - 见 **PriceDetail** 模型定义
943
+ - **Price** (float) - 价格,单位: 元,保留小数点后两位有效数字
944
+ - **PriceDetail** (dict) - 见 **PriceDetail** 模型定义
945
+
946
+
947
+ """
948
+ # build request
949
+ d = {
950
+ "ProjectId": self.config.project_id,
951
+ "Region": self.config.region,
952
+ }
953
+ req and d.update(req)
954
+ d = apis.GetUHostInstancePriceRequestSchema().dumps(d)
955
+
956
+ resp = self.invoke("GetUHostInstancePrice", d, **kwargs)
957
+ return apis.GetUHostInstancePriceResponseSchema().loads(resp)
958
+
959
+ def get_uhost_instance_vnc_info(
960
+ self, req: typing.Optional[dict] = None, **kwargs
961
+ ) -> dict:
962
+ """GetUHostInstanceVncInfo - 获取指定UHost实例的管理VNC配置详细信息。
963
+
964
+ **Request**
965
+
966
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
967
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
968
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
969
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
970
+
971
+ **Response**
972
+
973
+ - **UHostId** (str) - UHost实例ID
974
+ - **VncIP** (str) - Vnc登录IP
975
+ - **VncPassword** (str) - Vnc 登录密码
976
+ - **VncPort** (int) - Vnc登录端口
977
+
978
+ """
979
+ # build request
980
+ d = {
981
+ "ProjectId": self.config.project_id,
982
+ "Region": self.config.region,
983
+ }
984
+ req and d.update(req)
985
+ d = apis.GetUHostInstanceVncInfoRequestSchema().dumps(d)
986
+
987
+ resp = self.invoke("GetUHostInstanceVncInfo", d, **kwargs)
988
+ return apis.GetUHostInstanceVncInfoResponseSchema().loads(resp)
989
+
990
+ def get_uhost_refund_price(
991
+ self, req: typing.Optional[dict] = None, **kwargs
992
+ ) -> dict:
993
+ """GetUHostRefundPrice - 获取主机删除扣除费用。包括主机、磁盘、快照服务、EIP等资源的费用
994
+
995
+ **Request**
996
+
997
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
998
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
999
+ - **UHostIds** (list) - (Required) 【数组】UHost实例ID。参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1000
+
1001
+ **Response**
1002
+
1003
+ - **RefundPriceSet** (list) - 见 **UHostRefundPriceSet** 模型定义
1004
+
1005
+ **Response Model**
1006
+
1007
+ **UHostRefundPriceSet**
1008
+ - **Code** (int) - 实例操作结果的错误码。0为成功
1009
+ - **Message** (str) - 当 Code 非 0 时提供详细的描述信息
1010
+ - **RefundPrice** (float) - 实例的删除退费金额
1011
+ - **UHostId** (str) - UHost实例ID
1012
+
1013
+
1014
+ """
1015
+ # build request
1016
+ d = {
1017
+ "ProjectId": self.config.project_id,
1018
+ "Region": self.config.region,
1019
+ }
1020
+ req and d.update(req)
1021
+ d = apis.GetUHostRefundPriceRequestSchema().dumps(d)
1022
+
1023
+ resp = self.invoke("GetUHostRefundPrice", d, **kwargs)
1024
+ return apis.GetUHostRefundPriceResponseSchema().loads(resp)
1025
+
1026
+ def get_uhost_renew_price(
1027
+ self, req: typing.Optional[dict] = None, **kwargs
1028
+ ) -> dict:
1029
+ """GetUHostRenewPrice - 获取主机续费价格
1030
+
1031
+ **Request**
1032
+
1033
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1034
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1035
+ - **ChargeType** (str) - (Required) 计费类型。Year,Month,Dynamic,默认返回全部计费方式对应的价格
1036
+ - **UHostId** (str) - (Required) UHost实例ID
1037
+
1038
+ **Response**
1039
+
1040
+ - **PriceSet** (list) - 见 **BasePriceSet** 模型定义
1041
+
1042
+ **Response Model**
1043
+
1044
+ **BasePriceSet**
1045
+ - **ChargeType** (str) - 计费类型
1046
+ - **OriginalPrice** (float) - 限时优惠的折前原价(即列表价乘以商务折扣后的单价)。
1047
+ - **Price** (float) - 价格,单位: 元,保留小数点后两位有效数字
1048
+
1049
+
1050
+ """
1051
+ # build request
1052
+ d = {
1053
+ "ProjectId": self.config.project_id,
1054
+ "Region": self.config.region,
1055
+ }
1056
+ req and d.update(req)
1057
+ d = apis.GetUHostRenewPriceRequestSchema().dumps(d)
1058
+
1059
+ resp = self.invoke("GetUHostRenewPrice", d, **kwargs)
1060
+ return apis.GetUHostRenewPriceResponseSchema().loads(resp)
1061
+
1062
+ def get_uhost_upgrade_price(
1063
+ self, req: typing.Optional[dict] = None, **kwargs
1064
+ ) -> dict:
1065
+ """GetUHostUpgradePrice - 获取UHost实例升级配置的价格。可选配置范围请参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
1066
+
1067
+ **Request**
1068
+
1069
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1070
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1071
+ - **UHostId** (str) - (Required) UHost实例ID。 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_ 。
1072
+ - **CPU** (int) - 虚拟CPU核数。可选参数:1-64(可选范围参考控制台)。默认值为当前实例的CPU核数。
1073
+ - **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
1074
+ - **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值为当前实例的内存大小。
1075
+ - **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)。仅支持网络增强1.0和网络增强2.0的开启和关闭,不支持网络增强特性互相转换,如网络增强1.0升级到网络增强2.0是不被支持的。
1076
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1077
+
1078
+ **Response**
1079
+
1080
+ - **OriginalPrice** (float) - 限时优惠的折前原价
1081
+ - **Price** (float) - 规格调整差价。精确到小数点后2位。
1082
+
1083
+ """
1084
+ # build request
1085
+ d = {
1086
+ "ProjectId": self.config.project_id,
1087
+ "Region": self.config.region,
1088
+ }
1089
+ req and d.update(req)
1090
+ d = apis.GetUHostUpgradePriceRequestSchema().dumps(d)
1091
+
1092
+ resp = self.invoke("GetUHostUpgradePrice", d, **kwargs)
1093
+ return apis.GetUHostUpgradePriceResponseSchema().loads(resp)
1094
+
1095
+ def import_custom_image(
1096
+ self, req: typing.Optional[dict] = None, **kwargs
1097
+ ) -> dict:
1098
+ """ImportCustomImage - 把UFile的镜像文件导入到UHost,生成自定义镜像
1099
+
1100
+ **Request**
1101
+
1102
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1103
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1104
+ - **Auth** (bool) - (Required) 是否授权。必须填true
1105
+ - **Format** (str) - (Required) 镜像格式,可选RAW、VHD、VMDK、qcow2
1106
+ - **ImageName** (str) - (Required) 镜像名称
1107
+ - **OsName** (str) - (Required) 操作系统详细版本,请参考控制台的镜像版本;OsType为Other时,输入参数为Other
1108
+ - **OsType** (str) - (Required) 操作系统平台,比如CentOS、Ubuntu、Windows、RedHat等,请参考控制台的镜像版本;若导入控制台上没有的操作系统,参数为Other
1109
+ - **UFileUrl** (str) - (Required) UFile私有空间地址
1110
+ - **ImageDescription** (str) - 镜像描述
1111
+ - **Tag** (str) - 业务组
1112
+
1113
+ **Response**
1114
+
1115
+ - **ImageId** (str) - 镜像Id
1116
+
1117
+ """
1118
+ # build request
1119
+ d = {
1120
+ "ProjectId": self.config.project_id,
1121
+ "Region": self.config.region,
1122
+ }
1123
+ req and d.update(req)
1124
+ d = apis.ImportCustomImageRequestSchema().dumps(d)
1125
+
1126
+ # build options
1127
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
1128
+
1129
+ resp = self.invoke("ImportCustomImage", d, **kwargs)
1130
+ return apis.ImportCustomImageResponseSchema().loads(resp)
1131
+
1132
+ def import_uhost_key_pairs(
1133
+ self, req: typing.Optional[dict] = None, **kwargs
1134
+ ) -> dict:
1135
+ """ImportUHostKeyPairs - 导入密钥对后,仅保管公钥部分,需自行妥善保存密钥对的私钥部分。
1136
+
1137
+ **Request**
1138
+
1139
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1140
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1141
+ - **KeyPairName** (str) - (Required) 密钥对名称。由字母,数字,符号组成,长度为1-63位。
1142
+ - **PublicKeyBody** (str) - (Required) 密钥对的公钥内容。
1143
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1144
+
1145
+ **Response**
1146
+
1147
+ - **KeyPairFingerPrint** (str) - 密钥对指纹。根据RFC4716定义的公钥指纹格式,采用MD5信息摘要算法。算法处理的具体信息格式:`ProjectIdKeyPairId|PublicKeyBody`。
1148
+ - **KeyPairId** (str) - 密钥对标识
1149
+ - **KeyPairName** (str) - 密钥对名称
1150
+
1151
+ """
1152
+ # build request
1153
+ d = {
1154
+ "ProjectId": self.config.project_id,
1155
+ "Region": self.config.region,
1156
+ }
1157
+ req and d.update(req)
1158
+ d = apis.ImportUHostKeyPairsRequestSchema().dumps(d)
1159
+
1160
+ # build options
1161
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
1162
+
1163
+ resp = self.invoke("ImportUHostKeyPairs", d, **kwargs)
1164
+ return apis.ImportUHostKeyPairsResponseSchema().loads(resp)
1165
+
1166
+ def leave_isolation_group(
1167
+ self, req: typing.Optional[dict] = None, **kwargs
1168
+ ) -> dict:
1169
+ """LeaveIsolationGroup - 移除硬件隔离组中的主机
1170
+
1171
+ **Request**
1172
+
1173
+ - **ProjectId** (str) - (Config) 项目id
1174
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1175
+ - **GroupId** (str) - (Required) 硬件隔离组id
1176
+ - **UHostId** (str) - (Required) 主机id
1177
+ - **Zone** (str) - 可用区信息
1178
+
1179
+ **Response**
1180
+
1181
+ - **UHostId** (str) - 主机id
1182
+
1183
+ """
1184
+ # build request
1185
+ d = {
1186
+ "ProjectId": self.config.project_id,
1187
+ "Region": self.config.region,
1188
+ }
1189
+ req and d.update(req)
1190
+ d = apis.LeaveIsolationGroupRequestSchema().dumps(d)
1191
+
1192
+ resp = self.invoke("LeaveIsolationGroup", d, **kwargs)
1193
+ return apis.LeaveIsolationGroupResponseSchema().loads(resp)
1194
+
1195
+ def modify_uhost_ip(
1196
+ self, req: typing.Optional[dict] = None, **kwargs
1197
+ ) -> dict:
1198
+ """ModifyUHostIP - 修改云主机内网 IP 地址
1199
+
1200
+ **Request**
1201
+
1202
+ - **ProjectId** (str) - (Config) 项目ID。不填写时为默认项目。请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1203
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1204
+ - **PresentIpAddress** (str) - (Required) 需要修改为的 IP 地址。新的IP地址和旧IP地址必须属于统一子网,且和主机内部的配置文件一致。
1205
+ - **UHostId** (str) - (Required) 指定云主机 ID。
1206
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1207
+ - **PreviousIpAddress** (str) - 所需修改的原 IP 地址 ,当云主机只有一个IP地址时,此参数不必填写。
1208
+
1209
+ **Response**
1210
+
1211
+ - **Message** (str) - 输出错误的信息
1212
+ - **UHostId** (str) - 目标云主机 ID
1213
+
1214
+ """
1215
+ # build request
1216
+ d = {
1217
+ "ProjectId": self.config.project_id,
1218
+ "Region": self.config.region,
1219
+ }
1220
+ req and d.update(req)
1221
+ d = apis.ModifyUHostIPRequestSchema().dumps(d)
1222
+
1223
+ resp = self.invoke("ModifyUHostIP", d, **kwargs)
1224
+ return apis.ModifyUHostIPResponseSchema().loads(resp)
1225
+
1226
+ def modify_uhost_instance_name(
1227
+ self, req: typing.Optional[dict] = None, **kwargs
1228
+ ) -> dict:
1229
+ """ModifyUHostInstanceName - 修改指定UHost实例名称,需要给出数据中心,UHostId,及新的实例名称。
1230
+
1231
+ **Request**
1232
+
1233
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1234
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1235
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1236
+ - **Name** (str) - UHost实例名称
1237
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1238
+
1239
+ **Response**
1240
+
1241
+ - **UHostId** (str) - UHost实例ID
1242
+
1243
+ """
1244
+ # build request
1245
+ d = {
1246
+ "ProjectId": self.config.project_id,
1247
+ "Region": self.config.region,
1248
+ }
1249
+ req and d.update(req)
1250
+ d = apis.ModifyUHostInstanceNameRequestSchema().dumps(d)
1251
+
1252
+ resp = self.invoke("ModifyUHostInstanceName", d, **kwargs)
1253
+ return apis.ModifyUHostInstanceNameResponseSchema().loads(resp)
1254
+
1255
+ def modify_uhost_instance_remark(
1256
+ self, req: typing.Optional[dict] = None, **kwargs
1257
+ ) -> dict:
1258
+ """ModifyUHostInstanceRemark - 修改指定UHost实例备注信息。
1259
+
1260
+ **Request**
1261
+
1262
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1263
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1264
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1265
+ - **Remark** (str) - 备注
1266
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1267
+
1268
+ **Response**
1269
+
1270
+ - **UHostId** (str) - UHost实例ID
1271
+
1272
+ """
1273
+ # build request
1274
+ d = {
1275
+ "ProjectId": self.config.project_id,
1276
+ "Region": self.config.region,
1277
+ }
1278
+ req and d.update(req)
1279
+ d = apis.ModifyUHostInstanceRemarkRequestSchema().dumps(d)
1280
+
1281
+ resp = self.invoke("ModifyUHostInstanceRemark", d, **kwargs)
1282
+ return apis.ModifyUHostInstanceRemarkResponseSchema().loads(resp)
1283
+
1284
+ def modify_uhost_instance_tag(
1285
+ self, req: typing.Optional[dict] = None, **kwargs
1286
+ ) -> dict:
1287
+ """ModifyUHostInstanceTag - 修改指定UHost实例业务组标识。
1288
+
1289
+ **Request**
1290
+
1291
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1292
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1293
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1294
+ - **Tag** (str) - 业务组名称
1295
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1296
+
1297
+ **Response**
1298
+
1299
+ - **UHostId** (str) - UHost实例ID
1300
+
1301
+ """
1302
+ # build request
1303
+ d = {
1304
+ "ProjectId": self.config.project_id,
1305
+ "Region": self.config.region,
1306
+ }
1307
+ req and d.update(req)
1308
+ d = apis.ModifyUHostInstanceTagRequestSchema().dumps(d)
1309
+
1310
+ resp = self.invoke("ModifyUHostInstanceTag", d, **kwargs)
1311
+ return apis.ModifyUHostInstanceTagResponseSchema().loads(resp)
1312
+
1313
+ def poweroff_uhost_instance(
1314
+ self, req: typing.Optional[dict] = None, **kwargs
1315
+ ) -> dict:
1316
+ """PoweroffUHostInstance - 直接关闭UHost实例电源,无需等待实例正常关闭。
1317
+
1318
+ **Request**
1319
+
1320
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1321
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1322
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1323
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1324
+
1325
+ **Response**
1326
+
1327
+ - **UHostId** (str) - UHost的实例ID
1328
+
1329
+ """
1330
+ # build request
1331
+ d = {
1332
+ "ProjectId": self.config.project_id,
1333
+ "Region": self.config.region,
1334
+ }
1335
+ req and d.update(req)
1336
+ d = apis.PoweroffUHostInstanceRequestSchema().dumps(d)
1337
+
1338
+ resp = self.invoke("PoweroffUHostInstance", d, **kwargs)
1339
+ return apis.PoweroffUHostInstanceResponseSchema().loads(resp)
1340
+
1341
+ def reboot_uhost_instance(
1342
+ self, req: typing.Optional[dict] = None, **kwargs
1343
+ ) -> dict:
1344
+ """RebootUHostInstance - 重新启动UHost实例,需要指定数据中心及UHostID两个参数的值。
1345
+
1346
+ **Request**
1347
+
1348
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1349
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1350
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1351
+ - **DiskPassword** (str) - 加密盘密码
1352
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1353
+
1354
+ **Response**
1355
+
1356
+ - **UHostId** (str) - UHost实例ID
1357
+
1358
+ """
1359
+ # build request
1360
+ d = {
1361
+ "ProjectId": self.config.project_id,
1362
+ "Region": self.config.region,
1363
+ }
1364
+ req and d.update(req)
1365
+ d = apis.RebootUHostInstanceRequestSchema().dumps(d)
1366
+
1367
+ resp = self.invoke("RebootUHostInstance", d, **kwargs)
1368
+ return apis.RebootUHostInstanceResponseSchema().loads(resp)
1369
+
1370
+ def reinstall_uhost_instance(
1371
+ self, req: typing.Optional[dict] = None, **kwargs
1372
+ ) -> dict:
1373
+ """ReinstallUHostInstance - 重新安装指定UHost实例的操作系统
1374
+
1375
+ **Request**
1376
+
1377
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1378
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1379
+ - **UHostId** (str) - (Required) UHost实例资源ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1380
+ - **AutoDataDiskInit** (str) - 数据盘是否需要自动分区挂载。当镜像支持Cloud-init Feature时可填写此字段。取值“On”(默认值), “Off”
1381
+ - **BootDiskSpace** (int) - 系统盘大小。 单位:GB, 范围[20,100]。
1382
+ - **HostName** (str) - 操作系统主机名
1383
+ - **ImageId** (str) - 镜像Id,默认使用原镜像 参见 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_
1384
+ - **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
1385
+ - **LoginMode** (str) - 主机登陆模式。密码(默认选项): Password,密钥 KeyPair,自制镜像密码: ImagePasswd。
1386
+ - **Password** (str) - 如果重装UHost实例时LoginMode为Password,则必须填写,如果LoginMode为KeyPair,不需要填写 (密码格式使用BASE64编码;举例如下:# echo -n Password1 | base64UGFzc3dvcmQx。)
1387
+ - **ReserveDisk** (str) - 是否保留数据盘,保留:Yes,不保留:No, 默认:Yes;如果是从Windows重装为Linux或反之,则无法保留数据盘(该参数目前仅对本地数据盘起作用)
1388
+ - **UserData** (str) - cloudinit初始化使用。注意:1、总数据量大小不超多16K 2、使用base64编码
1389
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1390
+
1391
+ **Response**
1392
+
1393
+ - **UHostId** (str) - UHost实例资源ID
1394
+
1395
+ """
1396
+ # build request
1397
+ d = {
1398
+ "ProjectId": self.config.project_id,
1399
+ "Region": self.config.region,
1400
+ }
1401
+ req and d.update(req)
1402
+ d = apis.ReinstallUHostInstanceRequestSchema().dumps(d)
1403
+
1404
+ resp = self.invoke("ReinstallUHostInstance", d, **kwargs)
1405
+ return apis.ReinstallUHostInstanceResponseSchema().loads(resp)
1406
+
1407
+ def reset_uhost_instance_password(
1408
+ self, req: typing.Optional[dict] = None, **kwargs
1409
+ ) -> dict:
1410
+ """ResetUHostInstancePassword - 重置UHost实例的管理员密码。
1411
+
1412
+ **Request**
1413
+
1414
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1415
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1416
+ - **UHostId** (str) - (Required) UHost实例ID
1417
+ - **AutoStart** (bool) - 修改密码结束后是否立即开机,默认为false, 如果设置为true,则修改密码成功后立即开机; 抢占式和后付费云主机暂不支持当前功能;
1418
+ - **KeyPairId** (str) - KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
1419
+ - **LoginMode** (str) - 主机登陆模式。密码(默认选项): Password,密钥 KeyPair。
1420
+ - **Password** (str) - UHost新密码(密码格式使用BASE64编码)
1421
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1422
+
1423
+ **Response**
1424
+
1425
+ - **UHostId** (str) - UHost实例ID
1426
+
1427
+ """
1428
+ # build request
1429
+ d = {
1430
+ "ProjectId": self.config.project_id,
1431
+ "Region": self.config.region,
1432
+ }
1433
+ req and d.update(req)
1434
+ d = apis.ResetUHostInstancePasswordRequestSchema().dumps(d)
1435
+
1436
+ resp = self.invoke("ResetUHostInstancePassword", d, **kwargs)
1437
+ return apis.ResetUHostInstancePasswordResponseSchema().loads(resp)
1438
+
1439
+ def resize_attached_disk(
1440
+ self, req: typing.Optional[dict] = None, **kwargs
1441
+ ) -> dict:
1442
+ """ResizeAttachedDisk - 修改挂载的磁盘大小,包含系统盘和数据盘
1443
+
1444
+ **Request**
1445
+
1446
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1447
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1448
+ - **DiskId** (str) - (Required) 磁盘ID。参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_ 返回值中的DiskSet。
1449
+ - **DiskSpace** (int) - (Required) 磁盘大小,单位GB,步长为10。取值范围需大于当前磁盘大小,最大值请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。
1450
+ - **UHostId** (str) - (Required) UHost实例ID。 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_ 。
1451
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1452
+ - **DryRun** (bool) - 用于测试磁盘是否支持在线扩容。DryRun=true,不会执行实际操作,只会返回操作的预期结果。DryRun = false ,正常执行扩容操作。
1453
+
1454
+ **Response**
1455
+
1456
+ - **DiskId** (str) - 改配成功的磁盘id
1457
+ - **NeedRestart** (bool) - 扩容后的状态。NeedRestart = true,必须关闭后启动实例才能使用扩容的磁盘空间。NeedRestart = false,磁盘扩容后无需重启操作。
1458
+
1459
+ """
1460
+ # build request
1461
+ d = {
1462
+ "ProjectId": self.config.project_id,
1463
+ "Region": self.config.region,
1464
+ }
1465
+ req and d.update(req)
1466
+ d = apis.ResizeAttachedDiskRequestSchema().dumps(d)
1467
+
1468
+ resp = self.invoke("ResizeAttachedDisk", d, **kwargs)
1469
+ return apis.ResizeAttachedDiskResponseSchema().loads(resp)
1470
+
1471
+ def resize_uhost_instance(
1472
+ self, req: typing.Optional[dict] = None, **kwargs
1473
+ ) -> dict:
1474
+ """ResizeUHostInstance - 修改指定UHost实例的资源配置,如CPU核心数,内存容量大小,网络增强等。可选配置范围请参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type>`_ 。
1475
+
1476
+ **Request**
1477
+
1478
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1479
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1480
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1481
+ - **AutoStart** (bool) - 扩容结束后是否立即开机,默认为false,如果设置为true,则扩容成功后立即开机;抢占式和后付费云主机暂不支持当前功能;
1482
+ - **CPU** (int) - 虚拟CPU核数。可选参数:1-240(可选范围与UHostType相关)。默认值为当前实例的CPU核数
1483
+ - **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
1484
+ - **Memory** (int) - 内存大小。单位:MB。范围 :[1024, 1966080],取值为1024的倍数(可选范围与UHostType相关)。默认值为当前实例的内存大小。
1485
+ - **NetCapValue** (int) - 网卡升降级(1,表示升级,2表示降级,0表示不变)
1486
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1487
+
1488
+ **Response**
1489
+
1490
+ - **UHostId** (str) - UHost实例ID
1491
+
1492
+ """
1493
+ # build request
1494
+ d = {
1495
+ "ProjectId": self.config.project_id,
1496
+ "Region": self.config.region,
1497
+ }
1498
+ req and d.update(req)
1499
+ d = apis.ResizeUHostInstanceRequestSchema().dumps(d)
1500
+
1501
+ resp = self.invoke("ResizeUHostInstance", d, **kwargs)
1502
+ return apis.ResizeUHostInstanceResponseSchema().loads(resp)
1503
+
1504
+ def start_uhost_instance(
1505
+ self, req: typing.Optional[dict] = None, **kwargs
1506
+ ) -> dict:
1507
+ """StartUHostInstance - 启动处于关闭状态的UHost实例,需要指定数据中心及UHostID两个参数的值。
1508
+
1509
+ **Request**
1510
+
1511
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1512
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1513
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1514
+ - **DiskPassword** (str) - 加密盘密码
1515
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1516
+
1517
+ **Response**
1518
+
1519
+ - **UHostId** (str) - UHost实例ID
1520
+
1521
+ """
1522
+ # build request
1523
+ d = {
1524
+ "ProjectId": self.config.project_id,
1525
+ "Region": self.config.region,
1526
+ }
1527
+ req and d.update(req)
1528
+ d = apis.StartUHostInstanceRequestSchema().dumps(d)
1529
+
1530
+ resp = self.invoke("StartUHostInstance", d, **kwargs)
1531
+ return apis.StartUHostInstanceResponseSchema().loads(resp)
1532
+
1533
+ def stop_uhost_instance(
1534
+ self, req: typing.Optional[dict] = None, **kwargs
1535
+ ) -> dict:
1536
+ """StopUHostInstance - 指停止处于运行状态的UHost实例,需指定数据中心及UhostID。
1537
+
1538
+ **Request**
1539
+
1540
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1541
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1542
+ - **UHostId** (str) - (Required) UHost实例ID 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1543
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1544
+
1545
+ **Response**
1546
+
1547
+ - **UHostId** (str) - UHost实例ID
1548
+
1549
+ """
1550
+ # build request
1551
+ d = {
1552
+ "ProjectId": self.config.project_id,
1553
+ "Region": self.config.region,
1554
+ }
1555
+ req and d.update(req)
1556
+ d = apis.StopUHostInstanceRequestSchema().dumps(d)
1557
+
1558
+ resp = self.invoke("StopUHostInstance", d, **kwargs)
1559
+ return apis.StopUHostInstanceResponseSchema().loads(resp)
1560
+
1561
+ def terminate_custom_image(
1562
+ self, req: typing.Optional[dict] = None, **kwargs
1563
+ ) -> dict:
1564
+ """TerminateCustomImage - 删除用户自定义镜像
1565
+
1566
+ **Request**
1567
+
1568
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1569
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1570
+ - **ImageId** (str) - (Required) 自制镜像ID 参见 `DescribeImage <https://docs.ucloud.cn/api/uhost-api/describe_image.html>`_
1571
+
1572
+ **Response**
1573
+
1574
+ - **ImageId** (str) - 自制镜像Id
1575
+
1576
+ """
1577
+ # build request
1578
+ d = {
1579
+ "ProjectId": self.config.project_id,
1580
+ "Region": self.config.region,
1581
+ }
1582
+ req and d.update(req)
1583
+ d = apis.TerminateCustomImageRequestSchema().dumps(d)
1584
+
1585
+ resp = self.invoke("TerminateCustomImage", d, **kwargs)
1586
+ return apis.TerminateCustomImageResponseSchema().loads(resp)
1587
+
1588
+ def terminate_uhost_instance(
1589
+ self, req: typing.Optional[dict] = None, **kwargs
1590
+ ) -> dict:
1591
+ """TerminateUHostInstance - 删除指定数据中心的UHost实例。
1592
+
1593
+ **Request**
1594
+
1595
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
1596
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1597
+ - **UHostId** (str) - (Required) UHost资源Id 参见 `DescribeUHostInstance <https://docs.ucloud.cn/api/uhost-api/describe_uhost_instance.html>`_
1598
+ - **ReleaseEIP** (bool) - 删除主机时是否释放绑定的EIP。默认为false。
1599
+ - **ReleaseUDisk** (bool) - 删除主机时是否同时删除挂载的数据盘。默认为false。
1600
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
1601
+
1602
+ **Response**
1603
+
1604
+ - **InRecycle** (str) - 用于判断主机删除时是否进入回收站。放入回收站:"Yes", 彻底删除:“No”。
1605
+ - **UHostId** (str) - UHost 实例 Id
1606
+
1607
+ """
1608
+ # build request
1609
+ d = {
1610
+ "ProjectId": self.config.project_id,
1611
+ "Region": self.config.region,
1612
+ }
1613
+ req and d.update(req)
1614
+ d = apis.TerminateUHostInstanceRequestSchema().dumps(d)
1615
+
1616
+ resp = self.invoke("TerminateUHostInstance", d, **kwargs)
1617
+ return apis.TerminateUHostInstanceResponseSchema().loads(resp)
1618
+
1619
+ def upgrade_to_ark_uhost_instance(
1620
+ self, req: typing.Optional[dict] = None, **kwargs
1621
+ ) -> dict:
1622
+ """UpgradeToArkUHostInstance -
1623
+
1624
+ **Request**
1625
+
1626
+ - **Region** (str) - (Config)
1627
+ - **Zone** (str) - (Required)
1628
+ - **CouponId** (str) -
1629
+ - **UHostIds** (list) -
1630
+
1631
+ **Response**
1632
+
1633
+ - **UHostSet** (list) -
1634
+
1635
+ """
1636
+ # build request
1637
+ d = {
1638
+ "Region": self.config.region,
1639
+ }
1640
+ req and d.update(req)
1641
+ d = apis.UpgradeToArkUHostInstanceRequestSchema().dumps(d)
1642
+
1643
+ # build options
1644
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
1645
+
1646
+ resp = self.invoke("UpgradeToArkUHostInstance", d, **kwargs)
1647
+ return apis.UpgradeToArkUHostInstanceResponseSchema().loads(resp)