tencentcloud-sdk-as 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1301 @@
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 As
21
+ module V20180419
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-04-19'
26
+ api_endpoint = 'as.tencentcloudapi.com'
27
+ sdk_version = 'AS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 本接口(AttachInstances)用于将 CVM 实例添加到伸缩组。
33
+
34
+ # @param request: Request instance for AttachInstances.
35
+ # @type request: :class:`Tencentcloud::as::V20180419::AttachInstancesRequest`
36
+ # @rtype: :class:`Tencentcloud::as::V20180419::AttachInstancesResponse`
37
+ def AttachInstances(request)
38
+ body = send_request('AttachInstances', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = AttachInstancesResponse.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
+ # 本接口(ClearLaunchConfigurationAttributes)用于将启动配置内的特定属性完全清空。
57
+
58
+ # @param request: Request instance for ClearLaunchConfigurationAttributes.
59
+ # @type request: :class:`Tencentcloud::as::V20180419::ClearLaunchConfigurationAttributesRequest`
60
+ # @rtype: :class:`Tencentcloud::as::V20180419::ClearLaunchConfigurationAttributesResponse`
61
+ def ClearLaunchConfigurationAttributes(request)
62
+ body = send_request('ClearLaunchConfigurationAttributes', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = ClearLaunchConfigurationAttributesResponse.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
+ # 本接口(CompleteLifecycleAction)用于完成生命周期动作。
81
+
82
+ # * 用户通过调用本接口,指定一个具体的生命周期挂钩的结果(“CONITNUE”或者“ABANDON”)。如果一直不调用本接口,则生命周期挂钩会在超时后按照“DefaultResult”进行处理。
83
+
84
+ # @param request: Request instance for CompleteLifecycleAction.
85
+ # @type request: :class:`Tencentcloud::as::V20180419::CompleteLifecycleActionRequest`
86
+ # @rtype: :class:`Tencentcloud::as::V20180419::CompleteLifecycleActionResponse`
87
+ def CompleteLifecycleAction(request)
88
+ body = send_request('CompleteLifecycleAction', request.serialize)
89
+ response = JSON.parse(body)
90
+ if response['Response'].key?('Error') == false
91
+ model = CompleteLifecycleActionResponse.new
92
+ model.deserialize(response['Response'])
93
+ model
94
+ else
95
+ code = response['Response']['Error']['Code']
96
+ message = response['Response']['Error']['Message']
97
+ reqid = response['Response']['RequestId']
98
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
99
+ end
100
+ rescue TencentCloud::Common::TencentCloudSDKException => e
101
+ raise e
102
+ rescue StandardError => e
103
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
104
+ end
105
+
106
+ # 本接口(CreateAutoScalingGroup)用于创建伸缩组
107
+
108
+ # @param request: Request instance for CreateAutoScalingGroup.
109
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateAutoScalingGroupRequest`
110
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateAutoScalingGroupResponse`
111
+ def CreateAutoScalingGroup(request)
112
+ body = send_request('CreateAutoScalingGroup', request.serialize)
113
+ response = JSON.parse(body)
114
+ if response['Response'].key?('Error') == false
115
+ model = CreateAutoScalingGroupResponse.new
116
+ model.deserialize(response['Response'])
117
+ model
118
+ else
119
+ code = response['Response']['Error']['Code']
120
+ message = response['Response']['Error']['Message']
121
+ reqid = response['Response']['RequestId']
122
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
123
+ end
124
+ rescue TencentCloud::Common::TencentCloudSDKException => e
125
+ raise e
126
+ rescue StandardError => e
127
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
128
+ end
129
+
130
+ # 本接口(CreateAutoScalingGroupFromInstance)用于根据实例创建启动配置及伸缩组。
131
+
132
+ # 说明:根据按包年包月计费的实例所创建的伸缩组,其扩容的实例为按量计费实例。
133
+
134
+ # @param request: Request instance for CreateAutoScalingGroupFromInstance.
135
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateAutoScalingGroupFromInstanceRequest`
136
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateAutoScalingGroupFromInstanceResponse`
137
+ def CreateAutoScalingGroupFromInstance(request)
138
+ body = send_request('CreateAutoScalingGroupFromInstance', request.serialize)
139
+ response = JSON.parse(body)
140
+ if response['Response'].key?('Error') == false
141
+ model = CreateAutoScalingGroupFromInstanceResponse.new
142
+ model.deserialize(response['Response'])
143
+ model
144
+ else
145
+ code = response['Response']['Error']['Code']
146
+ message = response['Response']['Error']['Message']
147
+ reqid = response['Response']['RequestId']
148
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
149
+ end
150
+ rescue TencentCloud::Common::TencentCloudSDKException => e
151
+ raise e
152
+ rescue StandardError => e
153
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
154
+ end
155
+
156
+ # 本接口(CreateLaunchConfiguration)用于创建新的启动配置。
157
+
158
+ # * 启动配置,可以通过 `ModifyLaunchConfigurationAttributes` 修改少量字段。如需使用新的启动配置,建议重新创建启动配置。
159
+
160
+ # * 每个项目最多只能创建20个启动配置,详见[使用限制](https://cloud.tencent.com/document/product/377/3120)。
161
+
162
+ # @param request: Request instance for CreateLaunchConfiguration.
163
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateLaunchConfigurationRequest`
164
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateLaunchConfigurationResponse`
165
+ def CreateLaunchConfiguration(request)
166
+ body = send_request('CreateLaunchConfiguration', request.serialize)
167
+ response = JSON.parse(body)
168
+ if response['Response'].key?('Error') == false
169
+ model = CreateLaunchConfigurationResponse.new
170
+ model.deserialize(response['Response'])
171
+ model
172
+ else
173
+ code = response['Response']['Error']['Code']
174
+ message = response['Response']['Error']['Message']
175
+ reqid = response['Response']['RequestId']
176
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
177
+ end
178
+ rescue TencentCloud::Common::TencentCloudSDKException => e
179
+ raise e
180
+ rescue StandardError => e
181
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
182
+ end
183
+
184
+ # 本接口(CreateLifecycleHook)用于创建生命周期挂钩。
185
+
186
+ # * 您可以为生命周期挂钩配置消息通知,弹性伸缩会通知您的CMQ消息队列,通知内容形如:
187
+
188
+ # ```
189
+ # {
190
+ # "Service": "Tencent Cloud Auto Scaling",
191
+ # "Time": "2019-03-14T10:15:11Z",
192
+ # "AppId": "1251783334",
193
+ # "ActivityId": "asa-fznnvrja",
194
+ # "AutoScalingGroupId": "asg-rrrrtttt",
195
+ # "LifecycleHookId": "ash-xxxxyyyy",
196
+ # "LifecycleHookName": "my-hook",
197
+ # "LifecycleActionToken": "3080e1c9-0efe-4dd7-ad3b-90cd6618298f",
198
+ # "InstanceId": "ins-aaaabbbb",
199
+ # "LifecycleTransition": "INSTANCE_LAUNCHING",
200
+ # "NotificationMetadata": ""
201
+ # }
202
+ # ```
203
+
204
+ # @param request: Request instance for CreateLifecycleHook.
205
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateLifecycleHookRequest`
206
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateLifecycleHookResponse`
207
+ def CreateLifecycleHook(request)
208
+ body = send_request('CreateLifecycleHook', request.serialize)
209
+ response = JSON.parse(body)
210
+ if response['Response'].key?('Error') == false
211
+ model = CreateLifecycleHookResponse.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
+ # 本接口(CreateNotificationConfiguration)用于创建通知。
227
+ # 通知到 CMQ 主题或队列时,消息内容如下:
228
+ # ```
229
+ # {
230
+ # "Service": "Tencent Cloud Auto Scaling",
231
+ # "CreatedTime": "2021-10-11T10:15:11Z", // 活动创建时间
232
+ # "AppId": "100000000",
233
+ # "ActivityId": "asa-fznnvrja", // 伸缩活动ID
234
+ # "AutoScalingGroupId": "asg-pc2oqu2z", // 伸缩组ID
235
+ # "ActivityType": "SCALE_OUT", // 伸缩活动类型
236
+ # "StatusCode": "SUCCESSFUL", // 伸缩活动结果
237
+ # "Description": "Activity was launched in response to a difference between desired capacity and actual capacity,
238
+ # scale out 1 instance(s).", // 伸缩活动描述
239
+ # "StartTime": "2021-10-11T10:15:11Z", // 活动开始时间
240
+ # "EndTime": "2021-10-11T10:15:32Z", // 活动结束时间
241
+ # "DetailedStatusMessageSet": [ // 活动内部错误集合(非空不代表活动失败)
242
+ # {
243
+ # "Code": "InvalidInstanceType",
244
+ # "Zone": "ap-guangzhou-2",
245
+ # "InstanceId": "",
246
+ # "InstanceChargeType": "POSTPAID_BY_HOUR",
247
+ # "SubnetId": "subnet-4t5mgeuu",
248
+ # "Message": "The specified instance type `S5.LARGE8` is invalid in `subnet-4t5mgeuu`, `ap-guangzhou-2`.",
249
+ # "InstanceType": "S5.LARGE8"
250
+ # }
251
+ # ]
252
+ # }
253
+ # ```
254
+
255
+ # @param request: Request instance for CreateNotificationConfiguration.
256
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateNotificationConfigurationRequest`
257
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateNotificationConfigurationResponse`
258
+ def CreateNotificationConfiguration(request)
259
+ body = send_request('CreateNotificationConfiguration', request.serialize)
260
+ response = JSON.parse(body)
261
+ if response['Response'].key?('Error') == false
262
+ model = CreateNotificationConfigurationResponse.new
263
+ model.deserialize(response['Response'])
264
+ model
265
+ else
266
+ code = response['Response']['Error']['Code']
267
+ message = response['Response']['Error']['Message']
268
+ reqid = response['Response']['RequestId']
269
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
270
+ end
271
+ rescue TencentCloud::Common::TencentCloudSDKException => e
272
+ raise e
273
+ rescue StandardError => e
274
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
275
+ end
276
+
277
+ # 本接口 (CreatePaiInstance) 用于创建一个指定配置的PAI实例。
278
+
279
+ # @param request: Request instance for CreatePaiInstance.
280
+ # @type request: :class:`Tencentcloud::as::V20180419::CreatePaiInstanceRequest`
281
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreatePaiInstanceResponse`
282
+ def CreatePaiInstance(request)
283
+ body = send_request('CreatePaiInstance', request.serialize)
284
+ response = JSON.parse(body)
285
+ if response['Response'].key?('Error') == false
286
+ model = CreatePaiInstanceResponse.new
287
+ model.deserialize(response['Response'])
288
+ model
289
+ else
290
+ code = response['Response']['Error']['Code']
291
+ message = response['Response']['Error']['Message']
292
+ reqid = response['Response']['RequestId']
293
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
294
+ end
295
+ rescue TencentCloud::Common::TencentCloudSDKException => e
296
+ raise e
297
+ rescue StandardError => e
298
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
299
+ end
300
+
301
+ # 本接口(CreateScalingPolicy)用于创建告警触发策略。
302
+
303
+ # @param request: Request instance for CreateScalingPolicy.
304
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateScalingPolicyRequest`
305
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateScalingPolicyResponse`
306
+ def CreateScalingPolicy(request)
307
+ body = send_request('CreateScalingPolicy', request.serialize)
308
+ response = JSON.parse(body)
309
+ if response['Response'].key?('Error') == false
310
+ model = CreateScalingPolicyResponse.new
311
+ model.deserialize(response['Response'])
312
+ model
313
+ else
314
+ code = response['Response']['Error']['Code']
315
+ message = response['Response']['Error']['Message']
316
+ reqid = response['Response']['RequestId']
317
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
318
+ end
319
+ rescue TencentCloud::Common::TencentCloudSDKException => e
320
+ raise e
321
+ rescue StandardError => e
322
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
323
+ end
324
+
325
+ # 本接口(CreateScheduledAction)用于创建定时任务。
326
+
327
+ # @param request: Request instance for CreateScheduledAction.
328
+ # @type request: :class:`Tencentcloud::as::V20180419::CreateScheduledActionRequest`
329
+ # @rtype: :class:`Tencentcloud::as::V20180419::CreateScheduledActionResponse`
330
+ def CreateScheduledAction(request)
331
+ body = send_request('CreateScheduledAction', request.serialize)
332
+ response = JSON.parse(body)
333
+ if response['Response'].key?('Error') == false
334
+ model = CreateScheduledActionResponse.new
335
+ model.deserialize(response['Response'])
336
+ model
337
+ else
338
+ code = response['Response']['Error']['Code']
339
+ message = response['Response']['Error']['Message']
340
+ reqid = response['Response']['RequestId']
341
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
342
+ end
343
+ rescue TencentCloud::Common::TencentCloudSDKException => e
344
+ raise e
345
+ rescue StandardError => e
346
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
347
+ end
348
+
349
+ # 本接口(DeleteAutoScalingGroup)用于删除指定伸缩组,删除前提是伸缩组内无实例且当前未在执行伸缩活动。
350
+
351
+ # @param request: Request instance for DeleteAutoScalingGroup.
352
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteAutoScalingGroupRequest`
353
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteAutoScalingGroupResponse`
354
+ def DeleteAutoScalingGroup(request)
355
+ body = send_request('DeleteAutoScalingGroup', request.serialize)
356
+ response = JSON.parse(body)
357
+ if response['Response'].key?('Error') == false
358
+ model = DeleteAutoScalingGroupResponse.new
359
+ model.deserialize(response['Response'])
360
+ model
361
+ else
362
+ code = response['Response']['Error']['Code']
363
+ message = response['Response']['Error']['Message']
364
+ reqid = response['Response']['RequestId']
365
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
366
+ end
367
+ rescue TencentCloud::Common::TencentCloudSDKException => e
368
+ raise e
369
+ rescue StandardError => e
370
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
371
+ end
372
+
373
+ # 本接口(DeleteLaunchConfiguration)用于删除启动配置。
374
+
375
+ # * 若启动配置在伸缩组中属于生效状态,则该启动配置不允许删除。
376
+
377
+ # @param request: Request instance for DeleteLaunchConfiguration.
378
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteLaunchConfigurationRequest`
379
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteLaunchConfigurationResponse`
380
+ def DeleteLaunchConfiguration(request)
381
+ body = send_request('DeleteLaunchConfiguration', request.serialize)
382
+ response = JSON.parse(body)
383
+ if response['Response'].key?('Error') == false
384
+ model = DeleteLaunchConfigurationResponse.new
385
+ model.deserialize(response['Response'])
386
+ model
387
+ else
388
+ code = response['Response']['Error']['Code']
389
+ message = response['Response']['Error']['Message']
390
+ reqid = response['Response']['RequestId']
391
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
392
+ end
393
+ rescue TencentCloud::Common::TencentCloudSDKException => e
394
+ raise e
395
+ rescue StandardError => e
396
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
397
+ end
398
+
399
+ # 本接口(DeleteLifecycleHook)用于删除生命周期挂钩。
400
+
401
+ # @param request: Request instance for DeleteLifecycleHook.
402
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteLifecycleHookRequest`
403
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteLifecycleHookResponse`
404
+ def DeleteLifecycleHook(request)
405
+ body = send_request('DeleteLifecycleHook', request.serialize)
406
+ response = JSON.parse(body)
407
+ if response['Response'].key?('Error') == false
408
+ model = DeleteLifecycleHookResponse.new
409
+ model.deserialize(response['Response'])
410
+ model
411
+ else
412
+ code = response['Response']['Error']['Code']
413
+ message = response['Response']['Error']['Message']
414
+ reqid = response['Response']['RequestId']
415
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
416
+ end
417
+ rescue TencentCloud::Common::TencentCloudSDKException => e
418
+ raise e
419
+ rescue StandardError => e
420
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
421
+ end
422
+
423
+ # 本接口(DeleteNotificationConfiguration)用于删除特定的通知。
424
+
425
+ # @param request: Request instance for DeleteNotificationConfiguration.
426
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteNotificationConfigurationRequest`
427
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteNotificationConfigurationResponse`
428
+ def DeleteNotificationConfiguration(request)
429
+ body = send_request('DeleteNotificationConfiguration', request.serialize)
430
+ response = JSON.parse(body)
431
+ if response['Response'].key?('Error') == false
432
+ model = DeleteNotificationConfigurationResponse.new
433
+ model.deserialize(response['Response'])
434
+ model
435
+ else
436
+ code = response['Response']['Error']['Code']
437
+ message = response['Response']['Error']['Message']
438
+ reqid = response['Response']['RequestId']
439
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
440
+ end
441
+ rescue TencentCloud::Common::TencentCloudSDKException => e
442
+ raise e
443
+ rescue StandardError => e
444
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
445
+ end
446
+
447
+ # 本接口(DeleteScalingPolicy)用于删除告警触发策略。
448
+
449
+ # @param request: Request instance for DeleteScalingPolicy.
450
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteScalingPolicyRequest`
451
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteScalingPolicyResponse`
452
+ def DeleteScalingPolicy(request)
453
+ body = send_request('DeleteScalingPolicy', request.serialize)
454
+ response = JSON.parse(body)
455
+ if response['Response'].key?('Error') == false
456
+ model = DeleteScalingPolicyResponse.new
457
+ model.deserialize(response['Response'])
458
+ model
459
+ else
460
+ code = response['Response']['Error']['Code']
461
+ message = response['Response']['Error']['Message']
462
+ reqid = response['Response']['RequestId']
463
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
464
+ end
465
+ rescue TencentCloud::Common::TencentCloudSDKException => e
466
+ raise e
467
+ rescue StandardError => e
468
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
469
+ end
470
+
471
+ # 本接口(DeleteScheduledAction)用于删除特定的定时任务。
472
+
473
+ # @param request: Request instance for DeleteScheduledAction.
474
+ # @type request: :class:`Tencentcloud::as::V20180419::DeleteScheduledActionRequest`
475
+ # @rtype: :class:`Tencentcloud::as::V20180419::DeleteScheduledActionResponse`
476
+ def DeleteScheduledAction(request)
477
+ body = send_request('DeleteScheduledAction', request.serialize)
478
+ response = JSON.parse(body)
479
+ if response['Response'].key?('Error') == false
480
+ model = DeleteScheduledActionResponse.new
481
+ model.deserialize(response['Response'])
482
+ model
483
+ else
484
+ code = response['Response']['Error']['Code']
485
+ message = response['Response']['Error']['Message']
486
+ reqid = response['Response']['RequestId']
487
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
488
+ end
489
+ rescue TencentCloud::Common::TencentCloudSDKException => e
490
+ raise e
491
+ rescue StandardError => e
492
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
493
+ end
494
+
495
+ # 本接口(DescribeAccountLimits)用于查询用户账户在弹性伸缩中的资源限制。
496
+
497
+ # @param request: Request instance for DescribeAccountLimits.
498
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeAccountLimitsRequest`
499
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeAccountLimitsResponse`
500
+ def DescribeAccountLimits(request)
501
+ body = send_request('DescribeAccountLimits', request.serialize)
502
+ response = JSON.parse(body)
503
+ if response['Response'].key?('Error') == false
504
+ model = DescribeAccountLimitsResponse.new
505
+ model.deserialize(response['Response'])
506
+ model
507
+ else
508
+ code = response['Response']['Error']['Code']
509
+ message = response['Response']['Error']['Message']
510
+ reqid = response['Response']['RequestId']
511
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
512
+ end
513
+ rescue TencentCloud::Common::TencentCloudSDKException => e
514
+ raise e
515
+ rescue StandardError => e
516
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
517
+ end
518
+
519
+ # 本接口(DescribeAutoScalingActivities)用于查询伸缩组的伸缩活动记录。
520
+
521
+ # @param request: Request instance for DescribeAutoScalingActivities.
522
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingActivitiesRequest`
523
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingActivitiesResponse`
524
+ def DescribeAutoScalingActivities(request)
525
+ body = send_request('DescribeAutoScalingActivities', request.serialize)
526
+ response = JSON.parse(body)
527
+ if response['Response'].key?('Error') == false
528
+ model = DescribeAutoScalingActivitiesResponse.new
529
+ model.deserialize(response['Response'])
530
+ model
531
+ else
532
+ code = response['Response']['Error']['Code']
533
+ message = response['Response']['Error']['Message']
534
+ reqid = response['Response']['RequestId']
535
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
536
+ end
537
+ rescue TencentCloud::Common::TencentCloudSDKException => e
538
+ raise e
539
+ rescue StandardError => e
540
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
541
+ end
542
+
543
+ # 本接口(DescribeAutoScalingGroupLastActivities)用于查询伸缩组的最新一次伸缩活动记录。
544
+
545
+ # @param request: Request instance for DescribeAutoScalingGroupLastActivities.
546
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingGroupLastActivitiesRequest`
547
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingGroupLastActivitiesResponse`
548
+ def DescribeAutoScalingGroupLastActivities(request)
549
+ body = send_request('DescribeAutoScalingGroupLastActivities', request.serialize)
550
+ response = JSON.parse(body)
551
+ if response['Response'].key?('Error') == false
552
+ model = DescribeAutoScalingGroupLastActivitiesResponse.new
553
+ model.deserialize(response['Response'])
554
+ model
555
+ else
556
+ code = response['Response']['Error']['Code']
557
+ message = response['Response']['Error']['Message']
558
+ reqid = response['Response']['RequestId']
559
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
560
+ end
561
+ rescue TencentCloud::Common::TencentCloudSDKException => e
562
+ raise e
563
+ rescue StandardError => e
564
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
565
+ end
566
+
567
+ # 本接口(DescribeAutoScalingGroups)用于查询伸缩组信息。
568
+
569
+ # * 可以根据伸缩组ID、伸缩组名称或者启动配置ID等信息来查询伸缩组的详细信息。过滤信息详细请见过滤器`Filter`。
570
+ # * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的伸缩组。
571
+
572
+ # @param request: Request instance for DescribeAutoScalingGroups.
573
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingGroupsRequest`
574
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingGroupsResponse`
575
+ def DescribeAutoScalingGroups(request)
576
+ body = send_request('DescribeAutoScalingGroups', request.serialize)
577
+ response = JSON.parse(body)
578
+ if response['Response'].key?('Error') == false
579
+ model = DescribeAutoScalingGroupsResponse.new
580
+ model.deserialize(response['Response'])
581
+ model
582
+ else
583
+ code = response['Response']['Error']['Code']
584
+ message = response['Response']['Error']['Message']
585
+ reqid = response['Response']['RequestId']
586
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
587
+ end
588
+ rescue TencentCloud::Common::TencentCloudSDKException => e
589
+ raise e
590
+ rescue StandardError => e
591
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
592
+ end
593
+
594
+ # 本接口(DescribeAutoScalingInstances)用于查询弹性伸缩关联实例的信息。
595
+
596
+ # * 可以根据实例ID、伸缩组ID等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。
597
+ # * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。
598
+
599
+ # @param request: Request instance for DescribeAutoScalingInstances.
600
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingInstancesRequest`
601
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeAutoScalingInstancesResponse`
602
+ def DescribeAutoScalingInstances(request)
603
+ body = send_request('DescribeAutoScalingInstances', request.serialize)
604
+ response = JSON.parse(body)
605
+ if response['Response'].key?('Error') == false
606
+ model = DescribeAutoScalingInstancesResponse.new
607
+ model.deserialize(response['Response'])
608
+ model
609
+ else
610
+ code = response['Response']['Error']['Code']
611
+ message = response['Response']['Error']['Message']
612
+ reqid = response['Response']['RequestId']
613
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
614
+ end
615
+ rescue TencentCloud::Common::TencentCloudSDKException => e
616
+ raise e
617
+ rescue StandardError => e
618
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
619
+ end
620
+
621
+ # 本接口(DescribeLaunchConfigurations)用于查询启动配置的信息。
622
+
623
+ # * 可以根据启动配置ID、启动配置名称等信息来查询启动配置的详细信息。过滤信息详细请见过滤器`Filter`。
624
+ # * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的启动配置。
625
+
626
+ # @param request: Request instance for DescribeLaunchConfigurations.
627
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeLaunchConfigurationsRequest`
628
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeLaunchConfigurationsResponse`
629
+ def DescribeLaunchConfigurations(request)
630
+ body = send_request('DescribeLaunchConfigurations', request.serialize)
631
+ response = JSON.parse(body)
632
+ if response['Response'].key?('Error') == false
633
+ model = DescribeLaunchConfigurationsResponse.new
634
+ model.deserialize(response['Response'])
635
+ model
636
+ else
637
+ code = response['Response']['Error']['Code']
638
+ message = response['Response']['Error']['Message']
639
+ reqid = response['Response']['RequestId']
640
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
641
+ end
642
+ rescue TencentCloud::Common::TencentCloudSDKException => e
643
+ raise e
644
+ rescue StandardError => e
645
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
646
+ end
647
+
648
+ # 本接口(DescribeLifecycleHooks)用于查询生命周期挂钩信息。
649
+
650
+ # * 可以根据伸缩组ID、生命周期挂钩ID或者生命周期挂钩名称等信息来查询生命周期挂钩的详细信息。过滤信息详细请见过滤器`Filter`。
651
+ # * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的生命周期挂钩。
652
+
653
+ # @param request: Request instance for DescribeLifecycleHooks.
654
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeLifecycleHooksRequest`
655
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeLifecycleHooksResponse`
656
+ def DescribeLifecycleHooks(request)
657
+ body = send_request('DescribeLifecycleHooks', request.serialize)
658
+ response = JSON.parse(body)
659
+ if response['Response'].key?('Error') == false
660
+ model = DescribeLifecycleHooksResponse.new
661
+ model.deserialize(response['Response'])
662
+ model
663
+ else
664
+ code = response['Response']['Error']['Code']
665
+ message = response['Response']['Error']['Message']
666
+ reqid = response['Response']['RequestId']
667
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
668
+ end
669
+ rescue TencentCloud::Common::TencentCloudSDKException => e
670
+ raise e
671
+ rescue StandardError => e
672
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
673
+ end
674
+
675
+ # 本接口 (DescribeNotificationConfigurations) 用于查询一个或多个通知的详细信息。
676
+
677
+ # 可以根据通知ID、伸缩组ID等信息来查询通知的详细信息。过滤信息详细请见过滤器`Filter`。
678
+ # 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的通知。
679
+
680
+ # @param request: Request instance for DescribeNotificationConfigurations.
681
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeNotificationConfigurationsRequest`
682
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeNotificationConfigurationsResponse`
683
+ def DescribeNotificationConfigurations(request)
684
+ body = send_request('DescribeNotificationConfigurations', request.serialize)
685
+ response = JSON.parse(body)
686
+ if response['Response'].key?('Error') == false
687
+ model = DescribeNotificationConfigurationsResponse.new
688
+ model.deserialize(response['Response'])
689
+ model
690
+ else
691
+ code = response['Response']['Error']['Code']
692
+ message = response['Response']['Error']['Message']
693
+ reqid = response['Response']['RequestId']
694
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
695
+ end
696
+ rescue TencentCloud::Common::TencentCloudSDKException => e
697
+ raise e
698
+ rescue StandardError => e
699
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
700
+ end
701
+
702
+ # 本接口(DescribePaiInstances)用于查询PAI实例信息。
703
+
704
+ # * 可以根据实例ID、实例域名等信息来查询PAI实例的详细信息。过滤信息详细请见过滤器`Filter`。
705
+ # * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的PAI实例。
706
+
707
+ # @param request: Request instance for DescribePaiInstances.
708
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribePaiInstancesRequest`
709
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribePaiInstancesResponse`
710
+ def DescribePaiInstances(request)
711
+ body = send_request('DescribePaiInstances', request.serialize)
712
+ response = JSON.parse(body)
713
+ if response['Response'].key?('Error') == false
714
+ model = DescribePaiInstancesResponse.new
715
+ model.deserialize(response['Response'])
716
+ model
717
+ else
718
+ code = response['Response']['Error']['Code']
719
+ message = response['Response']['Error']['Message']
720
+ reqid = response['Response']['RequestId']
721
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
722
+ end
723
+ rescue TencentCloud::Common::TencentCloudSDKException => e
724
+ raise e
725
+ rescue StandardError => e
726
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
727
+ end
728
+
729
+ # 本接口(DescribeScalingPolicies)用于查询告警触发策略。
730
+
731
+ # @param request: Request instance for DescribeScalingPolicies.
732
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeScalingPoliciesRequest`
733
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeScalingPoliciesResponse`
734
+ def DescribeScalingPolicies(request)
735
+ body = send_request('DescribeScalingPolicies', request.serialize)
736
+ response = JSON.parse(body)
737
+ if response['Response'].key?('Error') == false
738
+ model = DescribeScalingPoliciesResponse.new
739
+ model.deserialize(response['Response'])
740
+ model
741
+ else
742
+ code = response['Response']['Error']['Code']
743
+ message = response['Response']['Error']['Message']
744
+ reqid = response['Response']['RequestId']
745
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
746
+ end
747
+ rescue TencentCloud::Common::TencentCloudSDKException => e
748
+ raise e
749
+ rescue StandardError => e
750
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
751
+ end
752
+
753
+ # 本接口 (DescribeScheduledActions) 用于查询一个或多个定时任务的详细信息。
754
+
755
+ # * 可以根据定时任务ID、定时任务名称或者伸缩组ID等信息来查询定时任务的详细信息。过滤信息详细请见过滤器`Filter`。
756
+ # * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的定时任务。
757
+
758
+ # @param request: Request instance for DescribeScheduledActions.
759
+ # @type request: :class:`Tencentcloud::as::V20180419::DescribeScheduledActionsRequest`
760
+ # @rtype: :class:`Tencentcloud::as::V20180419::DescribeScheduledActionsResponse`
761
+ def DescribeScheduledActions(request)
762
+ body = send_request('DescribeScheduledActions', request.serialize)
763
+ response = JSON.parse(body)
764
+ if response['Response'].key?('Error') == false
765
+ model = DescribeScheduledActionsResponse.new
766
+ model.deserialize(response['Response'])
767
+ model
768
+ else
769
+ code = response['Response']['Error']['Code']
770
+ message = response['Response']['Error']['Message']
771
+ reqid = response['Response']['RequestId']
772
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
773
+ end
774
+ rescue TencentCloud::Common::TencentCloudSDKException => e
775
+ raise e
776
+ rescue StandardError => e
777
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
778
+ end
779
+
780
+ # 本接口(DetachInstances)用于从伸缩组移出 CVM 实例,本接口不会销毁实例。
781
+ # * 如果移出指定实例后,伸缩组内处于`IN_SERVICE`状态的实例数量小于伸缩组最小值,接口将报错
782
+ # * 如果伸缩组处于`DISABLED`状态,移出操作不校验`IN_SERVICE`实例数量和最小值的关系
783
+ # * 对于伸缩组配置的 CLB,实例在离开伸缩组时,AS 会进行解挂载动作
784
+
785
+ # @param request: Request instance for DetachInstances.
786
+ # @type request: :class:`Tencentcloud::as::V20180419::DetachInstancesRequest`
787
+ # @rtype: :class:`Tencentcloud::as::V20180419::DetachInstancesResponse`
788
+ def DetachInstances(request)
789
+ body = send_request('DetachInstances', request.serialize)
790
+ response = JSON.parse(body)
791
+ if response['Response'].key?('Error') == false
792
+ model = DetachInstancesResponse.new
793
+ model.deserialize(response['Response'])
794
+ model
795
+ else
796
+ code = response['Response']['Error']['Code']
797
+ message = response['Response']['Error']['Message']
798
+ reqid = response['Response']['RequestId']
799
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
800
+ end
801
+ rescue TencentCloud::Common::TencentCloudSDKException => e
802
+ raise e
803
+ rescue StandardError => e
804
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
805
+ end
806
+
807
+ # 本接口(DisableAutoScalingGroup)用于停用指定伸缩组。
808
+
809
+ # @param request: Request instance for DisableAutoScalingGroup.
810
+ # @type request: :class:`Tencentcloud::as::V20180419::DisableAutoScalingGroupRequest`
811
+ # @rtype: :class:`Tencentcloud::as::V20180419::DisableAutoScalingGroupResponse`
812
+ def DisableAutoScalingGroup(request)
813
+ body = send_request('DisableAutoScalingGroup', request.serialize)
814
+ response = JSON.parse(body)
815
+ if response['Response'].key?('Error') == false
816
+ model = DisableAutoScalingGroupResponse.new
817
+ model.deserialize(response['Response'])
818
+ model
819
+ else
820
+ code = response['Response']['Error']['Code']
821
+ message = response['Response']['Error']['Message']
822
+ reqid = response['Response']['RequestId']
823
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
824
+ end
825
+ rescue TencentCloud::Common::TencentCloudSDKException => e
826
+ raise e
827
+ rescue StandardError => e
828
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
829
+ end
830
+
831
+ # 本接口(EnableAutoScalingGroup)用于启用指定伸缩组。
832
+
833
+ # @param request: Request instance for EnableAutoScalingGroup.
834
+ # @type request: :class:`Tencentcloud::as::V20180419::EnableAutoScalingGroupRequest`
835
+ # @rtype: :class:`Tencentcloud::as::V20180419::EnableAutoScalingGroupResponse`
836
+ def EnableAutoScalingGroup(request)
837
+ body = send_request('EnableAutoScalingGroup', request.serialize)
838
+ response = JSON.parse(body)
839
+ if response['Response'].key?('Error') == false
840
+ model = EnableAutoScalingGroupResponse.new
841
+ model.deserialize(response['Response'])
842
+ model
843
+ else
844
+ code = response['Response']['Error']['Code']
845
+ message = response['Response']['Error']['Message']
846
+ reqid = response['Response']['RequestId']
847
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
848
+ end
849
+ rescue TencentCloud::Common::TencentCloudSDKException => e
850
+ raise e
851
+ rescue StandardError => e
852
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
853
+ end
854
+
855
+ # 本接口(ExecuteScalingPolicy)用于执行伸缩策略。
856
+
857
+ # * 可以根据伸缩策略ID执行伸缩策略。
858
+ # * 伸缩策略所属伸缩组处于伸缩活动时,会拒绝执行伸缩策略。
859
+
860
+ # @param request: Request instance for ExecuteScalingPolicy.
861
+ # @type request: :class:`Tencentcloud::as::V20180419::ExecuteScalingPolicyRequest`
862
+ # @rtype: :class:`Tencentcloud::as::V20180419::ExecuteScalingPolicyResponse`
863
+ def ExecuteScalingPolicy(request)
864
+ body = send_request('ExecuteScalingPolicy', request.serialize)
865
+ response = JSON.parse(body)
866
+ if response['Response'].key?('Error') == false
867
+ model = ExecuteScalingPolicyResponse.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
+ # 本接口(ModifyAutoScalingGroup)用于修改伸缩组。
883
+
884
+ # @param request: Request instance for ModifyAutoScalingGroup.
885
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyAutoScalingGroupRequest`
886
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyAutoScalingGroupResponse`
887
+ def ModifyAutoScalingGroup(request)
888
+ body = send_request('ModifyAutoScalingGroup', request.serialize)
889
+ response = JSON.parse(body)
890
+ if response['Response'].key?('Error') == false
891
+ model = ModifyAutoScalingGroupResponse.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
+ # 本接口(ModifyDesiredCapacity)用于修改指定伸缩组的期望实例数
907
+
908
+ # @param request: Request instance for ModifyDesiredCapacity.
909
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyDesiredCapacityRequest`
910
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyDesiredCapacityResponse`
911
+ def ModifyDesiredCapacity(request)
912
+ body = send_request('ModifyDesiredCapacity', request.serialize)
913
+ response = JSON.parse(body)
914
+ if response['Response'].key?('Error') == false
915
+ model = ModifyDesiredCapacityResponse.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
+ # 本接口(ModifyLaunchConfigurationAttributes)用于修改启动配置部分属性。
931
+
932
+ # * 修改启动配置后,已经使用该启动配置扩容的存量实例不会发生变更,此后使用该启动配置的新增实例会按照新的配置进行扩容。
933
+ # * 本接口支持修改部分简单类型。
934
+
935
+ # @param request: Request instance for ModifyLaunchConfigurationAttributes.
936
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyLaunchConfigurationAttributesRequest`
937
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyLaunchConfigurationAttributesResponse`
938
+ def ModifyLaunchConfigurationAttributes(request)
939
+ body = send_request('ModifyLaunchConfigurationAttributes', request.serialize)
940
+ response = JSON.parse(body)
941
+ if response['Response'].key?('Error') == false
942
+ model = ModifyLaunchConfigurationAttributesResponse.new
943
+ model.deserialize(response['Response'])
944
+ model
945
+ else
946
+ code = response['Response']['Error']['Code']
947
+ message = response['Response']['Error']['Message']
948
+ reqid = response['Response']['RequestId']
949
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
950
+ end
951
+ rescue TencentCloud::Common::TencentCloudSDKException => e
952
+ raise e
953
+ rescue StandardError => e
954
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
955
+ end
956
+
957
+ # 本接口(ModifyLoadBalancers)用于修改伸缩组的负载均衡器。
958
+
959
+ # * 本接口用于为伸缩组指定新的负载均衡器配置,采用`完全覆盖`风格,无论之前配置如何,`统一按照接口参数配置为新的负载均衡器`。
960
+ # * 如果要为伸缩组清空负载均衡器,则在调用本接口时仅指定伸缩组ID,不指定具体负载均衡器。
961
+ # * 本接口会立即修改伸缩组的负载均衡器,并生成一个伸缩活动,异步修改存量实例的负载均衡器。
962
+
963
+ # @param request: Request instance for ModifyLoadBalancers.
964
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyLoadBalancersRequest`
965
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyLoadBalancersResponse`
966
+ def ModifyLoadBalancers(request)
967
+ body = send_request('ModifyLoadBalancers', request.serialize)
968
+ response = JSON.parse(body)
969
+ if response['Response'].key?('Error') == false
970
+ model = ModifyLoadBalancersResponse.new
971
+ model.deserialize(response['Response'])
972
+ model
973
+ else
974
+ code = response['Response']['Error']['Code']
975
+ message = response['Response']['Error']['Message']
976
+ reqid = response['Response']['RequestId']
977
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
978
+ end
979
+ rescue TencentCloud::Common::TencentCloudSDKException => e
980
+ raise e
981
+ rescue StandardError => e
982
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
983
+ end
984
+
985
+ # 本接口(ModifyNotificationConfiguration)用于修改通知。
986
+ # * 通知的接收端类型不支持修改。
987
+
988
+ # @param request: Request instance for ModifyNotificationConfiguration.
989
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyNotificationConfigurationRequest`
990
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyNotificationConfigurationResponse`
991
+ def ModifyNotificationConfiguration(request)
992
+ body = send_request('ModifyNotificationConfiguration', request.serialize)
993
+ response = JSON.parse(body)
994
+ if response['Response'].key?('Error') == false
995
+ model = ModifyNotificationConfigurationResponse.new
996
+ model.deserialize(response['Response'])
997
+ model
998
+ else
999
+ code = response['Response']['Error']['Code']
1000
+ message = response['Response']['Error']['Message']
1001
+ reqid = response['Response']['RequestId']
1002
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1003
+ end
1004
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1005
+ raise e
1006
+ rescue StandardError => e
1007
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1008
+ end
1009
+
1010
+ # 本接口(ModifyScalingPolicy)用于修改告警触发策略。
1011
+
1012
+ # @param request: Request instance for ModifyScalingPolicy.
1013
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyScalingPolicyRequest`
1014
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyScalingPolicyResponse`
1015
+ def ModifyScalingPolicy(request)
1016
+ body = send_request('ModifyScalingPolicy', request.serialize)
1017
+ response = JSON.parse(body)
1018
+ if response['Response'].key?('Error') == false
1019
+ model = ModifyScalingPolicyResponse.new
1020
+ model.deserialize(response['Response'])
1021
+ model
1022
+ else
1023
+ code = response['Response']['Error']['Code']
1024
+ message = response['Response']['Error']['Message']
1025
+ reqid = response['Response']['RequestId']
1026
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1027
+ end
1028
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1029
+ raise e
1030
+ rescue StandardError => e
1031
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1032
+ end
1033
+
1034
+ # 本接口(ModifyScheduledAction)用于修改定时任务。
1035
+
1036
+ # @param request: Request instance for ModifyScheduledAction.
1037
+ # @type request: :class:`Tencentcloud::as::V20180419::ModifyScheduledActionRequest`
1038
+ # @rtype: :class:`Tencentcloud::as::V20180419::ModifyScheduledActionResponse`
1039
+ def ModifyScheduledAction(request)
1040
+ body = send_request('ModifyScheduledAction', request.serialize)
1041
+ response = JSON.parse(body)
1042
+ if response['Response'].key?('Error') == false
1043
+ model = ModifyScheduledActionResponse.new
1044
+ model.deserialize(response['Response'])
1045
+ model
1046
+ else
1047
+ code = response['Response']['Error']['Code']
1048
+ message = response['Response']['Error']['Message']
1049
+ reqid = response['Response']['RequestId']
1050
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1051
+ end
1052
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1053
+ raise e
1054
+ rescue StandardError => e
1055
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1056
+ end
1057
+
1058
+ # 本接口(PreviewPaiDomainName)用于预览PAI实例域名。
1059
+
1060
+ # @param request: Request instance for PreviewPaiDomainName.
1061
+ # @type request: :class:`Tencentcloud::as::V20180419::PreviewPaiDomainNameRequest`
1062
+ # @rtype: :class:`Tencentcloud::as::V20180419::PreviewPaiDomainNameResponse`
1063
+ def PreviewPaiDomainName(request)
1064
+ body = send_request('PreviewPaiDomainName', request.serialize)
1065
+ response = JSON.parse(body)
1066
+ if response['Response'].key?('Error') == false
1067
+ model = PreviewPaiDomainNameResponse.new
1068
+ model.deserialize(response['Response'])
1069
+ model
1070
+ else
1071
+ code = response['Response']['Error']['Code']
1072
+ message = response['Response']['Error']['Message']
1073
+ reqid = response['Response']['RequestId']
1074
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1075
+ end
1076
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1077
+ raise e
1078
+ rescue StandardError => e
1079
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1080
+ end
1081
+
1082
+ # 本接口(RemoveInstances)用于从伸缩组删除 CVM 实例。根据当前的产品逻辑,如果实例由弹性伸缩自动创建,则实例会被销毁;如果实例系创建后加入伸缩组的,则会从伸缩组中移除,保留实例。
1083
+ # * 如果删除指定实例后,伸缩组内处于`IN_SERVICE`状态的实例数量小于伸缩组最小值,接口将报错
1084
+ # * 如果伸缩组处于`DISABLED`状态,删除操作不校验`IN_SERVICE`实例数量和最小值的关系
1085
+ # * 对于伸缩组配置的 CLB,实例在离开伸缩组时,AS 会进行解挂载动作
1086
+
1087
+ # @param request: Request instance for RemoveInstances.
1088
+ # @type request: :class:`Tencentcloud::as::V20180419::RemoveInstancesRequest`
1089
+ # @rtype: :class:`Tencentcloud::as::V20180419::RemoveInstancesResponse`
1090
+ def RemoveInstances(request)
1091
+ body = send_request('RemoveInstances', request.serialize)
1092
+ response = JSON.parse(body)
1093
+ if response['Response'].key?('Error') == false
1094
+ model = RemoveInstancesResponse.new
1095
+ model.deserialize(response['Response'])
1096
+ model
1097
+ else
1098
+ code = response['Response']['Error']['Code']
1099
+ message = response['Response']['Error']['Message']
1100
+ reqid = response['Response']['RequestId']
1101
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1102
+ end
1103
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1104
+ raise e
1105
+ rescue StandardError => e
1106
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1107
+ end
1108
+
1109
+ # 为伸缩组指定数量缩容实例,返回缩容活动的 ActivityId。
1110
+ # * 伸缩组需要未处于活动中
1111
+ # * 根据伸缩组的`TerminationPolicies`策略,选择被缩容的实例,可参考[缩容处理](https://cloud.tencent.com/document/product/377/8563)
1112
+ # * 接口只会选择`IN_SERVICE`实例缩容,如果需要缩容其他状态实例,可以使用 [DetachInstances](https://cloud.tencent.com/document/api/377/20436) 或 [RemoveInstances](https://cloud.tencent.com/document/api/377/20431) 接口
1113
+ # * 接口会减少期望实例数,新的期望实例数需要大于等于最小实例数
1114
+ # * 缩容如果失败或者部分成功,最后期望实例数只会扣减实际缩容成功的实例数量
1115
+
1116
+ # @param request: Request instance for ScaleInInstances.
1117
+ # @type request: :class:`Tencentcloud::as::V20180419::ScaleInInstancesRequest`
1118
+ # @rtype: :class:`Tencentcloud::as::V20180419::ScaleInInstancesResponse`
1119
+ def ScaleInInstances(request)
1120
+ body = send_request('ScaleInInstances', request.serialize)
1121
+ response = JSON.parse(body)
1122
+ if response['Response'].key?('Error') == false
1123
+ model = ScaleInInstancesResponse.new
1124
+ model.deserialize(response['Response'])
1125
+ model
1126
+ else
1127
+ code = response['Response']['Error']['Code']
1128
+ message = response['Response']['Error']['Message']
1129
+ reqid = response['Response']['RequestId']
1130
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1131
+ end
1132
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1133
+ raise e
1134
+ rescue StandardError => e
1135
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1136
+ end
1137
+
1138
+ # 为伸缩组指定数量扩容实例,返回扩容活动的 ActivityId。
1139
+ # * 伸缩组需要未处于活动中
1140
+ # * 接口会增加期望实例数,新的期望实例数需要小于等于最大实例数
1141
+ # * 扩容如果失败或者部分成功,最后期望实例数只会增加实际成功的实例数量
1142
+
1143
+ # @param request: Request instance for ScaleOutInstances.
1144
+ # @type request: :class:`Tencentcloud::as::V20180419::ScaleOutInstancesRequest`
1145
+ # @rtype: :class:`Tencentcloud::as::V20180419::ScaleOutInstancesResponse`
1146
+ def ScaleOutInstances(request)
1147
+ body = send_request('ScaleOutInstances', request.serialize)
1148
+ response = JSON.parse(body)
1149
+ if response['Response'].key?('Error') == false
1150
+ model = ScaleOutInstancesResponse.new
1151
+ model.deserialize(response['Response'])
1152
+ model
1153
+ else
1154
+ code = response['Response']['Error']['Code']
1155
+ message = response['Response']['Error']['Message']
1156
+ reqid = response['Response']['RequestId']
1157
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1158
+ end
1159
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1160
+ raise e
1161
+ rescue StandardError => e
1162
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1163
+ end
1164
+
1165
+ # 本接口(SetInstancesProtection)用于设置实例保护。
1166
+ # 实例设置保护之后,当发生不健康替换、报警策略、期望值变更等触发缩容时,将不对此实例缩容操作。
1167
+
1168
+ # @param request: Request instance for SetInstancesProtection.
1169
+ # @type request: :class:`Tencentcloud::as::V20180419::SetInstancesProtectionRequest`
1170
+ # @rtype: :class:`Tencentcloud::as::V20180419::SetInstancesProtectionResponse`
1171
+ def SetInstancesProtection(request)
1172
+ body = send_request('SetInstancesProtection', request.serialize)
1173
+ response = JSON.parse(body)
1174
+ if response['Response'].key?('Error') == false
1175
+ model = SetInstancesProtectionResponse.new
1176
+ model.deserialize(response['Response'])
1177
+ model
1178
+ else
1179
+ code = response['Response']['Error']['Code']
1180
+ message = response['Response']['Error']['Message']
1181
+ reqid = response['Response']['RequestId']
1182
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1183
+ end
1184
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1185
+ raise e
1186
+ rescue StandardError => e
1187
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1188
+ end
1189
+
1190
+ # 本接口(StartAutoScalingInstances)用于开启伸缩组内 CVM 实例。
1191
+ # * 开机成功,实例转为`IN_SERVICE`状态后,会增加期望实例数,期望实例数不可超过设置的最大值
1192
+ # * 本接口支持批量操作,每次请求开机实例的上限为100
1193
+
1194
+ # @param request: Request instance for StartAutoScalingInstances.
1195
+ # @type request: :class:`Tencentcloud::as::V20180419::StartAutoScalingInstancesRequest`
1196
+ # @rtype: :class:`Tencentcloud::as::V20180419::StartAutoScalingInstancesResponse`
1197
+ def StartAutoScalingInstances(request)
1198
+ body = send_request('StartAutoScalingInstances', request.serialize)
1199
+ response = JSON.parse(body)
1200
+ if response['Response'].key?('Error') == false
1201
+ model = StartAutoScalingInstancesResponse.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
+ # 本接口(StopAutoScalingInstances)用于关闭伸缩组内 CVM 实例。
1217
+ # * 关机方式采用`SOFT_FIRST`方式,表示在正常关闭失败后进行强制关闭
1218
+ # * 关闭`IN_SERVICE`状态的实例,会减少期望实例数,期望实例数不可低于设置的最小值
1219
+ # * 使用`STOP_CHARGING`选项关机,待关机的实例需要满足[关机不收费条件](https://cloud.tencent.com/document/product/213/19918)
1220
+ # * 本接口支持批量操作,每次请求关机实例的上限为100
1221
+
1222
+ # @param request: Request instance for StopAutoScalingInstances.
1223
+ # @type request: :class:`Tencentcloud::as::V20180419::StopAutoScalingInstancesRequest`
1224
+ # @rtype: :class:`Tencentcloud::as::V20180419::StopAutoScalingInstancesResponse`
1225
+ def StopAutoScalingInstances(request)
1226
+ body = send_request('StopAutoScalingInstances', request.serialize)
1227
+ response = JSON.parse(body)
1228
+ if response['Response'].key?('Error') == false
1229
+ model = StopAutoScalingInstancesResponse.new
1230
+ model.deserialize(response['Response'])
1231
+ model
1232
+ else
1233
+ code = response['Response']['Error']['Code']
1234
+ message = response['Response']['Error']['Message']
1235
+ reqid = response['Response']['RequestId']
1236
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1237
+ end
1238
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1239
+ raise e
1240
+ rescue StandardError => e
1241
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1242
+ end
1243
+
1244
+ # 本接口(UpgradeLaunchConfiguration)用于升级启动配置。
1245
+
1246
+ # * 本接口用于升级启动配置,采用“完全覆盖”风格,无论之前参数如何,统一按照接口参数设置为新的配置。对于非必填字段,不填写则按照默认值赋值。
1247
+ # * 升级修改启动配置后,已经使用该启动配置扩容的存量实例不会发生变更,此后使用该启动配置的新增实例会按照新的配置进行扩容。
1248
+
1249
+ # @param request: Request instance for UpgradeLaunchConfiguration.
1250
+ # @type request: :class:`Tencentcloud::as::V20180419::UpgradeLaunchConfigurationRequest`
1251
+ # @rtype: :class:`Tencentcloud::as::V20180419::UpgradeLaunchConfigurationResponse`
1252
+ def UpgradeLaunchConfiguration(request)
1253
+ body = send_request('UpgradeLaunchConfiguration', request.serialize)
1254
+ response = JSON.parse(body)
1255
+ if response['Response'].key?('Error') == false
1256
+ model = UpgradeLaunchConfigurationResponse.new
1257
+ model.deserialize(response['Response'])
1258
+ model
1259
+ else
1260
+ code = response['Response']['Error']['Code']
1261
+ message = response['Response']['Error']['Message']
1262
+ reqid = response['Response']['RequestId']
1263
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1264
+ end
1265
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1266
+ raise e
1267
+ rescue StandardError => e
1268
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1269
+ end
1270
+
1271
+ # 本接口(UpgradeLifecycleHook)用于升级生命周期挂钩。
1272
+
1273
+ # * 本接口用于升级生命周期挂钩,采用“完全覆盖”风格,无论之前参数如何,统一按照接口参数设置为新的配置。对于非必填字段,不填写则按照默认值赋值。
1274
+
1275
+ # @param request: Request instance for UpgradeLifecycleHook.
1276
+ # @type request: :class:`Tencentcloud::as::V20180419::UpgradeLifecycleHookRequest`
1277
+ # @rtype: :class:`Tencentcloud::as::V20180419::UpgradeLifecycleHookResponse`
1278
+ def UpgradeLifecycleHook(request)
1279
+ body = send_request('UpgradeLifecycleHook', request.serialize)
1280
+ response = JSON.parse(body)
1281
+ if response['Response'].key?('Error') == false
1282
+ model = UpgradeLifecycleHookResponse.new
1283
+ model.deserialize(response['Response'])
1284
+ model
1285
+ else
1286
+ code = response['Response']['Error']['Code']
1287
+ message = response['Response']['Error']['Message']
1288
+ reqid = response['Response']['RequestId']
1289
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1290
+ end
1291
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1292
+ raise e
1293
+ rescue StandardError => e
1294
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1295
+ end
1296
+
1297
+
1298
+ end
1299
+ end
1300
+ end
1301
+ end