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,847 @@
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.uphost.schemas import apis
8
+
9
+
10
+ class UPHostClient(Client):
11
+ def __init__(
12
+ self, config: dict, transport=None, middleware=None, logger=None
13
+ ):
14
+ super(UPHostClient, self).__init__(
15
+ config, transport, middleware, logger
16
+ )
17
+
18
+ def create_phost(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
19
+ """CreatePHost - 指定数据中心,根据资源使用量创建指定数量的UPHost物理云主机实例。
20
+
21
+ **Request**
22
+
23
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
24
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
25
+ - **ImageId** (str) - (Required) ImageId,可以通过接口 `DescribePHostImage <https://docs.ucloud.cn/api/uphost-api/api/uphost-api/describe_phost_image.html>`_ 获取
26
+ - **Password** (str) - (Required) 密码(密码需使用base64进行编码)
27
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
28
+ - **ActivityId** (int) - 短期促销活动时所需参数
29
+ - **CharacterName** (str) - 授权角色名, K8S专用,其他用户忽略
30
+ - **ChargeType** (str) - 计费模式,枚举值为:Year, 按年付费; Month,按月付费;默认按月付费
31
+ - **Cluster** (str) - 网络环境,可选千兆:1G ,万兆:10G, 默认1G。智能网卡可以选择25G。
32
+ - **CouponId** (str) - 代金券
33
+ - **Disks** (list) - 见 **CreatePHostParamDisks** 模型定义
34
+ - **Name** (str) - 物理机名称,默认为phost
35
+ - **NetworkInterface** (list) - 见 **CreatePHostParamNetworkInterface** 模型定义
36
+ - **Quantity** (str) - 购买时长,1-10个月或1-10年;默认值为1。月付时,此参数传0,代表购买至月末,1代表整月。
37
+ - **Raid** (str) - 本地盘和裸金属1.0需要的参数。Raid配置,默认Raid10 支持:Raid0、Raid1、Raid5、Raid10,NoRaid
38
+ - **Remark** (str) - 物理机备注,默认为空
39
+ - **RuleId** (int) - 短期促销活动时所需参数
40
+ - **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall <https://docs.ucloud.cn/api/uphost-api/api/unet-api/describe_firewall.html>`_ 。
41
+ - **SubnetId** (str) - 子网ID,不填为默认,VPC2.0下需要填写此字段。
42
+ - **Tag** (str) - 业务组,默认为default
43
+ - **Type** (str) - 物理机类型,默认为:db-2(基础型-SAS-V3)
44
+ - **VPCId** (str) - VPC ID,不填为默认,VPC2.0下需要填写此字段。
45
+ - **VpcIp** (str) - 指定内网ip创建
46
+
47
+ **Response**
48
+
49
+ - **PHostId** (list) - PHost的资源ID数组
50
+
51
+ **Request Model**
52
+
53
+ **CreatePHostParamDisks**
54
+ - **CouponId** (str) - 裸金属机型参数->云盘代金券id。不适用于系统盘。请通过DescribeCoupon接口查询,或登录用户中心查看
55
+ - **IsBoot** (str) - 裸金属机型参数->是否是系统盘。枚举值: True,是系统盘。 False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
56
+ - **Size** (int) - 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
57
+ - **Type** (str) - 裸金属机型参数->磁盘类型:枚举值:CLOUD_RSSD
58
+
59
+
60
+ **CreatePHostParamNetworkInterfaceEIP**
61
+ - **Bandwidth** (str) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式必须指定0M带宽, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
62
+ - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
63
+ - **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
64
+ - **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
65
+ - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
66
+
67
+
68
+ **CreatePHostParamNetworkInterface**
69
+ - **EIP** (dict) - 见 **CreatePHostParamNetworkInterfaceEIP** 模型定义
70
+
71
+
72
+ """
73
+ # build request
74
+ d = {
75
+ "ProjectId": self.config.project_id,
76
+ "Region": self.config.region,
77
+ }
78
+ req and d.update(req)
79
+ d = apis.CreatePHostRequestSchema().dumps(d)
80
+
81
+ # build options
82
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
83
+
84
+ resp = self.invoke("CreatePHost", d, **kwargs)
85
+ return apis.CreatePHostResponseSchema().loads(resp)
86
+
87
+ def create_phost_image(
88
+ self, req: typing.Optional[dict] = None, **kwargs
89
+ ) -> dict:
90
+ """CreatePHostImage - 创建裸金属2.0用户自定义镜像
91
+
92
+ **Request**
93
+
94
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
95
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
96
+ - **ImageName** (str) - (Required) 镜像名称
97
+ - **PHostId** (str) - (Required) UPHost实例ID
98
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
99
+ - **ImageDescription** (str) - 镜像描述
100
+
101
+ **Response**
102
+
103
+ - **ImageId** (str) - 镜像ID
104
+
105
+ """
106
+ # build request
107
+ d = {
108
+ "ProjectId": self.config.project_id,
109
+ "Region": self.config.region,
110
+ }
111
+ req and d.update(req)
112
+ d = apis.CreatePHostImageRequestSchema().dumps(d)
113
+
114
+ # build options
115
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
116
+
117
+ resp = self.invoke("CreatePHostImage", d, **kwargs)
118
+ return apis.CreatePHostImageResponseSchema().loads(resp)
119
+
120
+ def describe_baremetal_machine_type(
121
+ self, req: typing.Optional[dict] = None, **kwargs
122
+ ) -> dict:
123
+ """DescribeBaremetalMachineType - 获取裸金属机型的详细描述信息
124
+
125
+ **Request**
126
+
127
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
128
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
129
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
130
+ - **Type** (str) - 具体机型。若不填写,则返回全部机型
131
+
132
+ **Response**
133
+
134
+ - **MachineTypes** (list) - 见 **PHostCloudMachineTypeSet** 模型定义
135
+
136
+ **Response Model**
137
+
138
+ **PHostCloudMachineTypeSet**
139
+ - **CPU** (dict) - 见 **PHostCPUSet** 模型定义
140
+ - **Clusters** (list) - 见 **PHostClusterSet** 模型定义
141
+ - **Components** (dict) - 见 **PHostComponentSet** 模型定义
142
+ - **Memory** (int) - 内存大小,单位MB
143
+ - **Type** (str) - 物理云主机机型别名,全网唯一。
144
+
145
+
146
+ **PHostCPUSet**
147
+ - **CoreCount** (int) - CPU核数
148
+ - **Count** (int) - CPU个数
149
+ - **Frequence** (float) - CPU主频
150
+ - **Model** (str) - CPU型号
151
+
152
+
153
+ **PHostClusterSet**
154
+ - **Name** (str) - 集群名。枚举值:千兆网络集群:1G;万兆网络集群:10G;智能网卡网络:25G;
155
+ - **StockStatus** (str) - 库存状态。枚举值:有库存:Available;无库存:SoldOut
156
+
157
+
158
+ **PHostComponentSet**
159
+ - **Count** (int) - 组件数量
160
+ - **Name** (str) - 组件名称
161
+
162
+
163
+ """
164
+ # build request
165
+ d = {
166
+ "ProjectId": self.config.project_id,
167
+ "Region": self.config.region,
168
+ }
169
+ req and d.update(req)
170
+ d = apis.DescribeBaremetalMachineTypeRequestSchema().dumps(d)
171
+
172
+ resp = self.invoke("DescribeBaremetalMachineType", d, **kwargs)
173
+ return apis.DescribeBaremetalMachineTypeResponseSchema().loads(resp)
174
+
175
+ def describe_phost(
176
+ self, req: typing.Optional[dict] = None, **kwargs
177
+ ) -> dict:
178
+ """DescribePHost - 获取物理机详细信息
179
+
180
+ **Request**
181
+
182
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
183
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
184
+ - **Limit** (int) - 返回数据长度,默认为20
185
+ - **Offset** (int) - 数据偏移量,默认为0
186
+ - **PHostId** (list) - PHost资源ID,若为空,则返回当前Region所有PHost。
187
+ - **UDiskIdForAttachment** (str) - 要挂载的云盘id,过滤返回能被UDiskId挂载的云主机。目前主要针对rssd云盘使用
188
+ - **VPCId** (str) - ULB使用参数,获取同VPC下机器信息。
189
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
190
+
191
+ **Response**
192
+
193
+ - **PHostSet** (list) - 见 **PHostSet** 模型定义
194
+ - **TotalCount** (int) - 满足条件的PHost总数
195
+
196
+ **Response Model**
197
+
198
+ **PHostSet**
199
+ - **AutoRenew** (str) - 自动续费
200
+ - **BootDiskState** (str) - 裸金属机型字段。枚举值:Normal=>正常、ImageMaking=>镜像制作中。
201
+ - **CPUSet** (dict) - 见 **PHostCPUSet** 模型定义
202
+ - **ChargeType** (str) - 计费模式,枚举值为: Year,按年付费; Month,按月付费;默认为月付
203
+ - **Cluster** (str) - 网络环境。枚举值:千兆:1G ,万兆:10G
204
+ - **Components** (str) - 组件信息(暂不支持)
205
+ - **CreateTime** (int) - 创建时间
206
+ - **DiskSet** (list) - 见 **PHostDescDiskSet** 模型定义
207
+ - **ExpireTime** (int) - 到期时间
208
+ - **IPSet** (list) - 见 **PHostIPSet** 模型定义
209
+ - **ImageName** (str) - 镜像名称
210
+ - **IsSupportKVM** (str) - 是否支持紧急登录
211
+ - **Memory** (int) - 内存大小,单位:MB
212
+ - **Name** (str) - 物理机名称
213
+ - **OSType** (str) - 操作系统类型
214
+ - **OSname** (str) - 操作系统名称
215
+ - **PHostId** (str) - PHost资源ID
216
+ - **PHostType** (str) - 物理机类型,参见DescribePHostMachineType返回值
217
+ - **PMStatus** (str) - 物理云主机状态。枚举值:\\ > 初始化:Initializing; \\ > 启动中:Starting; \\ > 运行中:Running;\\ > 关机中:Stopping; \\ > 安装失败:InstallFailed; \\ > 重启中:Rebooting;\\ > 关机:Stopped; \\ > 迁移中(裸金属云盘):Migrating
218
+ - **PhostClass** (str) - 物理云产品类型,枚举值:LocalDisk=>代表传统本地盘机型, CloudDisk=>云盘裸金属机型
219
+ - **PowerState** (str) - 电源状态,on 或 off
220
+ - **RaidSupported** (str) - 是否支持Raid。枚举值:Yes:支持;No:不支持。
221
+ - **RdmaClusterId** (str) - RDMA集群id,仅云盘裸金属返回该值;其他类型物理云主机返回""。当物理机的此值与RSSD云盘的RdmaClusterId相同时,RSSD可以挂载到这台物理机。
222
+ - **Remark** (str) - 物理机备注
223
+ - **SN** (str) - 物理机序列号
224
+ - **Tag** (str) - 业务组
225
+ - **Zone** (str) - 可用区,参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
226
+
227
+
228
+ **PHostCPUSet**
229
+ - **CoreCount** (int) - CPU核数
230
+ - **Count** (int) - CPU个数
231
+ - **Frequence** (float) - CPU主频
232
+ - **Model** (str) - CPU型号
233
+
234
+
235
+ **PHostDescDiskSet**
236
+ - **Count** (int) - 磁盘数量
237
+ - **DiskId** (str) - 裸金属机型参数:磁盘ID
238
+ - **Drive** (str) - 裸金属机型参数:磁盘盘符
239
+ - **IOCap** (int) - 磁盘IO性能,单位MB/s(待废弃)
240
+ - **IsBoot** (str) - 裸金属机型参数:是否是启动盘。True/False
241
+ - **Name** (str) - 磁盘名称,sys/data
242
+ - **Space** (int) - 单盘大小,单位GB
243
+ - **Type** (str) - 磁盘属性
244
+
245
+
246
+ **PHostIPSet**
247
+ - **Bandwidth** (int) - IP对应带宽,单位Mb,内网IP不显示带宽信息
248
+ - **IPAddr** (str) - IP地址,
249
+ - **IPId** (str) - IP资源ID(内网IP无资源ID)(待废弃)
250
+ - **MACAddr** (str) - MAC地址
251
+ - **OperatorName** (str) - 国际: Internation, BGP: BGP, 内网: Private
252
+ - **SubnetId** (str) - 子网ID
253
+ - **VPCId** (str) - VPC ID
254
+
255
+
256
+ """
257
+ # build request
258
+ d = {
259
+ "ProjectId": self.config.project_id,
260
+ "Region": self.config.region,
261
+ }
262
+ req and d.update(req)
263
+ d = apis.DescribePHostRequestSchema().dumps(d)
264
+
265
+ resp = self.invoke("DescribePHost", d, **kwargs)
266
+ return apis.DescribePHostResponseSchema().loads(resp)
267
+
268
+ def describe_phost_image(
269
+ self, req: typing.Optional[dict] = None, **kwargs
270
+ ) -> dict:
271
+ """DescribePHostImage - 获取物理云主机镜像列表
272
+
273
+ **Request**
274
+
275
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
276
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
277
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
278
+ - **ImageId** (list) - 镜像ID
279
+ - **ImageType** (str) - 镜像类别,枚举值,Base是基础镜像;Custom是自制镜像。
280
+ - **Limit** (int) - 返回数据长度,默认为20
281
+ - **MachineType** (str) - 机器型号,只支持当前zone的展示机型
282
+ - **Offset** (int) - 数据偏移量,默认为0
283
+
284
+ **Response**
285
+
286
+ - **ImageSet** (list) - 见 **PHostImageSet** 模型定义
287
+ - **TotalCount** (int) - 满足条件的镜像总数
288
+
289
+ **Response Model**
290
+
291
+ **PHostImageSet**
292
+ - **CreateTime** (int) - 裸金属2.0参数。镜像创建时间。
293
+ - **ImageDescription** (str) - 镜像描述
294
+ - **ImageId** (str) - 镜像ID
295
+ - **ImageName** (str) - 镜像名称
296
+ - **ImageSize** (int) - 裸金属2.0参数。镜像大小。
297
+ - **ImageType** (str) - 枚举值:Base=>基础镜像,Custom=>自制镜像。
298
+ - **OsName** (str) - 操作系统名称
299
+ - **OsType** (str) - 操作系统类型
300
+ - **State** (str) - 裸金属2.0参数。镜像当前状态。
301
+ - **Support** (list) - 支持的机型
302
+ - **Version** (str) - 当前版本
303
+
304
+
305
+ """
306
+ # build request
307
+ d = {
308
+ "ProjectId": self.config.project_id,
309
+ "Region": self.config.region,
310
+ }
311
+ req and d.update(req)
312
+ d = apis.DescribePHostImageRequestSchema().dumps(d)
313
+
314
+ resp = self.invoke("DescribePHostImage", d, **kwargs)
315
+ return apis.DescribePHostImageResponseSchema().loads(resp)
316
+
317
+ def describe_phost_machine_type(
318
+ self, req: typing.Optional[dict] = None, **kwargs
319
+ ) -> dict:
320
+ """DescribePHostMachineType - 获取物理云机型的详细描述信息
321
+
322
+ **Request**
323
+
324
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
325
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
326
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
327
+ - **Type** (str) - 具体机型。若不填写,则返回全部机型
328
+
329
+ **Response**
330
+
331
+ - **MachineTypes** (list) - 见 **PHostMachineTypeSet** 模型定义
332
+
333
+ **Response Model**
334
+
335
+ **PHostMachineTypeSet**
336
+ - **CPU** (dict) - 见 **PHostCPUSet** 模型定义
337
+ - **Clusters** (list) - 见 **PHostClusterSet** 模型定义
338
+ - **Components** (dict) - 见 **PHostComponentSet** 模型定义
339
+ - **Disks** (list) - 见 **PHostDiskSet** 模型定义
340
+ - **Memory** (int) - 内存大小,单位MB
341
+ - **RaidSupported** (str) - 是否支持Raid。枚举值:支持:YES;不支持:NO
342
+ - **Type** (str) - 物理云主机机型别名,全网唯一。
343
+
344
+
345
+ **PHostCPUSet**
346
+ - **CoreCount** (int) - CPU核数
347
+ - **Count** (int) - CPU个数
348
+ - **Frequence** (float) - CPU主频
349
+ - **Model** (str) - CPU型号
350
+
351
+
352
+ **PHostClusterSet**
353
+ - **Name** (str) - 集群名。枚举值:千兆网络集群:1G;万兆网络集群:10G;智能网卡网络:25G;
354
+ - **StockStatus** (str) - 库存状态。枚举值:有库存:Available;无库存:SoldOut
355
+
356
+
357
+ **PHostComponentSet**
358
+ - **Count** (int) - 组件数量
359
+ - **Name** (str) - 组件名称
360
+
361
+
362
+ **PHostDiskSet**
363
+ - **Count** (int) - 磁盘数量
364
+ - **IOCap** (int) - 磁盘IO性能,单位MB/s(待废弃)
365
+ - **Name** (str) - 磁盘名称,sys/data
366
+ - **Space** (int) - 单盘大小,单位GB
367
+ - **Type** (str) - 磁盘属性
368
+
369
+
370
+ """
371
+ # build request
372
+ d = {
373
+ "ProjectId": self.config.project_id,
374
+ "Region": self.config.region,
375
+ }
376
+ req and d.update(req)
377
+ d = apis.DescribePHostMachineTypeRequestSchema().dumps(d)
378
+
379
+ resp = self.invoke("DescribePHostMachineType", d, **kwargs)
380
+ return apis.DescribePHostMachineTypeResponseSchema().loads(resp)
381
+
382
+ def describe_phost_tags(
383
+ self, req: typing.Optional[dict] = None, **kwargs
384
+ ) -> dict:
385
+ """DescribePHostTags - 获取物理机tag列表(业务组)
386
+
387
+ **Request**
388
+
389
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
390
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
391
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
392
+
393
+ **Response**
394
+
395
+ - **TagSet** (list) - 见 **PHostTagSet** 模型定义
396
+ - **TotalCount** (int) - Tag的个数
397
+
398
+ **Response Model**
399
+
400
+ **PHostTagSet**
401
+ - **Tag** (str) - 业务组名称
402
+ - **TotalCount** (int) - 该业务组中包含的主机个数
403
+
404
+
405
+ """
406
+ # build request
407
+ d = {
408
+ "ProjectId": self.config.project_id,
409
+ "Region": self.config.region,
410
+ }
411
+ req and d.update(req)
412
+ d = apis.DescribePHostTagsRequestSchema().dumps(d)
413
+
414
+ resp = self.invoke("DescribePHostTags", d, **kwargs)
415
+ return apis.DescribePHostTagsResponseSchema().loads(resp)
416
+
417
+ def get_phost_disk_upgrade_price(
418
+ self, req: typing.Optional[dict] = None, **kwargs
419
+ ) -> dict:
420
+ """GetPHostDiskUpgradePrice - 获取物理云裸金属挂载磁盘的升级价格
421
+
422
+ **Request**
423
+
424
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
425
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
426
+ - **DiskSpace** (int) - (Required) 磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
427
+ - **PHostId** (str) - (Required) UPHost实例ID。
428
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
429
+ - **ReinstallTag** (bool) - 是否重装价格获取。复用此接口。扩容只能增加云盘大小。重装不限制。枚举值:true/false
430
+ - **UDiskId** (str) - 磁盘 ID。获取扩容价格必填(只能扩不能减);重装时候不需要填(根据所选盘大小决定)
431
+
432
+ **Response**
433
+
434
+ - **OriginalPrice** (float) - 升价差价原价。精度为小数点后2位。
435
+ - **Price** (float) - 升级差价。精度为小数点后2位。
436
+
437
+ """
438
+ # build request
439
+ d = {
440
+ "ProjectId": self.config.project_id,
441
+ "Region": self.config.region,
442
+ }
443
+ req and d.update(req)
444
+ d = apis.GetPHostDiskUpgradePriceRequestSchema().dumps(d)
445
+
446
+ resp = self.invoke("GetPHostDiskUpgradePrice", d, **kwargs)
447
+ return apis.GetPHostDiskUpgradePriceResponseSchema().loads(resp)
448
+
449
+ def get_phost_price(
450
+ self, req: typing.Optional[dict] = None, **kwargs
451
+ ) -> dict:
452
+ """GetPHostPrice - 获取物理机价格列表
453
+
454
+ **Request**
455
+
456
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
457
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
458
+ - **ChargeType** (str) - (Required) 计费模式,枚举值为: Year/Month
459
+ - **Count** (int) - (Required) 购买数量,范围[1-5]
460
+ - **Quantity** (int) - (Required) 购买时长,1-10个月或1-10年;默认值为1。月付时,此参数传0,代表购买至月末,1代表整月。
461
+ - **Cluster** (str) - 网络环境,可选千兆:1G ;万兆:10G;25G网络:25G。
462
+ - **Disks** (list) - 见 **GetPHostPriceParamDisks** 模型定义
463
+ - **Type** (str) - 默认为:DB(数据库型),可以通过接口 `DescribePHostMachineType <https://docs.ucloud.cn/api/uphost-api/api/uphost-api/describe_phost_machine_type.html>`_ 获取
464
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
465
+
466
+ **Response**
467
+
468
+ - **PriceSet** (list) - 见 **PHostPriceSet** 模型定义
469
+
470
+ **Request Model**
471
+
472
+ **GetPHostPriceParamDisks**
473
+ - **IsBoot** (str) - 裸金属机型参数->枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
474
+ - **Size** (str) - 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB。数据盘是20-32000G。
475
+ - **Type** (str) - 裸金属机型参数->磁盘类型:枚举值:CLOUD_RSSD
476
+
477
+
478
+ **Response Model**
479
+
480
+ **PHostPriceSet**
481
+ - **ChargeType** (str) - Year/Month
482
+ - **OriginalPrice** (float) - 原价格, 单位:元, 保留小数点后两位有效数字
483
+ - **Price** (float) - 价格, 单位:元, 保留小数点后两位有效数字
484
+ - **Product** (str) - 枚举值:phost=>为主机价格,如果是云盘包括了系统盘价格。cloudDisk=>所有数据盘价格,只是裸金属机型才返回此参数。
485
+
486
+
487
+ """
488
+ # build request
489
+ d = {
490
+ "ProjectId": self.config.project_id,
491
+ "Region": self.config.region,
492
+ }
493
+ req and d.update(req)
494
+ d = apis.GetPHostPriceRequestSchema().dumps(d)
495
+
496
+ resp = self.invoke("GetPHostPrice", d, **kwargs)
497
+ return apis.GetPHostPriceResponseSchema().loads(resp)
498
+
499
+ def get_phost_disk_upgrade_price(
500
+ self, req: typing.Optional[dict] = None, **kwargs
501
+ ) -> dict:
502
+ """GetPhostDiskUpgradePrice - 获取物理云裸金属挂载磁盘的升级价格
503
+
504
+ **Request**
505
+
506
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
507
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
508
+ - **DiskId** (str) - (Required) 磁盘ID。
509
+ - **DiskSpace** (int) - (Required) 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
510
+ - **PHostId** (str) - (Required) UPHost实例ID。
511
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
512
+
513
+ **Response**
514
+
515
+ - **Price** (float) - 升级差价。精度为小数点后2位。
516
+
517
+ """
518
+ # build request
519
+ d = {
520
+ "ProjectId": self.config.project_id,
521
+ "Region": self.config.region,
522
+ }
523
+ req and d.update(req)
524
+ d = apis.GetPhostDiskUpgradePriceRequestSchema().dumps(d)
525
+
526
+ resp = self.invoke("GetPhostDiskUpgradePrice", d, **kwargs)
527
+ return apis.GetPhostDiskUpgradePriceResponseSchema().loads(resp)
528
+
529
+ def modify_phost_image_info(
530
+ self, req: typing.Optional[dict] = None, **kwargs
531
+ ) -> dict:
532
+ """ModifyPHostImageInfo - 修改自定义镜像名称和备注
533
+
534
+ **Request**
535
+
536
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
537
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
538
+ - **ImageId** (str) - (Required) 镜像ID
539
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
540
+ - **Name** (str) - 镜像名称
541
+ - **Remark** (str) - 备注
542
+
543
+ **Response**
544
+
545
+ - **ImageId** (str) - 镜像ID
546
+
547
+ """
548
+ # build request
549
+ d = {
550
+ "ProjectId": self.config.project_id,
551
+ "Region": self.config.region,
552
+ }
553
+ req and d.update(req)
554
+ d = apis.ModifyPHostImageInfoRequestSchema().dumps(d)
555
+
556
+ resp = self.invoke("ModifyPHostImageInfo", d, **kwargs)
557
+ return apis.ModifyPHostImageInfoResponseSchema().loads(resp)
558
+
559
+ def modify_phost_info(
560
+ self, req: typing.Optional[dict] = None, **kwargs
561
+ ) -> dict:
562
+ """ModifyPHostInfo - 更改物理机信息
563
+
564
+ **Request**
565
+
566
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
567
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
568
+ - **PHostId** (str) - (Required) 物理机资源ID
569
+ - **Name** (str) - 物理机名称,默认不更改
570
+ - **Remark** (str) - 物理机备注,默认不更改
571
+ - **Tag** (str) - 业务组,默认不更改
572
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
573
+
574
+ **Response**
575
+
576
+ - **PHostId** (str) - PHost 的资源ID
577
+
578
+ """
579
+ # build request
580
+ d = {
581
+ "ProjectId": self.config.project_id,
582
+ "Region": self.config.region,
583
+ }
584
+ req and d.update(req)
585
+ d = apis.ModifyPHostInfoRequestSchema().dumps(d)
586
+
587
+ resp = self.invoke("ModifyPHostInfo", d, **kwargs)
588
+ return apis.ModifyPHostInfoResponseSchema().loads(resp)
589
+
590
+ def poweroff_phost(
591
+ self, req: typing.Optional[dict] = None, **kwargs
592
+ ) -> dict:
593
+ """PoweroffPHost - 断电物理云主机
594
+
595
+ **Request**
596
+
597
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
598
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
599
+ - **PHostId** (str) - (Required) PHost资源ID
600
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
601
+
602
+ **Response**
603
+
604
+ - **PHostId** (str) - PHost 的资源ID
605
+
606
+ """
607
+ # build request
608
+ d = {
609
+ "ProjectId": self.config.project_id,
610
+ "Region": self.config.region,
611
+ }
612
+ req and d.update(req)
613
+ d = apis.PoweroffPHostRequestSchema().dumps(d)
614
+
615
+ resp = self.invoke("PoweroffPHost", d, **kwargs)
616
+ return apis.PoweroffPHostResponseSchema().loads(resp)
617
+
618
+ def reboot_phost(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
619
+ """RebootPHost - 重启物理机
620
+
621
+ **Request**
622
+
623
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
624
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
625
+ - **PHostId** (str) - (Required) PHost资源ID
626
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
627
+
628
+ **Response**
629
+
630
+ - **PHostId** (str) - PHost 的资源ID
631
+
632
+ """
633
+ # build request
634
+ d = {
635
+ "ProjectId": self.config.project_id,
636
+ "Region": self.config.region,
637
+ }
638
+ req and d.update(req)
639
+ d = apis.RebootPHostRequestSchema().dumps(d)
640
+
641
+ resp = self.invoke("RebootPHost", d, **kwargs)
642
+ return apis.RebootPHostResponseSchema().loads(resp)
643
+
644
+ def reinstall_phost(
645
+ self, req: typing.Optional[dict] = None, **kwargs
646
+ ) -> dict:
647
+ """ReinstallPHost - 重装物理机操作系统
648
+
649
+ **Request**
650
+
651
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
652
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
653
+ - **PHostId** (str) - (Required) PHost资源ID
654
+ - **Password** (str) - (Required) 密码
655
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
656
+ - **BootDiskSpace** (int) - 裸金属机型参数->系统盘大小。 单位:GB, 范围[20,500], 步长:10
657
+ - **ImageId** (str) - 镜像Id,参考镜像列表,默认使用原镜像
658
+ - **Name** (str) - 物理机名称,默认不更改
659
+ - **Raid** (str) - 不保留数据盘重装,可选Raid
660
+ - **Remark** (str) - 物理机备注,默认为不更改。
661
+ - **ReserveDisk** (str) - 是否保留数据盘,保留:Yes,不报留:No, 默认:Yes
662
+ - **Tag** (str) - 业务组,默认不更改。
663
+
664
+ **Response**
665
+
666
+ - **PHostId** (str) - PHost 的资源ID
667
+
668
+ """
669
+ # build request
670
+ d = {
671
+ "ProjectId": self.config.project_id,
672
+ "Region": self.config.region,
673
+ }
674
+ req and d.update(req)
675
+ d = apis.ReinstallPHostRequestSchema().dumps(d)
676
+
677
+ resp = self.invoke("ReinstallPHost", d, **kwargs)
678
+ return apis.ReinstallPHostResponseSchema().loads(resp)
679
+
680
+ def reset_phost_password(
681
+ self, req: typing.Optional[dict] = None, **kwargs
682
+ ) -> dict:
683
+ """ResetPHostPassword - 重置裸金属实例的管理员密码
684
+
685
+ **Request**
686
+
687
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
688
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
689
+ - **PHostId** (str) - (Required) 裸金属实例ID
690
+ - **Password** (str) - (Required) PHost新密码(密码格式使用BASE64编码)
691
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
692
+
693
+ **Response**
694
+
695
+ - **PHostId** (str) - 裸金属实例ID
696
+
697
+ """
698
+ # build request
699
+ d = {
700
+ "ProjectId": self.config.project_id,
701
+ "Region": self.config.region,
702
+ }
703
+ req and d.update(req)
704
+ d = apis.ResetPHostPasswordRequestSchema().dumps(d)
705
+
706
+ resp = self.invoke("ResetPHostPassword", d, **kwargs)
707
+ return apis.ResetPHostPasswordResponseSchema().loads(resp)
708
+
709
+ def resize_phost_attached_disk(
710
+ self, req: typing.Optional[dict] = None, **kwargs
711
+ ) -> dict:
712
+ """ResizePHostAttachedDisk - 修改裸金属物理云已经挂载的云盘容量大小
713
+
714
+ **Request**
715
+
716
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
717
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
718
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
719
+ - **DiskSpace** (int) - 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
720
+ - **PHostId** (str) - UPHost实例ID。
721
+ - **UDiskId** (str) - 磁盘ID。
722
+
723
+ **Response**
724
+
725
+ - **UDiskId** (str) - 改配成功的磁盘id
726
+
727
+ """
728
+ # build request
729
+ d = {
730
+ "ProjectId": self.config.project_id,
731
+ "Region": self.config.region,
732
+ }
733
+ req and d.update(req)
734
+ d = apis.ResizePHostAttachedDiskRequestSchema().dumps(d)
735
+
736
+ resp = self.invoke("ResizePHostAttachedDisk", d, **kwargs)
737
+ return apis.ResizePHostAttachedDiskResponseSchema().loads(resp)
738
+
739
+ def start_phost(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
740
+ """StartPHost - 启动物理机
741
+
742
+ **Request**
743
+
744
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
745
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
746
+ - **PHostId** (str) - (Required) PHost资源ID
747
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
748
+
749
+ **Response**
750
+
751
+ - **PHostId** (str) - PHost 的资源ID
752
+
753
+ """
754
+ # build request
755
+ d = {
756
+ "ProjectId": self.config.project_id,
757
+ "Region": self.config.region,
758
+ }
759
+ req and d.update(req)
760
+ d = apis.StartPHostRequestSchema().dumps(d)
761
+
762
+ resp = self.invoke("StartPHost", d, **kwargs)
763
+ return apis.StartPHostResponseSchema().loads(resp)
764
+
765
+ def stop_phost(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
766
+ """StopPHost - 关闭物理机
767
+
768
+ **Request**
769
+
770
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
771
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
772
+ - **PHostId** (str) - (Required) PHost资源ID
773
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
774
+
775
+ **Response**
776
+
777
+ - **PHostId** (str) - PHost 的资源ID
778
+
779
+ """
780
+ # build request
781
+ d = {
782
+ "ProjectId": self.config.project_id,
783
+ "Region": self.config.region,
784
+ }
785
+ req and d.update(req)
786
+ d = apis.StopPHostRequestSchema().dumps(d)
787
+
788
+ resp = self.invoke("StopPHost", d, **kwargs)
789
+ return apis.StopPHostResponseSchema().loads(resp)
790
+
791
+ def terminate_phost(
792
+ self, req: typing.Optional[dict] = None, **kwargs
793
+ ) -> dict:
794
+ """TerminatePHost - 删除物理云主机
795
+
796
+ **Request**
797
+
798
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
799
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
800
+ - **PHostId** (str) - (Required) PHost资源ID
801
+ - **ReleaseEIP** (bool) - 是否释放绑定的EIP。true: 解绑EIP后,并释放;其他值或不填:解绑EIP。
802
+ - **ReleaseUDisk** (bool) - 裸金属机型参数->删除主机时是否同时删除挂载的数据盘。默认为false。
803
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
804
+
805
+ **Response**
806
+
807
+ - **PHostId** (str) - PHost 的资源ID
808
+
809
+ """
810
+ # build request
811
+ d = {
812
+ "ProjectId": self.config.project_id,
813
+ "Region": self.config.region,
814
+ }
815
+ req and d.update(req)
816
+ d = apis.TerminatePHostRequestSchema().dumps(d)
817
+
818
+ resp = self.invoke("TerminatePHost", d, **kwargs)
819
+ return apis.TerminatePHostResponseSchema().loads(resp)
820
+
821
+ def terminate_phost_image(
822
+ self, req: typing.Optional[dict] = None, **kwargs
823
+ ) -> dict:
824
+ """TerminatePHostImage - 删除裸金属2.0用户自定义镜像
825
+
826
+ **Request**
827
+
828
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
829
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
830
+ - **ImageId** (str) - (Required) 自制镜像ID
831
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
832
+
833
+ **Response**
834
+
835
+ - **ImageId** (str) - 自制镜像ID
836
+
837
+ """
838
+ # build request
839
+ d = {
840
+ "ProjectId": self.config.project_id,
841
+ "Region": self.config.region,
842
+ }
843
+ req and d.update(req)
844
+ d = apis.TerminatePHostImageRequestSchema().dumps(d)
845
+
846
+ resp = self.invoke("TerminatePHostImage", d, **kwargs)
847
+ return apis.TerminatePHostImageResponseSchema().loads(resp)