tencentcloud-sdk-bm 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1340 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
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
+ require 'json'
18
+
19
+ module TencentCloud
20
+ module Bm
21
+ module V20180423
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-04-23'
26
+ api_endpoint = 'bm.tencentcloudapi.com'
27
+ sdk_version = 'BM_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 服务器绑定CAM角色,该角色授权访问黑石物理服务器服务,为黑石物理服务器提供了访问资源的权限,如请求服务器的临时证书
33
+
34
+ # @param request: Request instance for AttachCamRole.
35
+ # @type request: :class:`Tencentcloud::bm::V20180423::AttachCamRoleRequest`
36
+ # @rtype: :class:`Tencentcloud::bm::V20180423::AttachCamRoleResponse`
37
+ def AttachCamRole(request)
38
+ body = send_request('AttachCamRole', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = AttachCamRoleResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 为预授权规则绑定标签
57
+
58
+ # @param request: Request instance for BindPsaTag.
59
+ # @type request: :class:`Tencentcloud::bm::V20180423::BindPsaTagRequest`
60
+ # @rtype: :class:`Tencentcloud::bm::V20180423::BindPsaTagResponse`
61
+ def BindPsaTag(request)
62
+ body = send_request('BindPsaTag', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = BindPsaTagResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+ # 购买黑石物理机
81
+
82
+ # @param request: Request instance for BuyDevices.
83
+ # @type request: :class:`Tencentcloud::bm::V20180423::BuyDevicesRequest`
84
+ # @rtype: :class:`Tencentcloud::bm::V20180423::BuyDevicesResponse`
85
+ def BuyDevices(request)
86
+ body = send_request('BuyDevices', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = BuyDevicesResponse.new
90
+ model.deserialize(response['Response'])
91
+ model
92
+ else
93
+ code = response['Response']['Error']['Code']
94
+ message = response['Response']['Error']['Message']
95
+ reqid = response['Response']['RequestId']
96
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
97
+ end
98
+ rescue TencentCloud::Common::TencentCloudSDKException => e
99
+ raise e
100
+ rescue StandardError => e
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
102
+ end
103
+
104
+ # 创建自定义镜像<br>
105
+ # 每个AppId在每个可用区最多保留20个自定义镜像
106
+
107
+ # @param request: Request instance for CreateCustomImage.
108
+ # @type request: :class:`Tencentcloud::bm::V20180423::CreateCustomImageRequest`
109
+ # @rtype: :class:`Tencentcloud::bm::V20180423::CreateCustomImageResponse`
110
+ def CreateCustomImage(request)
111
+ body = send_request('CreateCustomImage', request.serialize)
112
+ response = JSON.parse(body)
113
+ if response['Response'].key?('Error') == false
114
+ model = CreateCustomImageResponse.new
115
+ model.deserialize(response['Response'])
116
+ model
117
+ else
118
+ code = response['Response']['Error']['Code']
119
+ message = response['Response']['Error']['Message']
120
+ reqid = response['Response']['RequestId']
121
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
122
+ end
123
+ rescue TencentCloud::Common::TencentCloudSDKException => e
124
+ raise e
125
+ rescue StandardError => e
126
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
127
+ end
128
+
129
+ # 创建预授权规则
130
+
131
+ # @param request: Request instance for CreatePsaRegulation.
132
+ # @type request: :class:`Tencentcloud::bm::V20180423::CreatePsaRegulationRequest`
133
+ # @rtype: :class:`Tencentcloud::bm::V20180423::CreatePsaRegulationResponse`
134
+ def CreatePsaRegulation(request)
135
+ body = send_request('CreatePsaRegulation', request.serialize)
136
+ response = JSON.parse(body)
137
+ if response['Response'].key?('Error') == false
138
+ model = CreatePsaRegulationResponse.new
139
+ model.deserialize(response['Response'])
140
+ model
141
+ else
142
+ code = response['Response']['Error']['Code']
143
+ message = response['Response']['Error']['Message']
144
+ reqid = response['Response']['RequestId']
145
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
146
+ end
147
+ rescue TencentCloud::Common::TencentCloudSDKException => e
148
+ raise e
149
+ rescue StandardError => e
150
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
151
+ end
152
+
153
+ # 创建黑石竞价实例
154
+
155
+ # @param request: Request instance for CreateSpotDevice.
156
+ # @type request: :class:`Tencentcloud::bm::V20180423::CreateSpotDeviceRequest`
157
+ # @rtype: :class:`Tencentcloud::bm::V20180423::CreateSpotDeviceResponse`
158
+ def CreateSpotDevice(request)
159
+ body = send_request('CreateSpotDevice', request.serialize)
160
+ response = JSON.parse(body)
161
+ if response['Response'].key?('Error') == false
162
+ model = CreateSpotDeviceResponse.new
163
+ model.deserialize(response['Response'])
164
+ model
165
+ else
166
+ code = response['Response']['Error']['Code']
167
+ message = response['Response']['Error']['Message']
168
+ reqid = response['Response']['RequestId']
169
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
170
+ end
171
+ rescue TencentCloud::Common::TencentCloudSDKException => e
172
+ raise e
173
+ rescue StandardError => e
174
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
175
+ end
176
+
177
+ # 创建自定义脚本
178
+
179
+ # @param request: Request instance for CreateUserCmd.
180
+ # @type request: :class:`Tencentcloud::bm::V20180423::CreateUserCmdRequest`
181
+ # @rtype: :class:`Tencentcloud::bm::V20180423::CreateUserCmdResponse`
182
+ def CreateUserCmd(request)
183
+ body = send_request('CreateUserCmd', request.serialize)
184
+ response = JSON.parse(body)
185
+ if response['Response'].key?('Error') == false
186
+ model = CreateUserCmdResponse.new
187
+ model.deserialize(response['Response'])
188
+ model
189
+ else
190
+ code = response['Response']['Error']['Code']
191
+ message = response['Response']['Error']['Message']
192
+ reqid = response['Response']['RequestId']
193
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
194
+ end
195
+ rescue TencentCloud::Common::TencentCloudSDKException => e
196
+ raise e
197
+ rescue StandardError => e
198
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
199
+ end
200
+
201
+ # 删除自定义镜像<br>
202
+ # 正用于部署或重装中的镜像被删除后,镜像文件将保留一段时间,直到部署或重装结束
203
+
204
+ # @param request: Request instance for DeleteCustomImages.
205
+ # @type request: :class:`Tencentcloud::bm::V20180423::DeleteCustomImagesRequest`
206
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DeleteCustomImagesResponse`
207
+ def DeleteCustomImages(request)
208
+ body = send_request('DeleteCustomImages', request.serialize)
209
+ response = JSON.parse(body)
210
+ if response['Response'].key?('Error') == false
211
+ model = DeleteCustomImagesResponse.new
212
+ model.deserialize(response['Response'])
213
+ model
214
+ else
215
+ code = response['Response']['Error']['Code']
216
+ message = response['Response']['Error']['Message']
217
+ reqid = response['Response']['RequestId']
218
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
219
+ end
220
+ rescue TencentCloud::Common::TencentCloudSDKException => e
221
+ raise e
222
+ rescue StandardError => e
223
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
224
+ end
225
+
226
+ # 删除预授权规则
227
+
228
+ # @param request: Request instance for DeletePsaRegulation.
229
+ # @type request: :class:`Tencentcloud::bm::V20180423::DeletePsaRegulationRequest`
230
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DeletePsaRegulationResponse`
231
+ def DeletePsaRegulation(request)
232
+ body = send_request('DeletePsaRegulation', request.serialize)
233
+ response = JSON.parse(body)
234
+ if response['Response'].key?('Error') == false
235
+ model = DeletePsaRegulationResponse.new
236
+ model.deserialize(response['Response'])
237
+ model
238
+ else
239
+ code = response['Response']['Error']['Code']
240
+ message = response['Response']['Error']['Message']
241
+ reqid = response['Response']['RequestId']
242
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
243
+ end
244
+ rescue TencentCloud::Common::TencentCloudSDKException => e
245
+ raise e
246
+ rescue StandardError => e
247
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
248
+ end
249
+
250
+ # 删除自定义脚本
251
+
252
+ # @param request: Request instance for DeleteUserCmds.
253
+ # @type request: :class:`Tencentcloud::bm::V20180423::DeleteUserCmdsRequest`
254
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DeleteUserCmdsResponse`
255
+ def DeleteUserCmds(request)
256
+ body = send_request('DeleteUserCmds', request.serialize)
257
+ response = JSON.parse(body)
258
+ if response['Response'].key?('Error') == false
259
+ model = DeleteUserCmdsResponse.new
260
+ model.deserialize(response['Response'])
261
+ model
262
+ else
263
+ code = response['Response']['Error']['Code']
264
+ message = response['Response']['Error']['Message']
265
+ reqid = response['Response']['RequestId']
266
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
267
+ end
268
+ rescue TencentCloud::Common::TencentCloudSDKException => e
269
+ raise e
270
+ rescue StandardError => e
271
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
272
+ end
273
+
274
+ # 查询自定义镜像制作进度
275
+
276
+ # @param request: Request instance for DescribeCustomImageProcess.
277
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeCustomImageProcessRequest`
278
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeCustomImageProcessResponse`
279
+ def DescribeCustomImageProcess(request)
280
+ body = send_request('DescribeCustomImageProcess', request.serialize)
281
+ response = JSON.parse(body)
282
+ if response['Response'].key?('Error') == false
283
+ model = DescribeCustomImageProcessResponse.new
284
+ model.deserialize(response['Response'])
285
+ model
286
+ else
287
+ code = response['Response']['Error']['Code']
288
+ message = response['Response']['Error']['Message']
289
+ reqid = response['Response']['RequestId']
290
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
291
+ end
292
+ rescue TencentCloud::Common::TencentCloudSDKException => e
293
+ raise e
294
+ rescue StandardError => e
295
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
296
+ end
297
+
298
+ # 查看自定义镜像列表
299
+
300
+ # @param request: Request instance for DescribeCustomImages.
301
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeCustomImagesRequest`
302
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeCustomImagesResponse`
303
+ def DescribeCustomImages(request)
304
+ body = send_request('DescribeCustomImages', request.serialize)
305
+ response = JSON.parse(body)
306
+ if response['Response'].key?('Error') == false
307
+ model = DescribeCustomImagesResponse.new
308
+ model.deserialize(response['Response'])
309
+ model
310
+ else
311
+ code = response['Response']['Error']['Code']
312
+ message = response['Response']['Error']['Message']
313
+ reqid = response['Response']['RequestId']
314
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
315
+ end
316
+ rescue TencentCloud::Common::TencentCloudSDKException => e
317
+ raise e
318
+ rescue StandardError => e
319
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
320
+ end
321
+
322
+ # 获取设备类型
323
+
324
+ # @param request: Request instance for DescribeDeviceClass.
325
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDeviceClassRequest`
326
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDeviceClassResponse`
327
+ def DescribeDeviceClass(request)
328
+ body = send_request('DescribeDeviceClass', request.serialize)
329
+ response = JSON.parse(body)
330
+ if response['Response'].key?('Error') == false
331
+ model = DescribeDeviceClassResponse.new
332
+ model.deserialize(response['Response'])
333
+ model
334
+ else
335
+ code = response['Response']['Error']['Code']
336
+ message = response['Response']['Error']['Message']
337
+ reqid = response['Response']['RequestId']
338
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
339
+ end
340
+ rescue TencentCloud::Common::TencentCloudSDKException => e
341
+ raise e
342
+ rescue StandardError => e
343
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
344
+ end
345
+
346
+ # 查询机型支持的RAID方式, 并返回系统盘的分区和逻辑盘的列表
347
+
348
+ # @param request: Request instance for DescribeDeviceClassPartition.
349
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDeviceClassPartitionRequest`
350
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDeviceClassPartitionResponse`
351
+ def DescribeDeviceClassPartition(request)
352
+ body = send_request('DescribeDeviceClassPartition', request.serialize)
353
+ response = JSON.parse(body)
354
+ if response['Response'].key?('Error') == false
355
+ model = DescribeDeviceClassPartitionResponse.new
356
+ model.deserialize(response['Response'])
357
+ model
358
+ else
359
+ code = response['Response']['Error']['Code']
360
+ message = response['Response']['Error']['Message']
361
+ reqid = response['Response']['RequestId']
362
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
363
+ end
364
+ rescue TencentCloud::Common::TencentCloudSDKException => e
365
+ raise e
366
+ rescue StandardError => e
367
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
368
+ end
369
+
370
+ # 查询设备硬件配置信息,如 CPU 型号,内存大小,磁盘大小和数量
371
+
372
+ # @param request: Request instance for DescribeDeviceHardwareInfo.
373
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDeviceHardwareInfoRequest`
374
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDeviceHardwareInfoResponse`
375
+ def DescribeDeviceHardwareInfo(request)
376
+ body = send_request('DescribeDeviceHardwareInfo', request.serialize)
377
+ response = JSON.parse(body)
378
+ if response['Response'].key?('Error') == false
379
+ model = DescribeDeviceHardwareInfoResponse.new
380
+ model.deserialize(response['Response'])
381
+ model
382
+ else
383
+ code = response['Response']['Error']['Code']
384
+ message = response['Response']['Error']['Message']
385
+ reqid = response['Response']['RequestId']
386
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
387
+ end
388
+ rescue TencentCloud::Common::TencentCloudSDKException => e
389
+ raise e
390
+ rescue StandardError => e
391
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
392
+ end
393
+
394
+ # 查询设备库存
395
+
396
+ # @param request: Request instance for DescribeDeviceInventory.
397
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDeviceInventoryRequest`
398
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDeviceInventoryResponse`
399
+ def DescribeDeviceInventory(request)
400
+ body = send_request('DescribeDeviceInventory', request.serialize)
401
+ response = JSON.parse(body)
402
+ if response['Response'].key?('Error') == false
403
+ model = DescribeDeviceInventoryResponse.new
404
+ model.deserialize(response['Response'])
405
+ model
406
+ else
407
+ code = response['Response']['Error']['Code']
408
+ message = response['Response']['Error']['Message']
409
+ reqid = response['Response']['RequestId']
410
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
411
+ end
412
+ rescue TencentCloud::Common::TencentCloudSDKException => e
413
+ raise e
414
+ rescue StandardError => e
415
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
416
+ end
417
+
418
+ # 查询设备操作日志, 如设备重启,重装,设置密码等操作
419
+
420
+ # @param request: Request instance for DescribeDeviceOperationLog.
421
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDeviceOperationLogRequest`
422
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDeviceOperationLogResponse`
423
+ def DescribeDeviceOperationLog(request)
424
+ body = send_request('DescribeDeviceOperationLog', request.serialize)
425
+ response = JSON.parse(body)
426
+ if response['Response'].key?('Error') == false
427
+ model = DescribeDeviceOperationLogResponse.new
428
+ model.deserialize(response['Response'])
429
+ model
430
+ else
431
+ code = response['Response']['Error']['Code']
432
+ message = response['Response']['Error']['Message']
433
+ reqid = response['Response']['RequestId']
434
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
435
+ end
436
+ rescue TencentCloud::Common::TencentCloudSDKException => e
437
+ raise e
438
+ rescue StandardError => e
439
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
440
+ end
441
+
442
+ # 获取物理机的分区格式
443
+
444
+ # @param request: Request instance for DescribeDevicePartition.
445
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDevicePartitionRequest`
446
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDevicePartitionResponse`
447
+ def DescribeDevicePartition(request)
448
+ body = send_request('DescribeDevicePartition', request.serialize)
449
+ response = JSON.parse(body)
450
+ if response['Response'].key?('Error') == false
451
+ model = DescribeDevicePartitionResponse.new
452
+ model.deserialize(response['Response'])
453
+ model
454
+ else
455
+ code = response['Response']['Error']['Code']
456
+ message = response['Response']['Error']['Message']
457
+ reqid = response['Response']['RequestId']
458
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
459
+ end
460
+ rescue TencentCloud::Common::TencentCloudSDKException => e
461
+ raise e
462
+ rescue StandardError => e
463
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
464
+ end
465
+
466
+ # 查询服务器所在的位置,如机架,上联交换机等信息
467
+
468
+ # @param request: Request instance for DescribeDevicePosition.
469
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDevicePositionRequest`
470
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDevicePositionResponse`
471
+ def DescribeDevicePosition(request)
472
+ body = send_request('DescribeDevicePosition', request.serialize)
473
+ response = JSON.parse(body)
474
+ if response['Response'].key?('Error') == false
475
+ model = DescribeDevicePositionResponse.new
476
+ model.deserialize(response['Response'])
477
+ model
478
+ else
479
+ code = response['Response']['Error']['Code']
480
+ message = response['Response']['Error']['Message']
481
+ reqid = response['Response']['RequestId']
482
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
483
+ end
484
+ rescue TencentCloud::Common::TencentCloudSDKException => e
485
+ raise e
486
+ rescue StandardError => e
487
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
488
+ end
489
+
490
+ # 查询服务器价格信息,支持设备的批量查找,支持标准机型和弹性机型的混合查找
491
+
492
+ # @param request: Request instance for DescribeDevicePriceInfo.
493
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDevicePriceInfoRequest`
494
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDevicePriceInfoResponse`
495
+ def DescribeDevicePriceInfo(request)
496
+ body = send_request('DescribeDevicePriceInfo', request.serialize)
497
+ response = JSON.parse(body)
498
+ if response['Response'].key?('Error') == false
499
+ model = DescribeDevicePriceInfoResponse.new
500
+ model.deserialize(response['Response'])
501
+ model
502
+ else
503
+ code = response['Response']['Error']['Code']
504
+ message = response['Response']['Error']['Message']
505
+ reqid = response['Response']['RequestId']
506
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
507
+ end
508
+ rescue TencentCloud::Common::TencentCloudSDKException => e
509
+ raise e
510
+ rescue StandardError => e
511
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
512
+ end
513
+
514
+ # 查询物理服务器,可以按照实例,业务IP等过滤
515
+
516
+ # @param request: Request instance for DescribeDevices.
517
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeDevicesRequest`
518
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeDevicesResponse`
519
+ def DescribeDevices(request)
520
+ body = send_request('DescribeDevices', request.serialize)
521
+ response = JSON.parse(body)
522
+ if response['Response'].key?('Error') == false
523
+ model = DescribeDevicesResponse.new
524
+ model.deserialize(response['Response'])
525
+ model
526
+ else
527
+ code = response['Response']['Error']['Code']
528
+ message = response['Response']['Error']['Message']
529
+ reqid = response['Response']['RequestId']
530
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
531
+ end
532
+ rescue TencentCloud::Common::TencentCloudSDKException => e
533
+ raise e
534
+ rescue StandardError => e
535
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
536
+ end
537
+
538
+ # 查询自定义机型部件信息,包括CpuId对应的型号,DiskTypeId对应的磁盘类型
539
+
540
+ # @param request: Request instance for DescribeHardwareSpecification.
541
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeHardwareSpecificationRequest`
542
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeHardwareSpecificationResponse`
543
+ def DescribeHardwareSpecification(request)
544
+ body = send_request('DescribeHardwareSpecification', request.serialize)
545
+ response = JSON.parse(body)
546
+ if response['Response'].key?('Error') == false
547
+ model = DescribeHardwareSpecificationResponse.new
548
+ model.deserialize(response['Response'])
549
+ model
550
+ else
551
+ code = response['Response']['Error']['Code']
552
+ message = response['Response']['Error']['Message']
553
+ reqid = response['Response']['RequestId']
554
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
555
+ end
556
+ rescue TencentCloud::Common::TencentCloudSDKException => e
557
+ raise e
558
+ rescue StandardError => e
559
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
560
+ end
561
+
562
+ # 查询托管设备带外信息
563
+
564
+ # @param request: Request instance for DescribeHostedDeviceOutBandInfo.
565
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeHostedDeviceOutBandInfoRequest`
566
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeHostedDeviceOutBandInfoResponse`
567
+ def DescribeHostedDeviceOutBandInfo(request)
568
+ body = send_request('DescribeHostedDeviceOutBandInfo', request.serialize)
569
+ response = JSON.parse(body)
570
+ if response['Response'].key?('Error') == false
571
+ model = DescribeHostedDeviceOutBandInfoResponse.new
572
+ model.deserialize(response['Response'])
573
+ model
574
+ else
575
+ code = response['Response']['Error']['Code']
576
+ message = response['Response']['Error']['Message']
577
+ reqid = response['Response']['RequestId']
578
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
579
+ end
580
+ rescue TencentCloud::Common::TencentCloudSDKException => e
581
+ raise e
582
+ rescue StandardError => e
583
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
584
+ end
585
+
586
+ # 获取异步操作状态的完成状态
587
+
588
+ # @param request: Request instance for DescribeOperationResult.
589
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeOperationResultRequest`
590
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeOperationResultResponse`
591
+ def DescribeOperationResult(request)
592
+ body = send_request('DescribeOperationResult', request.serialize)
593
+ response = JSON.parse(body)
594
+ if response['Response'].key?('Error') == false
595
+ model = DescribeOperationResultResponse.new
596
+ model.deserialize(response['Response'])
597
+ model
598
+ else
599
+ code = response['Response']['Error']['Code']
600
+ message = response['Response']['Error']['Message']
601
+ reqid = response['Response']['RequestId']
602
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
603
+ end
604
+ rescue TencentCloud::Common::TencentCloudSDKException => e
605
+ raise e
606
+ rescue StandardError => e
607
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
608
+ end
609
+
610
+ # 查询指定机型所支持的操作系统
611
+
612
+ # @param request: Request instance for DescribeOsInfo.
613
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeOsInfoRequest`
614
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeOsInfoResponse`
615
+ def DescribeOsInfo(request)
616
+ body = send_request('DescribeOsInfo', request.serialize)
617
+ response = JSON.parse(body)
618
+ if response['Response'].key?('Error') == false
619
+ model = DescribeOsInfoResponse.new
620
+ model.deserialize(response['Response'])
621
+ model
622
+ else
623
+ code = response['Response']['Error']['Code']
624
+ message = response['Response']['Error']['Message']
625
+ reqid = response['Response']['RequestId']
626
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
627
+ end
628
+ rescue TencentCloud::Common::TencentCloudSDKException => e
629
+ raise e
630
+ rescue StandardError => e
631
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
632
+ end
633
+
634
+ # 获取预授权规则列表
635
+
636
+ # @param request: Request instance for DescribePsaRegulations.
637
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribePsaRegulationsRequest`
638
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribePsaRegulationsResponse`
639
+ def DescribePsaRegulations(request)
640
+ body = send_request('DescribePsaRegulations', request.serialize)
641
+ response = JSON.parse(body)
642
+ if response['Response'].key?('Error') == false
643
+ model = DescribePsaRegulationsResponse.new
644
+ model.deserialize(response['Response'])
645
+ model
646
+ else
647
+ code = response['Response']['Error']['Code']
648
+ message = response['Response']['Error']['Message']
649
+ reqid = response['Response']['RequestId']
650
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
651
+ end
652
+ rescue TencentCloud::Common::TencentCloudSDKException => e
653
+ raise e
654
+ rescue StandardError => e
655
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
656
+ end
657
+
658
+ # 查询地域以及可用区
659
+
660
+ # @param request: Request instance for DescribeRegions.
661
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeRegionsRequest`
662
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeRegionsResponse`
663
+ def DescribeRegions(request)
664
+ body = send_request('DescribeRegions', request.serialize)
665
+ response = JSON.parse(body)
666
+ if response['Response'].key?('Error') == false
667
+ model = DescribeRegionsResponse.new
668
+ model.deserialize(response['Response'])
669
+ model
670
+ else
671
+ code = response['Response']['Error']['Code']
672
+ message = response['Response']['Error']['Message']
673
+ reqid = response['Response']['RequestId']
674
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
675
+ end
676
+ rescue TencentCloud::Common::TencentCloudSDKException => e
677
+ raise e
678
+ rescue StandardError => e
679
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
680
+ end
681
+
682
+ # 维修任务配置获取
683
+
684
+ # @param request: Request instance for DescribeRepairTaskConstant.
685
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeRepairTaskConstantRequest`
686
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeRepairTaskConstantResponse`
687
+ def DescribeRepairTaskConstant(request)
688
+ body = send_request('DescribeRepairTaskConstant', request.serialize)
689
+ response = JSON.parse(body)
690
+ if response['Response'].key?('Error') == false
691
+ model = DescribeRepairTaskConstantResponse.new
692
+ model.deserialize(response['Response'])
693
+ model
694
+ else
695
+ code = response['Response']['Error']['Code']
696
+ message = response['Response']['Error']['Message']
697
+ reqid = response['Response']['RequestId']
698
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
699
+ end
700
+ rescue TencentCloud::Common::TencentCloudSDKException => e
701
+ raise e
702
+ rescue StandardError => e
703
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
704
+ end
705
+
706
+ # 获取用户维修任务列表及详细信息<br>
707
+ # <br>
708
+ # TaskStatus(任务状态ID)与状态中文名的对应关系如下:<br>
709
+ # 1:未授权<br>
710
+ # 2:处理中<br>
711
+ # 3:待确认<br>
712
+ # 4:未授权-暂不处理<br>
713
+ # 5:已恢复<br>
714
+ # 6:待确认-未恢复<br>
715
+
716
+ # @param request: Request instance for DescribeTaskInfo.
717
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeTaskInfoRequest`
718
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeTaskInfoResponse`
719
+ def DescribeTaskInfo(request)
720
+ body = send_request('DescribeTaskInfo', request.serialize)
721
+ response = JSON.parse(body)
722
+ if response['Response'].key?('Error') == false
723
+ model = DescribeTaskInfoResponse.new
724
+ model.deserialize(response['Response'])
725
+ model
726
+ else
727
+ code = response['Response']['Error']['Code']
728
+ message = response['Response']['Error']['Message']
729
+ reqid = response['Response']['RequestId']
730
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
731
+ end
732
+ rescue TencentCloud::Common::TencentCloudSDKException => e
733
+ raise e
734
+ rescue StandardError => e
735
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
736
+ end
737
+
738
+ # 获取维修任务操作日志
739
+
740
+ # @param request: Request instance for DescribeTaskOperationLog.
741
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeTaskOperationLogRequest`
742
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeTaskOperationLogResponse`
743
+ def DescribeTaskOperationLog(request)
744
+ body = send_request('DescribeTaskOperationLog', request.serialize)
745
+ response = JSON.parse(body)
746
+ if response['Response'].key?('Error') == false
747
+ model = DescribeTaskOperationLogResponse.new
748
+ model.deserialize(response['Response'])
749
+ model
750
+ else
751
+ code = response['Response']['Error']['Code']
752
+ message = response['Response']['Error']['Message']
753
+ reqid = response['Response']['RequestId']
754
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
755
+ end
756
+ rescue TencentCloud::Common::TencentCloudSDKException => e
757
+ raise e
758
+ rescue StandardError => e
759
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
760
+ end
761
+
762
+ # 获取自定义脚本任务详细信息
763
+
764
+ # @param request: Request instance for DescribeUserCmdTaskInfo.
765
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdTaskInfoRequest`
766
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdTaskInfoResponse`
767
+ def DescribeUserCmdTaskInfo(request)
768
+ body = send_request('DescribeUserCmdTaskInfo', request.serialize)
769
+ response = JSON.parse(body)
770
+ if response['Response'].key?('Error') == false
771
+ model = DescribeUserCmdTaskInfoResponse.new
772
+ model.deserialize(response['Response'])
773
+ model
774
+ else
775
+ code = response['Response']['Error']['Code']
776
+ message = response['Response']['Error']['Message']
777
+ reqid = response['Response']['RequestId']
778
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
779
+ end
780
+ rescue TencentCloud::Common::TencentCloudSDKException => e
781
+ raise e
782
+ rescue StandardError => e
783
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
784
+ end
785
+
786
+ # 获取自定义脚本任务列表
787
+
788
+ # @param request: Request instance for DescribeUserCmdTasks.
789
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdTasksRequest`
790
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdTasksResponse`
791
+ def DescribeUserCmdTasks(request)
792
+ body = send_request('DescribeUserCmdTasks', request.serialize)
793
+ response = JSON.parse(body)
794
+ if response['Response'].key?('Error') == false
795
+ model = DescribeUserCmdTasksResponse.new
796
+ model.deserialize(response['Response'])
797
+ model
798
+ else
799
+ code = response['Response']['Error']['Code']
800
+ message = response['Response']['Error']['Message']
801
+ reqid = response['Response']['RequestId']
802
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
803
+ end
804
+ rescue TencentCloud::Common::TencentCloudSDKException => e
805
+ raise e
806
+ rescue StandardError => e
807
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
808
+ end
809
+
810
+ # 获取自定义脚本信息列表
811
+
812
+ # @param request: Request instance for DescribeUserCmds.
813
+ # @type request: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdsRequest`
814
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DescribeUserCmdsResponse`
815
+ def DescribeUserCmds(request)
816
+ body = send_request('DescribeUserCmds', request.serialize)
817
+ response = JSON.parse(body)
818
+ if response['Response'].key?('Error') == false
819
+ model = DescribeUserCmdsResponse.new
820
+ model.deserialize(response['Response'])
821
+ model
822
+ else
823
+ code = response['Response']['Error']['Code']
824
+ message = response['Response']['Error']['Message']
825
+ reqid = response['Response']['RequestId']
826
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
827
+ end
828
+ rescue TencentCloud::Common::TencentCloudSDKException => e
829
+ raise e
830
+ rescue StandardError => e
831
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
832
+ end
833
+
834
+ # 服务器绑定CAM角色
835
+
836
+ # @param request: Request instance for DetachCamRole.
837
+ # @type request: :class:`Tencentcloud::bm::V20180423::DetachCamRoleRequest`
838
+ # @rtype: :class:`Tencentcloud::bm::V20180423::DetachCamRoleResponse`
839
+ def DetachCamRole(request)
840
+ body = send_request('DetachCamRole', request.serialize)
841
+ response = JSON.parse(body)
842
+ if response['Response'].key?('Error') == false
843
+ model = DetachCamRoleResponse.new
844
+ model.deserialize(response['Response'])
845
+ model
846
+ else
847
+ code = response['Response']['Error']['Code']
848
+ message = response['Response']['Error']['Message']
849
+ reqid = response['Response']['RequestId']
850
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
851
+ end
852
+ rescue TencentCloud::Common::TencentCloudSDKException => e
853
+ raise e
854
+ rescue StandardError => e
855
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
856
+ end
857
+
858
+ # 用于修改自定义镜像名或描述
859
+
860
+ # @param request: Request instance for ModifyCustomImageAttribute.
861
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyCustomImageAttributeRequest`
862
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyCustomImageAttributeResponse`
863
+ def ModifyCustomImageAttribute(request)
864
+ body = send_request('ModifyCustomImageAttribute', request.serialize)
865
+ response = JSON.parse(body)
866
+ if response['Response'].key?('Error') == false
867
+ model = ModifyCustomImageAttributeResponse.new
868
+ model.deserialize(response['Response'])
869
+ model
870
+ else
871
+ code = response['Response']['Error']['Code']
872
+ message = response['Response']['Error']['Message']
873
+ reqid = response['Response']['RequestId']
874
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
875
+ end
876
+ rescue TencentCloud::Common::TencentCloudSDKException => e
877
+ raise e
878
+ rescue StandardError => e
879
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
880
+ end
881
+
882
+ # 修改服务器名称
883
+
884
+ # @param request: Request instance for ModifyDeviceAliases.
885
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyDeviceAliasesRequest`
886
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyDeviceAliasesResponse`
887
+ def ModifyDeviceAliases(request)
888
+ body = send_request('ModifyDeviceAliases', request.serialize)
889
+ response = JSON.parse(body)
890
+ if response['Response'].key?('Error') == false
891
+ model = ModifyDeviceAliasesResponse.new
892
+ model.deserialize(response['Response'])
893
+ model
894
+ else
895
+ code = response['Response']['Error']['Code']
896
+ message = response['Response']['Error']['Message']
897
+ reqid = response['Response']['RequestId']
898
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
899
+ end
900
+ rescue TencentCloud::Common::TencentCloudSDKException => e
901
+ raise e
902
+ rescue StandardError => e
903
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
904
+ end
905
+
906
+ # 修改物理机服务器自动续费标志
907
+
908
+ # @param request: Request instance for ModifyDeviceAutoRenewFlag.
909
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyDeviceAutoRenewFlagRequest`
910
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyDeviceAutoRenewFlagResponse`
911
+ def ModifyDeviceAutoRenewFlag(request)
912
+ body = send_request('ModifyDeviceAutoRenewFlag', request.serialize)
913
+ response = JSON.parse(body)
914
+ if response['Response'].key?('Error') == false
915
+ model = ModifyDeviceAutoRenewFlagResponse.new
916
+ model.deserialize(response['Response'])
917
+ model
918
+ else
919
+ code = response['Response']['Error']['Code']
920
+ message = response['Response']['Error']['Message']
921
+ reqid = response['Response']['RequestId']
922
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
923
+ end
924
+ rescue TencentCloud::Common::TencentCloudSDKException => e
925
+ raise e
926
+ rescue StandardError => e
927
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
928
+ end
929
+
930
+ # 修改物理机内网IP(不重装系统)
931
+
932
+ # @param request: Request instance for ModifyLanIp.
933
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyLanIpRequest`
934
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyLanIpResponse`
935
+ def ModifyLanIp(request)
936
+ body = send_request('ModifyLanIp', request.serialize)
937
+ response = JSON.parse(body)
938
+ if response['Response'].key?('Error') == false
939
+ model = ModifyLanIpResponse.new
940
+ model.deserialize(response['Response'])
941
+ model
942
+ else
943
+ code = response['Response']['Error']['Code']
944
+ message = response['Response']['Error']['Message']
945
+ reqid = response['Response']['RequestId']
946
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
947
+ end
948
+ rescue TencentCloud::Common::TencentCloudSDKException => e
949
+ raise e
950
+ rescue StandardError => e
951
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
952
+ end
953
+
954
+ # 将设备的预付费模式修改为后付费计费模式,支持批量转换。(前提是客户要加入黑石物理机后付费计费的白名单,申请黑石物理机后付费可以联系腾讯云客服)
955
+
956
+ # @param request: Request instance for ModifyPayModePre2Post.
957
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyPayModePre2PostRequest`
958
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyPayModePre2PostResponse`
959
+ def ModifyPayModePre2Post(request)
960
+ body = send_request('ModifyPayModePre2Post', request.serialize)
961
+ response = JSON.parse(body)
962
+ if response['Response'].key?('Error') == false
963
+ model = ModifyPayModePre2PostResponse.new
964
+ model.deserialize(response['Response'])
965
+ model
966
+ else
967
+ code = response['Response']['Error']['Code']
968
+ message = response['Response']['Error']['Message']
969
+ reqid = response['Response']['RequestId']
970
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
971
+ end
972
+ rescue TencentCloud::Common::TencentCloudSDKException => e
973
+ raise e
974
+ rescue StandardError => e
975
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
976
+ end
977
+
978
+ # 允许修改规则信息及关联故障类型
979
+
980
+ # @param request: Request instance for ModifyPsaRegulation.
981
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyPsaRegulationRequest`
982
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyPsaRegulationResponse`
983
+ def ModifyPsaRegulation(request)
984
+ body = send_request('ModifyPsaRegulation', request.serialize)
985
+ response = JSON.parse(body)
986
+ if response['Response'].key?('Error') == false
987
+ model = ModifyPsaRegulationResponse.new
988
+ model.deserialize(response['Response'])
989
+ model
990
+ else
991
+ code = response['Response']['Error']['Code']
992
+ message = response['Response']['Error']['Message']
993
+ reqid = response['Response']['RequestId']
994
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
995
+ end
996
+ rescue TencentCloud::Common::TencentCloudSDKException => e
997
+ raise e
998
+ rescue StandardError => e
999
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1000
+ end
1001
+
1002
+ # 修改自定义脚本
1003
+
1004
+ # @param request: Request instance for ModifyUserCmd.
1005
+ # @type request: :class:`Tencentcloud::bm::V20180423::ModifyUserCmdRequest`
1006
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ModifyUserCmdResponse`
1007
+ def ModifyUserCmd(request)
1008
+ body = send_request('ModifyUserCmd', request.serialize)
1009
+ response = JSON.parse(body)
1010
+ if response['Response'].key?('Error') == false
1011
+ model = ModifyUserCmdResponse.new
1012
+ model.deserialize(response['Response'])
1013
+ model
1014
+ else
1015
+ code = response['Response']['Error']['Code']
1016
+ message = response['Response']['Error']['Message']
1017
+ reqid = response['Response']['RequestId']
1018
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1019
+ end
1020
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1021
+ raise e
1022
+ rescue StandardError => e
1023
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1024
+ end
1025
+
1026
+ # 销毁黑石物理机实例:可以销毁物理机列表中的竞价实例,或回收站列表中所有计费模式的实例
1027
+
1028
+ # @param request: Request instance for OfflineDevices.
1029
+ # @type request: :class:`Tencentcloud::bm::V20180423::OfflineDevicesRequest`
1030
+ # @rtype: :class:`Tencentcloud::bm::V20180423::OfflineDevicesResponse`
1031
+ def OfflineDevices(request)
1032
+ body = send_request('OfflineDevices', request.serialize)
1033
+ response = JSON.parse(body)
1034
+ if response['Response'].key?('Error') == false
1035
+ model = OfflineDevicesResponse.new
1036
+ model.deserialize(response['Response'])
1037
+ model
1038
+ else
1039
+ code = response['Response']['Error']['Code']
1040
+ message = response['Response']['Error']['Message']
1041
+ reqid = response['Response']['RequestId']
1042
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1043
+ end
1044
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1045
+ raise e
1046
+ rescue StandardError => e
1047
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1048
+ end
1049
+
1050
+ # 重启机器
1051
+
1052
+ # @param request: Request instance for RebootDevices.
1053
+ # @type request: :class:`Tencentcloud::bm::V20180423::RebootDevicesRequest`
1054
+ # @rtype: :class:`Tencentcloud::bm::V20180423::RebootDevicesResponse`
1055
+ def RebootDevices(request)
1056
+ body = send_request('RebootDevices', request.serialize)
1057
+ response = JSON.parse(body)
1058
+ if response['Response'].key?('Error') == false
1059
+ model = RebootDevicesResponse.new
1060
+ model.deserialize(response['Response'])
1061
+ model
1062
+ else
1063
+ code = response['Response']['Error']['Code']
1064
+ message = response['Response']['Error']['Message']
1065
+ reqid = response['Response']['RequestId']
1066
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1067
+ end
1068
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1069
+ raise e
1070
+ rescue StandardError => e
1071
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1072
+ end
1073
+
1074
+ # 恢复回收站中的物理机(仅限后付费的物理机)
1075
+
1076
+ # @param request: Request instance for RecoverDevices.
1077
+ # @type request: :class:`Tencentcloud::bm::V20180423::RecoverDevicesRequest`
1078
+ # @rtype: :class:`Tencentcloud::bm::V20180423::RecoverDevicesResponse`
1079
+ def RecoverDevices(request)
1080
+ body = send_request('RecoverDevices', request.serialize)
1081
+ response = JSON.parse(body)
1082
+ if response['Response'].key?('Error') == false
1083
+ model = RecoverDevicesResponse.new
1084
+ model.deserialize(response['Response'])
1085
+ model
1086
+ else
1087
+ code = response['Response']['Error']['Code']
1088
+ message = response['Response']['Error']['Message']
1089
+ reqid = response['Response']['RequestId']
1090
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1091
+ end
1092
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1093
+ raise e
1094
+ rescue StandardError => e
1095
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1096
+ end
1097
+
1098
+ # 重装操作系统
1099
+
1100
+ # @param request: Request instance for ReloadDeviceOs.
1101
+ # @type request: :class:`Tencentcloud::bm::V20180423::ReloadDeviceOsRequest`
1102
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ReloadDeviceOsResponse`
1103
+ def ReloadDeviceOs(request)
1104
+ body = send_request('ReloadDeviceOs', request.serialize)
1105
+ response = JSON.parse(body)
1106
+ if response['Response'].key?('Error') == false
1107
+ model = ReloadDeviceOsResponse.new
1108
+ model.deserialize(response['Response'])
1109
+ model
1110
+ else
1111
+ code = response['Response']['Error']['Code']
1112
+ message = response['Response']['Error']['Message']
1113
+ reqid = response['Response']['RequestId']
1114
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1115
+ end
1116
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1117
+ raise e
1118
+ rescue StandardError => e
1119
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1120
+ end
1121
+
1122
+ # 此接口用于操作维修任务<br>
1123
+ # 入参TaskId为维修任务ID<br>
1124
+ # 入参Operate表示对维修任务的操作,支持如下取值:<br>
1125
+ # AuthorizeRepair(授权维修)<br>
1126
+ # Ignore(暂不提醒)<br>
1127
+ # ConfirmRecovered(维修完成后,确认故障恢复)<br>
1128
+ # ConfirmUnRecovered(维修完成后,确认故障未恢复,该操作已不推荐用)<br>
1129
+ # NeedRepairAgain(维修完成后,故障未恢复,需要重新维修,推荐用此操作打回)<br>
1130
+ # 入参OperateRemark仅在Operate为NeedRepairAgain时有效,表示打回重修原因,建议给出打回的具体原因。<br>
1131
+ # <br>
1132
+ # 操作约束(当前任务状态(TaskStatus)->对应可执行的操作):<br>
1133
+ # 未授权(1)->授权维修;暂不处理<br>
1134
+ # 暂不处理(4)->授权维修<br>
1135
+ # 待确认(3)->确认故障恢复;确认故障未恢复;需要重新维修<br>
1136
+ # 未恢复(6)->确认故障恢复<br>
1137
+ # <br>
1138
+ # 对于Ping不可达故障的任务,还允许:<br>
1139
+ # 未授权->确认故障恢复<br>
1140
+ # 暂不处理->确认故障恢复<br>
1141
+ # <br>
1142
+ # 处理中与已恢复状态的任务不允许进行操作。<br>
1143
+ # <br>
1144
+ # 详细信息请访问:https://cloud.tencent.com/document/product/386/18190
1145
+
1146
+ # @param request: Request instance for RepairTaskControl.
1147
+ # @type request: :class:`Tencentcloud::bm::V20180423::RepairTaskControlRequest`
1148
+ # @rtype: :class:`Tencentcloud::bm::V20180423::RepairTaskControlResponse`
1149
+ def RepairTaskControl(request)
1150
+ body = send_request('RepairTaskControl', request.serialize)
1151
+ response = JSON.parse(body)
1152
+ if response['Response'].key?('Error') == false
1153
+ model = RepairTaskControlResponse.new
1154
+ model.deserialize(response['Response'])
1155
+ model
1156
+ else
1157
+ code = response['Response']['Error']['Code']
1158
+ message = response['Response']['Error']['Message']
1159
+ reqid = response['Response']['RequestId']
1160
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1161
+ end
1162
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1163
+ raise e
1164
+ rescue StandardError => e
1165
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1166
+ end
1167
+
1168
+ # 重置服务器密码
1169
+
1170
+ # @param request: Request instance for ResetDevicePassword.
1171
+ # @type request: :class:`Tencentcloud::bm::V20180423::ResetDevicePasswordRequest`
1172
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ResetDevicePasswordResponse`
1173
+ def ResetDevicePassword(request)
1174
+ body = send_request('ResetDevicePassword', request.serialize)
1175
+ response = JSON.parse(body)
1176
+ if response['Response'].key?('Error') == false
1177
+ model = ResetDevicePasswordResponse.new
1178
+ model.deserialize(response['Response'])
1179
+ model
1180
+ else
1181
+ code = response['Response']['Error']['Code']
1182
+ message = response['Response']['Error']['Message']
1183
+ reqid = response['Response']['RequestId']
1184
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1185
+ end
1186
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1187
+ raise e
1188
+ rescue StandardError => e
1189
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1190
+ end
1191
+
1192
+ # 退回物理机至回收站,支持批量退还不同计费模式的物理机(包括预付费、后付费、预付费转后付费)
1193
+
1194
+ # @param request: Request instance for ReturnDevices.
1195
+ # @type request: :class:`Tencentcloud::bm::V20180423::ReturnDevicesRequest`
1196
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ReturnDevicesResponse`
1197
+ def ReturnDevices(request)
1198
+ body = send_request('ReturnDevices', request.serialize)
1199
+ response = JSON.parse(body)
1200
+ if response['Response'].key?('Error') == false
1201
+ model = ReturnDevicesResponse.new
1202
+ model.deserialize(response['Response'])
1203
+ model
1204
+ else
1205
+ code = response['Response']['Error']['Code']
1206
+ message = response['Response']['Error']['Message']
1207
+ reqid = response['Response']['RequestId']
1208
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1209
+ end
1210
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1211
+ raise e
1212
+ rescue StandardError => e
1213
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1214
+ end
1215
+
1216
+ # 运行自定义脚本
1217
+
1218
+ # @param request: Request instance for RunUserCmd.
1219
+ # @type request: :class:`Tencentcloud::bm::V20180423::RunUserCmdRequest`
1220
+ # @rtype: :class:`Tencentcloud::bm::V20180423::RunUserCmdResponse`
1221
+ def RunUserCmd(request)
1222
+ body = send_request('RunUserCmd', request.serialize)
1223
+ response = JSON.parse(body)
1224
+ if response['Response'].key?('Error') == false
1225
+ model = RunUserCmdResponse.new
1226
+ model.deserialize(response['Response'])
1227
+ model
1228
+ else
1229
+ code = response['Response']['Error']['Code']
1230
+ message = response['Response']['Error']['Message']
1231
+ reqid = response['Response']['RequestId']
1232
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1233
+ end
1234
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1235
+ raise e
1236
+ rescue StandardError => e
1237
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1238
+ end
1239
+
1240
+ # 设置带外VPN认证用户密码
1241
+
1242
+ # @param request: Request instance for SetOutBandVpnAuthPassword.
1243
+ # @type request: :class:`Tencentcloud::bm::V20180423::SetOutBandVpnAuthPasswordRequest`
1244
+ # @rtype: :class:`Tencentcloud::bm::V20180423::SetOutBandVpnAuthPasswordResponse`
1245
+ def SetOutBandVpnAuthPassword(request)
1246
+ body = send_request('SetOutBandVpnAuthPassword', request.serialize)
1247
+ response = JSON.parse(body)
1248
+ if response['Response'].key?('Error') == false
1249
+ model = SetOutBandVpnAuthPasswordResponse.new
1250
+ model.deserialize(response['Response'])
1251
+ model
1252
+ else
1253
+ code = response['Response']['Error']['Code']
1254
+ message = response['Response']['Error']['Message']
1255
+ reqid = response['Response']['RequestId']
1256
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1257
+ end
1258
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1259
+ raise e
1260
+ rescue StandardError => e
1261
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1262
+ end
1263
+
1264
+ # 关闭服务器
1265
+
1266
+ # @param request: Request instance for ShutdownDevices.
1267
+ # @type request: :class:`Tencentcloud::bm::V20180423::ShutdownDevicesRequest`
1268
+ # @rtype: :class:`Tencentcloud::bm::V20180423::ShutdownDevicesResponse`
1269
+ def ShutdownDevices(request)
1270
+ body = send_request('ShutdownDevices', request.serialize)
1271
+ response = JSON.parse(body)
1272
+ if response['Response'].key?('Error') == false
1273
+ model = ShutdownDevicesResponse.new
1274
+ model.deserialize(response['Response'])
1275
+ model
1276
+ else
1277
+ code = response['Response']['Error']['Code']
1278
+ message = response['Response']['Error']['Message']
1279
+ reqid = response['Response']['RequestId']
1280
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1281
+ end
1282
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1283
+ raise e
1284
+ rescue StandardError => e
1285
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1286
+ end
1287
+
1288
+ # 开启服务器
1289
+
1290
+ # @param request: Request instance for StartDevices.
1291
+ # @type request: :class:`Tencentcloud::bm::V20180423::StartDevicesRequest`
1292
+ # @rtype: :class:`Tencentcloud::bm::V20180423::StartDevicesResponse`
1293
+ def StartDevices(request)
1294
+ body = send_request('StartDevices', request.serialize)
1295
+ response = JSON.parse(body)
1296
+ if response['Response'].key?('Error') == false
1297
+ model = StartDevicesResponse.new
1298
+ model.deserialize(response['Response'])
1299
+ model
1300
+ else
1301
+ code = response['Response']['Error']['Code']
1302
+ message = response['Response']['Error']['Message']
1303
+ reqid = response['Response']['RequestId']
1304
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1305
+ end
1306
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1307
+ raise e
1308
+ rescue StandardError => e
1309
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1310
+ end
1311
+
1312
+ # 解除标签与预授权规则的绑定
1313
+
1314
+ # @param request: Request instance for UnbindPsaTag.
1315
+ # @type request: :class:`Tencentcloud::bm::V20180423::UnbindPsaTagRequest`
1316
+ # @rtype: :class:`Tencentcloud::bm::V20180423::UnbindPsaTagResponse`
1317
+ def UnbindPsaTag(request)
1318
+ body = send_request('UnbindPsaTag', request.serialize)
1319
+ response = JSON.parse(body)
1320
+ if response['Response'].key?('Error') == false
1321
+ model = UnbindPsaTagResponse.new
1322
+ model.deserialize(response['Response'])
1323
+ model
1324
+ else
1325
+ code = response['Response']['Error']['Code']
1326
+ message = response['Response']['Error']['Message']
1327
+ reqid = response['Response']['RequestId']
1328
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1329
+ end
1330
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1331
+ raise e
1332
+ rescue StandardError => e
1333
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1334
+ end
1335
+
1336
+
1337
+ end
1338
+ end
1339
+ end
1340
+ end