UPHostClient.php 38 KB

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