-
Notifications
You must be signed in to change notification settings - Fork 16
/
client.rb
1141 lines (1021 loc) · 60.7 KB
/
client.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'json'
module TencentCloud
module Cbs
module V20170312
class Client < TencentCloud::Common::AbstractClient
def initialize(credential, region, profile = nil)
api_version = '2017-03-12'
api_endpoint = 'cbs.tencentcloudapi.com'
sdk_version = 'CBS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
super(credential, region, api_version, api_endpoint, sdk_version, profile)
end
# 本接口(ApplyDiskBackup)用于回滚备份点到原云硬盘。
# * 仅支持回滚到原云硬盘上。对于数据盘备份点,如果您需要复制备份点数据到其它云硬盘上,请先使用 CreateSnapshot 将备份点转换为快照,然后使用 CreateDisks 接口创建新的弹性云硬盘,将快照数据复制到新购云硬盘上。
# * 用于回滚的备份点必须处于NORMAL状态。备份点状态可以通过DescribeDiskBackups接口查询,见输出参数中BackupState字段解释。
# * 如果是弹性云硬盘,则云硬盘必须处于未挂载状态,云硬盘挂载状态可以通过DescribeDisks接口查询,见Attached字段解释;如果是随实例一起购买的非弹性云硬盘,则实例必须处于关机状态,实例状态可以通过DescribeInstancesStatus接口查询。
# @param request: Request instance for ApplyDiskBackup.
# @type request: :class:`Tencentcloud::cbs::V20170312::ApplyDiskBackupRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ApplyDiskBackupResponse`
def ApplyDiskBackup(request)
body = send_request('ApplyDiskBackup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ApplyDiskBackupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ApplySnapshot)用于回滚快照到原云硬盘。
# * 仅支持回滚到原云硬盘上。对于数据盘快照,如果您需要复制快照数据到其它云硬盘上,请使用[CreateDisks](/document/product/362/16312)接口创建新的弹性云盘,将快照数据复制到新购云盘上。
# * 用于回滚的快照必须处于NORMAL状态。快照状态可以通过[DescribeSnapshots](/document/product/362/15647)接口查询,见输出参数中SnapshotState字段解释。
# * 如果是弹性云盘,则云盘必须处于未挂载状态,云硬盘挂载状态可以通过[DescribeDisks](/document/product/362/16315)接口查询,见Attached字段解释;如果是随实例一起购买的非弹性云盘,则实例必须处于关机状态,实例状态可以通过[DescribeInstancesStatus](/document/product/213/15738)接口查询。
# @param request: Request instance for ApplySnapshot.
# @type request: :class:`Tencentcloud::cbs::V20170312::ApplySnapshotRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ApplySnapshotResponse`
def ApplySnapshot(request)
body = send_request('ApplySnapshot', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ApplySnapshotResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(AttachDisks)用于挂载云硬盘。
# * 支持批量操作,将多块云盘挂载到同一云主机。如果多个云盘中存在不允许挂载的云盘,则操作不执行,返回特定的错误码。
# * 本接口为异步接口,当挂载云盘的请求成功返回时,表示后台已发起挂载云盘的操作,可通过接口[DescribeDisks](/document/product/362/16315)来查询对应云盘的状态,如果云盘的状态由“ATTACHING”变为“ATTACHED”,则为挂载成功。
# @param request: Request instance for AttachDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::AttachDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::AttachDisksResponse`
def AttachDisks(request)
body = send_request('AttachDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AttachDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(BindAutoSnapshotPolicy)用于绑定云硬盘到指定的定期快照策略。
# * 每个地域下的定期快照策略配额限制请参考文档[定期快照](/document/product/362/8191)。
# * 当已绑定定期快照策略的云硬盘处于未使用状态(即弹性云盘未挂载或非弹性云盘的主机处于关机状态)将不会创建定期快照。
# @param request: Request instance for BindAutoSnapshotPolicy.
# @type request: :class:`Tencentcloud::cbs::V20170312::BindAutoSnapshotPolicyRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::BindAutoSnapshotPolicyResponse`
def BindAutoSnapshotPolicy(request)
body = send_request('BindAutoSnapshotPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = BindAutoSnapshotPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CopySnapshotCrossRegions)用于快照跨地域复制。
# * 本接口为异步接口,当跨地域复制的请求下发成功后会返回一个新的快照ID,此时快照未立即复制到目标地域,可请求目标地域的[DescribeSnapshots](/document/product/362/15647)接口查询新快照的状态,判断是否复制完成。如果快照的状态为“NORMAL”,表示快照复制完成。
# * 本接口实现的快照跨地域复制操作将产生跨地域流量,预计2022年第三季度会针对此功能进行商业化计费;请留意后续站内信公告,避免产生预期外扣费。
# @param request: Request instance for CopySnapshotCrossRegions.
# @type request: :class:`Tencentcloud::cbs::V20170312::CopySnapshotCrossRegionsRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::CopySnapshotCrossRegionsResponse`
def CopySnapshotCrossRegions(request)
body = send_request('CopySnapshotCrossRegions', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CopySnapshotCrossRegionsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateAutoSnapshotPolicy)用于创建定期快照策略。
# * 每个地域可创建的定期快照策略数量限制请参考文档[定期快照](/document/product/362/8191)。
# * 每个地域可创建的快照有数量和容量的限制,具体请见腾讯云控制台快照页面提示,如果快照超配额,定期快照创建会失败。
# @param request: Request instance for CreateAutoSnapshotPolicy.
# @type request: :class:`Tencentcloud::cbs::V20170312::CreateAutoSnapshotPolicyRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::CreateAutoSnapshotPolicyResponse`
def CreateAutoSnapshotPolicy(request)
body = send_request('CreateAutoSnapshotPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAutoSnapshotPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 为云硬盘创建一个备份点。
# @param request: Request instance for CreateDiskBackup.
# @type request: :class:`Tencentcloud::cbs::V20170312::CreateDiskBackupRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::CreateDiskBackupResponse`
def CreateDiskBackup(request)
body = send_request('CreateDiskBackup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDiskBackupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDisks)用于创建云硬盘。
# * 预付费云盘的购买会预先扣除本次云盘购买所需金额,在调用本接口前请确保账户余额充足。
# * 本接口支持传入数据盘快照来创建云盘,实现将快照数据复制到新购云盘上。
# * 本接口为异步接口,当创建请求下发成功后会返回一个新建的云盘ID列表,此时云盘的创建并未立即完成。可以通过调用[DescribeDisks](/document/product/362/16315)接口根据DiskId查询对应云盘,如果能查到云盘,且状态为'UNATTACHED'或'ATTACHED',则表示创建成功。
# @param request: Request instance for CreateDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::CreateDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::CreateDisksResponse`
def CreateDisks(request)
body = send_request('CreateDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateSnapshot)用于对指定云盘创建快照。
# * 只有具有快照能力的云硬盘才能创建快照。云硬盘是否具有快照能力可由[DescribeDisks](/document/product/362/16315)接口查询,见SnapshotAbility字段。
# * 可创建快照数量限制见[产品使用限制](https://cloud.tencent.com/doc/product/362/5145)。
# * 当前支持将备份点转化为普通快照,转化之后可能会收取快照使用费用,备份点不保留,其占用的备份点配额也将被释放。
# @param request: Request instance for CreateSnapshot.
# @type request: :class:`Tencentcloud::cbs::V20170312::CreateSnapshotRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::CreateSnapshotResponse`
def CreateSnapshot(request)
body = send_request('CreateSnapshot', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateSnapshotResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteAutoSnapshotPolicies)用于删除定期快照策略。
# * 支持批量操作。如果多个定期快照策略存在无法删除的,则操作不执行,以特定错误码返回。
# @param request: Request instance for DeleteAutoSnapshotPolicies.
# @type request: :class:`Tencentcloud::cbs::V20170312::DeleteAutoSnapshotPoliciesRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DeleteAutoSnapshotPoliciesResponse`
def DeleteAutoSnapshotPolicies(request)
body = send_request('DeleteAutoSnapshotPolicies', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAutoSnapshotPoliciesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 批量删除指定的云硬盘备份点。
# @param request: Request instance for DeleteDiskBackups.
# @type request: :class:`Tencentcloud::cbs::V20170312::DeleteDiskBackupsRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DeleteDiskBackupsResponse`
def DeleteDiskBackups(request)
body = send_request('DeleteDiskBackups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteDiskBackupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteSnapshots)用于删除快照。
# * 快照必须处于NORMAL状态,快照状态可以通过[DescribeSnapshots](/document/product/362/15647)接口查询,见输出参数中SnapshotState字段解释。
# * 支持批量操作。如果多个快照存在无法删除的快照,则操作不执行,以特定的错误码返回。
# @param request: Request instance for DeleteSnapshots.
# @type request: :class:`Tencentcloud::cbs::V20170312::DeleteSnapshotsRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DeleteSnapshotsResponse`
def DeleteSnapshots(request)
body = send_request('DeleteSnapshots', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteSnapshotsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAutoSnapshotPolicies)用于查询定期快照策略。
# * 可以根据定期快照策略ID、名称或者状态等信息来查询定期快照策略的详细信息,不同条件之间为与(AND)的关系,过滤信息详细请见过滤器`Filter`。
# * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的定期快照策略表。
# @param request: Request instance for DescribeAutoSnapshotPolicies.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeAutoSnapshotPoliciesRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeAutoSnapshotPoliciesResponse`
def DescribeAutoSnapshotPolicies(request)
body = send_request('DescribeAutoSnapshotPolicies', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAutoSnapshotPoliciesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDiskAssociatedAutoSnapshotPolicy)用于查询云盘绑定的定期快照策略。
# @param request: Request instance for DescribeDiskAssociatedAutoSnapshotPolicy.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeDiskAssociatedAutoSnapshotPolicyRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeDiskAssociatedAutoSnapshotPolicyResponse`
def DescribeDiskAssociatedAutoSnapshotPolicy(request)
body = send_request('DescribeDiskAssociatedAutoSnapshotPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDiskAssociatedAutoSnapshotPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDiskBackups)用于查询备份点的详细信息。
# 根据备份点ID、创建备份点的云硬盘ID、创建备份点的云硬盘类型等对结果进行过滤,不同条件之间为与(AND)的关系,过滤信息详细请见过滤器Filter。
# 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的备份点列表。
# @param request: Request instance for DescribeDiskBackups.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeDiskBackupsRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeDiskBackupsResponse`
def DescribeDiskBackups(request)
body = send_request('DescribeDiskBackups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDiskBackupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDiskConfigQuota)用于查询云硬盘配额。
# @param request: Request instance for DescribeDiskConfigQuota.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeDiskConfigQuotaRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeDiskConfigQuotaResponse`
def DescribeDiskConfigQuota(request)
body = send_request('DescribeDiskConfigQuota', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDiskConfigQuotaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDiskStoragePool)查询用户的云硬盘独享集群列表。
# * 可以根据独享集群ID(CdcId)、可用区(zone)等信息来查询和过滤云硬盘独享集群详细信息,不同的过滤条件之间为与(AND)的关系,过滤信息详细请见过滤器`Filter`。
# * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的云硬盘独享集群列表。
# @param request: Request instance for DescribeDiskStoragePool.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeDiskStoragePoolRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeDiskStoragePoolResponse`
def DescribeDiskStoragePool(request)
body = send_request('DescribeDiskStoragePool', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDiskStoragePoolResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDisks)用于查询云硬盘列表。
# * 可以根据云硬盘ID、云硬盘类型或者云硬盘状态等信息来查询云硬盘的详细信息,不同条件之间为与(AND)的关系,过滤信息详细请见过滤器`Filter`。
# * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的云硬盘列表。
# @param request: Request instance for DescribeDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeDisksResponse`
def DescribeDisks(request)
body = send_request('DescribeDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeInstancesDiskNum)用于查询实例已挂载云硬盘数量。
# * 支持批量操作,当传入多个云服务器实例ID,返回结果会分别列出每个云服务器挂载的云硬盘数量。
# @param request: Request instance for DescribeInstancesDiskNum.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeInstancesDiskNumRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeInstancesDiskNumResponse`
def DescribeInstancesDiskNum(request)
body = send_request('DescribeInstancesDiskNum', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstancesDiskNumResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口用于查询用户快照使用概览,包括快照总容量、计费容量等信息。
# @param request: Request instance for DescribeSnapshotOverview.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotOverviewRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotOverviewResponse`
def DescribeSnapshotOverview(request)
body = send_request('DescribeSnapshotOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSnapshotOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeSnapshotSharePermission)用于查询快照的分享信息。
# @param request: Request instance for DescribeSnapshotSharePermission.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotSharePermissionRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotSharePermissionResponse`
def DescribeSnapshotSharePermission(request)
body = send_request('DescribeSnapshotSharePermission', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSnapshotSharePermissionResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeSnapshots)用于查询快照的详细信息。
# * 根据快照ID、创建快照的云硬盘ID、创建快照的云硬盘类型等对结果进行过滤,不同条件之间为与(AND)的关系,过滤信息详细请见过滤器`Filter`。
# * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的快照列表。
# @param request: Request instance for DescribeSnapshots.
# @type request: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotsRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DescribeSnapshotsResponse`
def DescribeSnapshots(request)
body = send_request('DescribeSnapshots', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSnapshotsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DetachDisks)用于卸载云硬盘。
# * 支持批量操作,卸载挂载在同一主机上的多块云盘。如果多块云盘中存在不允许卸载的云盘,则操作不执行,返回特定的错误码。
# * 本接口为异步接口,当请求成功返回时,云盘并未立即从主机卸载,可通过接口[DescribeDisks](/document/product/362/16315)来查询对应云盘的状态,如果云盘的状态由“ATTACHED”变为“UNATTACHED”,则为卸载成功。
# @param request: Request instance for DetachDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::DetachDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::DetachDisksResponse`
def DetachDisks(request)
body = send_request('DetachDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DetachDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 为进一步规范化API命名,该接口决定预下线,新接口命名为:DescribeSnapshotOverview
# 获取快照概览信息
# @param request: Request instance for GetSnapOverview.
# @type request: :class:`Tencentcloud::cbs::V20170312::GetSnapOverviewRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::GetSnapOverviewResponse`
def GetSnapOverview(request)
body = send_request('GetSnapOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = GetSnapOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 重新初始化云硬盘至云硬盘初始创建时的状态。使用云硬盘的重新初始化功能时需要注意以下4点:
# 1. 如果云硬盘是由快照创建的,则重新初始化会通过此快照重新回滚此云硬盘,即将云硬盘恢复为与快照一致的状态;
# 2. 如果云硬盘不是通过快照创建的,则重新初始化会清空此云硬盘的数据;请在重新初始化云硬盘前检查并备份必要的数据;
# 3. 当前仅未挂载的、非共享属性的数据盘云硬盘支持重新初始化;
# 4. 当创建此云硬盘的原始快照被删除时,不再支持重新初始化此云硬盘。
# @param request: Request instance for InitializeDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::InitializeDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InitializeDisksResponse`
def InitializeDisks(request)
body = send_request('InitializeDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InitializeDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquirePricePriceModifyDiskBackupQuota)用于修改云硬盘备份点配额询价。
# @param request: Request instance for InquirePriceModifyDiskBackupQuota.
# @type request: :class:`Tencentcloud::cbs::V20170312::InquirePriceModifyDiskBackupQuotaRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InquirePriceModifyDiskBackupQuotaResponse`
def InquirePriceModifyDiskBackupQuota(request)
body = send_request('InquirePriceModifyDiskBackupQuota', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquirePriceModifyDiskBackupQuotaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquirePriceModifyDiskExtraPerformance)用于调整云硬盘额外性能询价。
# @param request: Request instance for InquirePriceModifyDiskExtraPerformance.
# @type request: :class:`Tencentcloud::cbs::V20170312::InquirePriceModifyDiskExtraPerformanceRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InquirePriceModifyDiskExtraPerformanceResponse`
def InquirePriceModifyDiskExtraPerformance(request)
body = send_request('InquirePriceModifyDiskExtraPerformance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquirePriceModifyDiskExtraPerformanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquiryPriceCreateDisks)用于创建云硬盘询价。
# * 支持查询创建多块云硬盘的价格,此时返回结果为总价格。
# @param request: Request instance for InquiryPriceCreateDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::InquiryPriceCreateDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InquiryPriceCreateDisksResponse`
def InquiryPriceCreateDisks(request)
body = send_request('InquiryPriceCreateDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceCreateDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquiryPriceRenewDisks)用于续费云硬盘询价。
# * 只支持查询预付费模式的弹性云盘续费价格。
# * 支持与挂载实例一起续费的场景,需要在[DiskChargePrepaid](/document/product/362/15669#DiskChargePrepaid)参数中指定CurInstanceDeadline,此时会按对齐到实例续费后的到期时间来续费询价。
# * 支持为多块云盘指定不同的续费时长,此时返回的价格为多块云盘续费的总价格。
# @param request: Request instance for InquiryPriceRenewDisks.
# @type request: :class:`Tencentcloud::cbs::V20170312::InquiryPriceRenewDisksRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InquiryPriceRenewDisksResponse`
def InquiryPriceRenewDisks(request)
body = send_request('InquiryPriceRenewDisks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceRenewDisksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquiryPriceResizeDisk)用于扩容云硬盘询价。
# @param request: Request instance for InquiryPriceResizeDisk.
# @type request: :class:`Tencentcloud::cbs::V20170312::InquiryPriceResizeDiskRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::InquiryPriceResizeDiskResponse`
def InquiryPriceResizeDisk(request)
body = send_request('InquiryPriceResizeDisk', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceResizeDiskResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ModifyAutoSnapshotPolicyAttribute)用于修改定期快照策略属性。
# * 可通过该接口修改定期快照策略的执行策略、名称、是否激活等属性。
# * 修改保留天数时必须保证不与是否永久保留属性冲突,否则整个操作失败,以特定的错误码返回。
# @param request: Request instance for ModifyAutoSnapshotPolicyAttribute.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyAutoSnapshotPolicyAttributeRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyAutoSnapshotPolicyAttributeResponse`
def ModifyAutoSnapshotPolicyAttribute(request)
body = send_request('ModifyAutoSnapshotPolicyAttribute', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAutoSnapshotPolicyAttributeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# * 只支持修改弹性云盘的项目ID。随云主机创建的云硬盘项目ID与云主机联动。可以通过[DescribeDisks](/document/product/362/16315)接口查询,见输出参数中Portable字段解释。
# * “云硬盘名称”仅为方便用户自己管理之用,腾讯云并不以此名称作为提交工单或是进行云盘管理操作的依据。
# * 支持批量操作,如果传入多个云盘ID,则所有云盘修改为同一属性。如果存在不允许操作的云盘,则操作不执行,以特定错误码返回。
# @param request: Request instance for ModifyDiskAttributes.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyDiskAttributesRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyDiskAttributesResponse`
def ModifyDiskAttributes(request)
body = send_request('ModifyDiskAttributes', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDiskAttributesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 此接口 (ModifyDiskBackupQuota) 用于修改云硬盘备份点配额。
# @param request: Request instance for ModifyDiskBackupQuota.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyDiskBackupQuotaRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyDiskBackupQuotaResponse`
def ModifyDiskBackupQuota(request)
body = send_request('ModifyDiskBackupQuota', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDiskBackupQuotaResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ModifyDiskExtraPerformance)用于调整云硬盘额外的性能。
# * 目前仅支持增强型SSD云硬盘(CLOUD_HSSD)和极速型SSD云硬盘(CLOUD_TSSD)。
# @param request: Request instance for ModifyDiskExtraPerformance.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyDiskExtraPerformanceRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyDiskExtraPerformanceResponse`
def ModifyDiskExtraPerformance(request)
body = send_request('ModifyDiskExtraPerformance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDiskExtraPerformanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口 (ModifyDisksChargeType) 用于切换云硬盘的计费模式。
# 非弹性云硬盘不支持此接口,请通过修改实例计费模式接口将实例连同非弹性云硬盘一起转换。
# 默认接口请求频率限制:10次/秒。
# @param request: Request instance for ModifyDisksChargeType.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyDisksChargeTypeRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyDisksChargeTypeResponse`
def ModifyDisksChargeType(request)
body = send_request('ModifyDisksChargeType', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDisksChargeTypeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ModifyDisksRenewFlag)用于修改云硬盘续费标识,支持批量修改。
# @param request: Request instance for ModifyDisksRenewFlag.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifyDisksRenewFlagRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifyDisksRenewFlagResponse`
def ModifyDisksRenewFlag(request)
body = send_request('ModifyDisksRenewFlag', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDisksRenewFlagResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ModifySnapshotAttribute)用于修改指定快照的属性。
# * 本接口支持修改快照名称及到期时间,以及将非永久快照修改为永久快照。
# * “快照名称”仅为方便用户管理之用,腾讯云并不以此名称作为提交工单或是进行快照管理操作的依据。
# @param request: Request instance for ModifySnapshotAttribute.
# @type request: :class:`Tencentcloud::cbs::V20170312::ModifySnapshotAttributeRequest`
# @rtype: :class:`Tencentcloud::cbs::V20170312::ModifySnapshotAttributeResponse`
def ModifySnapshotAttribute(request)
body = send_request('ModifySnapshotAttribute', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifySnapshotAttributeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(ModifySnapshotsSharePermission)用于修改快照分享信息。
# 分享快照后,被分享账户可以通过该快照创建云硬盘。