tencentcloud-sdk-tat 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97ce1b9261540765d2e90de6ece5dc77dde50e61
4
+ data.tar.gz: e45067d51be56b1f4ae732c3c59300f5a6a7f9ec
5
+ SHA512:
6
+ metadata.gz: 0c63a89cf6ca911e84bbc7a1b14c3c0f17f34e758bcb5371d553188759d2d8e80d491599ab5beac55c631bba11f7ff4db8c7456cd2b7e5e157572abb5d1351e9
7
+ data.tar.gz: 1bd36c32ce22165e981fb843fa0706ebbfc674c67d195c83cda0c5f19ac3ad3e1e4b38d3c64783422fa56461a613ee96d2ee9a896f9746d6d76b830b97971abc
data/lib/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.200
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tencentcloud-sdk-common'
4
+
5
+ require_relative 'v20201028/client'
6
+ require_relative 'v20201028/models'
7
+
8
+ module TencentCloud
9
+ module Tat
10
+ end
11
+ end
@@ -0,0 +1,482 @@
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 Tat
21
+ module V20201028
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2020-10-28'
26
+ api_endpoint = 'tat.tencentcloudapi.com'
27
+ sdk_version = 'TAT_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 此接口用于创建命令。
33
+
34
+ # @param request: Request instance for CreateCommand.
35
+ # @type request: :class:`Tencentcloud::tat::V20201028::CreateCommandRequest`
36
+ # @rtype: :class:`Tencentcloud::tat::V20201028::CreateCommandResponse`
37
+ def CreateCommand(request)
38
+ body = send_request('CreateCommand', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = CreateCommandResponse.new
42
+ model.deserialize(response['Response'])
43
+ model
44
+ else
45
+ code = response['Response']['Error']['Code']
46
+ message = response['Response']['Error']['Message']
47
+ reqid = response['Response']['RequestId']
48
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
49
+ end
50
+ rescue TencentCloud::Common::TencentCloudSDKException => e
51
+ raise e
52
+ rescue StandardError => e
53
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
54
+ end
55
+
56
+ # 此接口用于创建执行器。
57
+
58
+ # @param request: Request instance for CreateInvoker.
59
+ # @type request: :class:`Tencentcloud::tat::V20201028::CreateInvokerRequest`
60
+ # @rtype: :class:`Tencentcloud::tat::V20201028::CreateInvokerResponse`
61
+ def CreateInvoker(request)
62
+ body = send_request('CreateInvoker', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CreateInvokerResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+ # 此接口用于删除命令。
81
+ # 如果命令与执行器关联,则无法被删除。
82
+
83
+ # @param request: Request instance for DeleteCommand.
84
+ # @type request: :class:`Tencentcloud::tat::V20201028::DeleteCommandRequest`
85
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DeleteCommandResponse`
86
+ def DeleteCommand(request)
87
+ body = send_request('DeleteCommand', request.serialize)
88
+ response = JSON.parse(body)
89
+ if response['Response'].key?('Error') == false
90
+ model = DeleteCommandResponse.new
91
+ model.deserialize(response['Response'])
92
+ model
93
+ else
94
+ code = response['Response']['Error']['Code']
95
+ message = response['Response']['Error']['Message']
96
+ reqid = response['Response']['RequestId']
97
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
98
+ end
99
+ rescue TencentCloud::Common::TencentCloudSDKException => e
100
+ raise e
101
+ rescue StandardError => e
102
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
103
+ end
104
+
105
+ # 此接口用于删除执行器。
106
+
107
+ # @param request: Request instance for DeleteInvoker.
108
+ # @type request: :class:`Tencentcloud::tat::V20201028::DeleteInvokerRequest`
109
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DeleteInvokerResponse`
110
+ def DeleteInvoker(request)
111
+ body = send_request('DeleteInvoker', request.serialize)
112
+ response = JSON.parse(body)
113
+ if response['Response'].key?('Error') == false
114
+ model = DeleteInvokerResponse.new
115
+ model.deserialize(response['Response'])
116
+ model
117
+ else
118
+ code = response['Response']['Error']['Code']
119
+ message = response['Response']['Error']['Message']
120
+ reqid = response['Response']['RequestId']
121
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
122
+ end
123
+ rescue TencentCloud::Common::TencentCloudSDKException => e
124
+ raise e
125
+ rescue StandardError => e
126
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
127
+ end
128
+
129
+ # 此接口用于查询自动化助手客户端的状态。
130
+
131
+ # @param request: Request instance for DescribeAutomationAgentStatus.
132
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeAutomationAgentStatusRequest`
133
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeAutomationAgentStatusResponse`
134
+ def DescribeAutomationAgentStatus(request)
135
+ body = send_request('DescribeAutomationAgentStatus', request.serialize)
136
+ response = JSON.parse(body)
137
+ if response['Response'].key?('Error') == false
138
+ model = DescribeAutomationAgentStatusResponse.new
139
+ model.deserialize(response['Response'])
140
+ model
141
+ else
142
+ code = response['Response']['Error']['Code']
143
+ message = response['Response']['Error']['Message']
144
+ reqid = response['Response']['RequestId']
145
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
146
+ end
147
+ rescue TencentCloud::Common::TencentCloudSDKException => e
148
+ raise e
149
+ rescue StandardError => e
150
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
151
+ end
152
+
153
+ # 此接口用于查询命令详情。
154
+
155
+ # @param request: Request instance for DescribeCommands.
156
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeCommandsRequest`
157
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeCommandsResponse`
158
+ def DescribeCommands(request)
159
+ body = send_request('DescribeCommands', request.serialize)
160
+ response = JSON.parse(body)
161
+ if response['Response'].key?('Error') == false
162
+ model = DescribeCommandsResponse.new
163
+ model.deserialize(response['Response'])
164
+ model
165
+ else
166
+ code = response['Response']['Error']['Code']
167
+ message = response['Response']['Error']['Message']
168
+ reqid = response['Response']['RequestId']
169
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
170
+ end
171
+ rescue TencentCloud::Common::TencentCloudSDKException => e
172
+ raise e
173
+ rescue StandardError => e
174
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
175
+ end
176
+
177
+ # 此接口用于查询执行任务详情。
178
+
179
+ # @param request: Request instance for DescribeInvocationTasks.
180
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeInvocationTasksRequest`
181
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeInvocationTasksResponse`
182
+ def DescribeInvocationTasks(request)
183
+ body = send_request('DescribeInvocationTasks', request.serialize)
184
+ response = JSON.parse(body)
185
+ if response['Response'].key?('Error') == false
186
+ model = DescribeInvocationTasksResponse.new
187
+ model.deserialize(response['Response'])
188
+ model
189
+ else
190
+ code = response['Response']['Error']['Code']
191
+ message = response['Response']['Error']['Message']
192
+ reqid = response['Response']['RequestId']
193
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
194
+ end
195
+ rescue TencentCloud::Common::TencentCloudSDKException => e
196
+ raise e
197
+ rescue StandardError => e
198
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
199
+ end
200
+
201
+ # 此接口用于查询执行活动详情。
202
+
203
+ # @param request: Request instance for DescribeInvocations.
204
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeInvocationsRequest`
205
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeInvocationsResponse`
206
+ def DescribeInvocations(request)
207
+ body = send_request('DescribeInvocations', request.serialize)
208
+ response = JSON.parse(body)
209
+ if response['Response'].key?('Error') == false
210
+ model = DescribeInvocationsResponse.new
211
+ model.deserialize(response['Response'])
212
+ model
213
+ else
214
+ code = response['Response']['Error']['Code']
215
+ message = response['Response']['Error']['Message']
216
+ reqid = response['Response']['RequestId']
217
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
218
+ end
219
+ rescue TencentCloud::Common::TencentCloudSDKException => e
220
+ raise e
221
+ rescue StandardError => e
222
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
223
+ end
224
+
225
+ # 此接口用于查询执行器的执行记录。
226
+
227
+ # @param request: Request instance for DescribeInvokerRecords.
228
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeInvokerRecordsRequest`
229
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeInvokerRecordsResponse`
230
+ def DescribeInvokerRecords(request)
231
+ body = send_request('DescribeInvokerRecords', request.serialize)
232
+ response = JSON.parse(body)
233
+ if response['Response'].key?('Error') == false
234
+ model = DescribeInvokerRecordsResponse.new
235
+ model.deserialize(response['Response'])
236
+ model
237
+ else
238
+ code = response['Response']['Error']['Code']
239
+ message = response['Response']['Error']['Message']
240
+ reqid = response['Response']['RequestId']
241
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
242
+ end
243
+ rescue TencentCloud::Common::TencentCloudSDKException => e
244
+ raise e
245
+ rescue StandardError => e
246
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
247
+ end
248
+
249
+ # 此接口用于查询执行器信息。
250
+
251
+ # @param request: Request instance for DescribeInvokers.
252
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeInvokersRequest`
253
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeInvokersResponse`
254
+ def DescribeInvokers(request)
255
+ body = send_request('DescribeInvokers', request.serialize)
256
+ response = JSON.parse(body)
257
+ if response['Response'].key?('Error') == false
258
+ model = DescribeInvokersResponse.new
259
+ model.deserialize(response['Response'])
260
+ model
261
+ else
262
+ code = response['Response']['Error']['Code']
263
+ message = response['Response']['Error']['Message']
264
+ reqid = response['Response']['RequestId']
265
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
266
+ end
267
+ rescue TencentCloud::Common::TencentCloudSDKException => e
268
+ raise e
269
+ rescue StandardError => e
270
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
271
+ end
272
+
273
+ # 此接口用于查询 TAT 产品后台地域列表。
274
+ # RegionState 为 AVAILABLE,代表该地域的 TAT 后台服务已经可用;未返回,代表该地域的 TAT 后台服务尚不可用。
275
+
276
+ # @param request: Request instance for DescribeRegions.
277
+ # @type request: :class:`Tencentcloud::tat::V20201028::DescribeRegionsRequest`
278
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DescribeRegionsResponse`
279
+ def DescribeRegions(request)
280
+ body = send_request('DescribeRegions', request.serialize)
281
+ response = JSON.parse(body)
282
+ if response['Response'].key?('Error') == false
283
+ model = DescribeRegionsResponse.new
284
+ model.deserialize(response['Response'])
285
+ model
286
+ else
287
+ code = response['Response']['Error']['Code']
288
+ message = response['Response']['Error']['Message']
289
+ reqid = response['Response']['RequestId']
290
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
291
+ end
292
+ rescue TencentCloud::Common::TencentCloudSDKException => e
293
+ raise e
294
+ rescue StandardError => e
295
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
296
+ end
297
+
298
+ # 此接口用于停止执行器。
299
+
300
+ # @param request: Request instance for DisableInvoker.
301
+ # @type request: :class:`Tencentcloud::tat::V20201028::DisableInvokerRequest`
302
+ # @rtype: :class:`Tencentcloud::tat::V20201028::DisableInvokerResponse`
303
+ def DisableInvoker(request)
304
+ body = send_request('DisableInvoker', request.serialize)
305
+ response = JSON.parse(body)
306
+ if response['Response'].key?('Error') == false
307
+ model = DisableInvokerResponse.new
308
+ model.deserialize(response['Response'])
309
+ model
310
+ else
311
+ code = response['Response']['Error']['Code']
312
+ message = response['Response']['Error']['Message']
313
+ reqid = response['Response']['RequestId']
314
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
315
+ end
316
+ rescue TencentCloud::Common::TencentCloudSDKException => e
317
+ raise e
318
+ rescue StandardError => e
319
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
320
+ end
321
+
322
+ # 此接口用于启用执行器。
323
+
324
+ # @param request: Request instance for EnableInvoker.
325
+ # @type request: :class:`Tencentcloud::tat::V20201028::EnableInvokerRequest`
326
+ # @rtype: :class:`Tencentcloud::tat::V20201028::EnableInvokerResponse`
327
+ def EnableInvoker(request)
328
+ body = send_request('EnableInvoker', request.serialize)
329
+ response = JSON.parse(body)
330
+ if response['Response'].key?('Error') == false
331
+ model = EnableInvokerResponse.new
332
+ model.deserialize(response['Response'])
333
+ model
334
+ else
335
+ code = response['Response']['Error']['Code']
336
+ message = response['Response']['Error']['Message']
337
+ reqid = response['Response']['RequestId']
338
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
339
+ end
340
+ rescue TencentCloud::Common::TencentCloudSDKException => e
341
+ raise e
342
+ rescue StandardError => e
343
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
344
+ end
345
+
346
+ # 在指定的实例上触发命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
347
+
348
+ # * 如果指定实例未安装 agent,或 agent 不在线,返回失败
349
+ # * 如果命令类型与 agent 运行环境不符,返回失败
350
+ # * 指定的实例需要处于 VPC 网络
351
+ # * 指定的实例需要处于 RUNNING 状态
352
+ # * 不可同时指定 CVM 和 Lighthouse
353
+
354
+ # @param request: Request instance for InvokeCommand.
355
+ # @type request: :class:`Tencentcloud::tat::V20201028::InvokeCommandRequest`
356
+ # @rtype: :class:`Tencentcloud::tat::V20201028::InvokeCommandResponse`
357
+ def InvokeCommand(request)
358
+ body = send_request('InvokeCommand', request.serialize)
359
+ response = JSON.parse(body)
360
+ if response['Response'].key?('Error') == false
361
+ model = InvokeCommandResponse.new
362
+ model.deserialize(response['Response'])
363
+ model
364
+ else
365
+ code = response['Response']['Error']['Code']
366
+ message = response['Response']['Error']['Message']
367
+ reqid = response['Response']['RequestId']
368
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
369
+ end
370
+ rescue TencentCloud::Common::TencentCloudSDKException => e
371
+ raise e
372
+ rescue StandardError => e
373
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
374
+ end
375
+
376
+ # 此接口用于修改命令。
377
+
378
+ # @param request: Request instance for ModifyCommand.
379
+ # @type request: :class:`Tencentcloud::tat::V20201028::ModifyCommandRequest`
380
+ # @rtype: :class:`Tencentcloud::tat::V20201028::ModifyCommandResponse`
381
+ def ModifyCommand(request)
382
+ body = send_request('ModifyCommand', request.serialize)
383
+ response = JSON.parse(body)
384
+ if response['Response'].key?('Error') == false
385
+ model = ModifyCommandResponse.new
386
+ model.deserialize(response['Response'])
387
+ model
388
+ else
389
+ code = response['Response']['Error']['Code']
390
+ message = response['Response']['Error']['Message']
391
+ reqid = response['Response']['RequestId']
392
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
393
+ end
394
+ rescue TencentCloud::Common::TencentCloudSDKException => e
395
+ raise e
396
+ rescue StandardError => e
397
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
398
+ end
399
+
400
+ # 此接口用于修改执行器。
401
+
402
+ # @param request: Request instance for ModifyInvoker.
403
+ # @type request: :class:`Tencentcloud::tat::V20201028::ModifyInvokerRequest`
404
+ # @rtype: :class:`Tencentcloud::tat::V20201028::ModifyInvokerResponse`
405
+ def ModifyInvoker(request)
406
+ body = send_request('ModifyInvoker', request.serialize)
407
+ response = JSON.parse(body)
408
+ if response['Response'].key?('Error') == false
409
+ model = ModifyInvokerResponse.new
410
+ model.deserialize(response['Response'])
411
+ model
412
+ else
413
+ code = response['Response']['Error']['Code']
414
+ message = response['Response']['Error']['Message']
415
+ reqid = response['Response']['RequestId']
416
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
417
+ end
418
+ rescue TencentCloud::Common::TencentCloudSDKException => e
419
+ raise e
420
+ rescue StandardError => e
421
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
422
+ end
423
+
424
+ # 此接口用于预览自定义参数替换后的命令内容。不会触发真实执行。
425
+
426
+ # @param request: Request instance for PreviewReplacedCommandContent.
427
+ # @type request: :class:`Tencentcloud::tat::V20201028::PreviewReplacedCommandContentRequest`
428
+ # @rtype: :class:`Tencentcloud::tat::V20201028::PreviewReplacedCommandContentResponse`
429
+ def PreviewReplacedCommandContent(request)
430
+ body = send_request('PreviewReplacedCommandContent', request.serialize)
431
+ response = JSON.parse(body)
432
+ if response['Response'].key?('Error') == false
433
+ model = PreviewReplacedCommandContentResponse.new
434
+ model.deserialize(response['Response'])
435
+ model
436
+ else
437
+ code = response['Response']['Error']['Code']
438
+ message = response['Response']['Error']['Message']
439
+ reqid = response['Response']['RequestId']
440
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
441
+ end
442
+ rescue TencentCloud::Common::TencentCloudSDKException => e
443
+ raise e
444
+ rescue StandardError => e
445
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
446
+ end
447
+
448
+ # 执行命令,调用成功返回执行活动ID(inv-xxxxxxxx),每个执行活动内部有一个或多个执行任务(invt-xxxxxxxx),每个执行任务代表命令在一台 CVM 或一台 Lighthouse 上的执行记录。
449
+
450
+ # * 如果指定实例未安装 agent,或 agent 不在线,返回失败
451
+ # * 如果命令类型与 agent 运行环境不符,返回失败
452
+ # * 指定的实例需要处于 VPC 网络
453
+ # * 指定的实例需要处于 `RUNNING` 状态
454
+ # * 不可同时指定 CVM 和 Lighthouse
455
+
456
+ # @param request: Request instance for RunCommand.
457
+ # @type request: :class:`Tencentcloud::tat::V20201028::RunCommandRequest`
458
+ # @rtype: :class:`Tencentcloud::tat::V20201028::RunCommandResponse`
459
+ def RunCommand(request)
460
+ body = send_request('RunCommand', request.serialize)
461
+ response = JSON.parse(body)
462
+ if response['Response'].key?('Error') == false
463
+ model = RunCommandResponse.new
464
+ model.deserialize(response['Response'])
465
+ model
466
+ else
467
+ code = response['Response']['Error']['Code']
468
+ message = response['Response']['Error']['Message']
469
+ reqid = response['Response']['RequestId']
470
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
471
+ end
472
+ rescue TencentCloud::Common::TencentCloudSDKException => e
473
+ raise e
474
+ rescue StandardError => e
475
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
476
+ end
477
+
478
+
479
+ end
480
+ end
481
+ end
482
+ end