tencentcloud-sdk-cls 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1552 @@
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 Cls
21
+ module V20201016
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2020-10-16'
26
+ api_endpoint = 'cls.tencentcloudapi.com'
27
+ sdk_version = 'CLS_' + 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 ApplyConfigToMachineGroup.
35
+ # @type request: :class:`Tencentcloud::cls::V20201016::ApplyConfigToMachineGroupRequest`
36
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ApplyConfigToMachineGroupResponse`
37
+ def ApplyConfigToMachineGroup(request)
38
+ body = send_request('ApplyConfigToMachineGroup', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = ApplyConfigToMachineGroupResponse.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 CreateAlarm.
59
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateAlarmRequest`
60
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateAlarmResponse`
61
+ def CreateAlarm(request)
62
+ body = send_request('CreateAlarm', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CreateAlarmResponse.new
66
+ model.deserialize(response['Response'])
67
+ model
68
+ else
69
+ code = response['Response']['Error']['Code']
70
+ message = response['Response']['Error']['Message']
71
+ reqid = response['Response']['RequestId']
72
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
73
+ end
74
+ rescue TencentCloud::Common::TencentCloudSDKException => e
75
+ raise e
76
+ rescue StandardError => e
77
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
78
+ end
79
+
80
+ # 该接口用户创建告警通知模板。
81
+
82
+ # @param request: Request instance for CreateAlarmNotice.
83
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateAlarmNoticeRequest`
84
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateAlarmNoticeResponse`
85
+ def CreateAlarmNotice(request)
86
+ body = send_request('CreateAlarmNotice', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = CreateAlarmNoticeResponse.new
90
+ model.deserialize(response['Response'])
91
+ model
92
+ else
93
+ code = response['Response']['Error']['Code']
94
+ message = response['Response']['Error']['Message']
95
+ reqid = response['Response']['RequestId']
96
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
97
+ end
98
+ rescue TencentCloud::Common::TencentCloudSDKException => e
99
+ raise e
100
+ rescue StandardError => e
101
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
102
+ end
103
+
104
+ # 本接口用于创建离线上下文任务
105
+
106
+ # @param request: Request instance for CreateAsyncContextTask.
107
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateAsyncContextTaskRequest`
108
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateAsyncContextTaskResponse`
109
+ def CreateAsyncContextTask(request)
110
+ body = send_request('CreateAsyncContextTask', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = CreateAsyncContextTaskResponse.new
114
+ model.deserialize(response['Response'])
115
+ model
116
+ else
117
+ code = response['Response']['Error']['Code']
118
+ message = response['Response']['Error']['Message']
119
+ reqid = response['Response']['RequestId']
120
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
121
+ end
122
+ rescue TencentCloud::Common::TencentCloudSDKException => e
123
+ raise e
124
+ rescue StandardError => e
125
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
126
+ end
127
+
128
+ # 本接口用于创建离线检索任务
129
+
130
+ # @param request: Request instance for CreateAsyncSearchTask.
131
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateAsyncSearchTaskRequest`
132
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateAsyncSearchTaskResponse`
133
+ def CreateAsyncSearchTask(request)
134
+ body = send_request('CreateAsyncSearchTask', request.serialize)
135
+ response = JSON.parse(body)
136
+ if response['Response'].key?('Error') == false
137
+ model = CreateAsyncSearchTaskResponse.new
138
+ model.deserialize(response['Response'])
139
+ model
140
+ else
141
+ code = response['Response']['Error']['Code']
142
+ message = response['Response']['Error']['Message']
143
+ reqid = response['Response']['RequestId']
144
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
145
+ end
146
+ rescue TencentCloud::Common::TencentCloudSDKException => e
147
+ raise e
148
+ rescue StandardError => e
149
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
150
+ end
151
+
152
+ # 创建采集规则配置
153
+
154
+ # @param request: Request instance for CreateConfig.
155
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateConfigRequest`
156
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateConfigResponse`
157
+ def CreateConfig(request)
158
+ body = send_request('CreateConfig', request.serialize)
159
+ response = JSON.parse(body)
160
+ if response['Response'].key?('Error') == false
161
+ model = CreateConfigResponse.new
162
+ model.deserialize(response['Response'])
163
+ model
164
+ else
165
+ code = response['Response']['Error']['Code']
166
+ message = response['Response']['Error']['Message']
167
+ reqid = response['Response']['RequestId']
168
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
169
+ end
170
+ rescue TencentCloud::Common::TencentCloudSDKException => e
171
+ raise e
172
+ rescue StandardError => e
173
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
174
+ end
175
+
176
+ # 本接口用于创建日志下载任务
177
+
178
+ # @param request: Request instance for CreateExport.
179
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateExportRequest`
180
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateExportResponse`
181
+ def CreateExport(request)
182
+ body = send_request('CreateExport', request.serialize)
183
+ response = JSON.parse(body)
184
+ if response['Response'].key?('Error') == false
185
+ model = CreateExportResponse.new
186
+ model.deserialize(response['Response'])
187
+ model
188
+ else
189
+ code = response['Response']['Error']['Code']
190
+ message = response['Response']['Error']['Message']
191
+ reqid = response['Response']['RequestId']
192
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
193
+ end
194
+ rescue TencentCloud::Common::TencentCloudSDKException => e
195
+ raise e
196
+ rescue StandardError => e
197
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
198
+ end
199
+
200
+ # 本接口用于创建索引
201
+
202
+ # @param request: Request instance for CreateIndex.
203
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateIndexRequest`
204
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateIndexResponse`
205
+ def CreateIndex(request)
206
+ body = send_request('CreateIndex', request.serialize)
207
+ response = JSON.parse(body)
208
+ if response['Response'].key?('Error') == false
209
+ model = CreateIndexResponse.new
210
+ model.deserialize(response['Response'])
211
+ model
212
+ else
213
+ code = response['Response']['Error']['Code']
214
+ message = response['Response']['Error']['Message']
215
+ reqid = response['Response']['RequestId']
216
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
217
+ end
218
+ rescue TencentCloud::Common::TencentCloudSDKException => e
219
+ raise e
220
+ rescue StandardError => e
221
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
222
+ end
223
+
224
+ # 本接口用于创建日志集,返回新创建的日志集的 ID。
225
+
226
+ # @param request: Request instance for CreateLogset.
227
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateLogsetRequest`
228
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateLogsetResponse`
229
+ def CreateLogset(request)
230
+ body = send_request('CreateLogset', request.serialize)
231
+ response = JSON.parse(body)
232
+ if response['Response'].key?('Error') == false
233
+ model = CreateLogsetResponse.new
234
+ model.deserialize(response['Response'])
235
+ model
236
+ else
237
+ code = response['Response']['Error']['Code']
238
+ message = response['Response']['Error']['Message']
239
+ reqid = response['Response']['RequestId']
240
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
241
+ end
242
+ rescue TencentCloud::Common::TencentCloudSDKException => e
243
+ raise e
244
+ rescue StandardError => e
245
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
246
+ end
247
+
248
+ # 创建机器组
249
+
250
+ # @param request: Request instance for CreateMachineGroup.
251
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateMachineGroupRequest`
252
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateMachineGroupResponse`
253
+ def CreateMachineGroup(request)
254
+ body = send_request('CreateMachineGroup', request.serialize)
255
+ response = JSON.parse(body)
256
+ if response['Response'].key?('Error') == false
257
+ model = CreateMachineGroupResponse.new
258
+ model.deserialize(response['Response'])
259
+ model
260
+ else
261
+ code = response['Response']['Error']['Code']
262
+ message = response['Response']['Error']['Message']
263
+ reqid = response['Response']['RequestId']
264
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
265
+ end
266
+ rescue TencentCloud::Common::TencentCloudSDKException => e
267
+ raise e
268
+ rescue StandardError => e
269
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
270
+ end
271
+
272
+ # 创建新的投递规则,客户如果使用此接口,需要自行处理CLS对指定bucket的写权限。
273
+
274
+ # @param request: Request instance for CreateShipper.
275
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateShipperRequest`
276
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateShipperResponse`
277
+ def CreateShipper(request)
278
+ body = send_request('CreateShipper', request.serialize)
279
+ response = JSON.parse(body)
280
+ if response['Response'].key?('Error') == false
281
+ model = CreateShipperResponse.new
282
+ model.deserialize(response['Response'])
283
+ model
284
+ else
285
+ code = response['Response']['Error']['Code']
286
+ message = response['Response']['Error']['Message']
287
+ reqid = response['Response']['RequestId']
288
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
289
+ end
290
+ rescue TencentCloud::Common::TencentCloudSDKException => e
291
+ raise e
292
+ rescue StandardError => e
293
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
294
+ end
295
+
296
+ # 本接口用于创建日志主题。
297
+
298
+ # @param request: Request instance for CreateTopic.
299
+ # @type request: :class:`Tencentcloud::cls::V20201016::CreateTopicRequest`
300
+ # @rtype: :class:`Tencentcloud::cls::V20201016::CreateTopicResponse`
301
+ def CreateTopic(request)
302
+ body = send_request('CreateTopic', request.serialize)
303
+ response = JSON.parse(body)
304
+ if response['Response'].key?('Error') == false
305
+ model = CreateTopicResponse.new
306
+ model.deserialize(response['Response'])
307
+ model
308
+ else
309
+ code = response['Response']['Error']['Code']
310
+ message = response['Response']['Error']['Message']
311
+ reqid = response['Response']['RequestId']
312
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
313
+ end
314
+ rescue TencentCloud::Common::TencentCloudSDKException => e
315
+ raise e
316
+ rescue StandardError => e
317
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
318
+ end
319
+
320
+ # 本接口用于删除告警策略。
321
+
322
+ # @param request: Request instance for DeleteAlarm.
323
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteAlarmRequest`
324
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteAlarmResponse`
325
+ def DeleteAlarm(request)
326
+ body = send_request('DeleteAlarm', request.serialize)
327
+ response = JSON.parse(body)
328
+ if response['Response'].key?('Error') == false
329
+ model = DeleteAlarmResponse.new
330
+ model.deserialize(response['Response'])
331
+ model
332
+ else
333
+ code = response['Response']['Error']['Code']
334
+ message = response['Response']['Error']['Message']
335
+ reqid = response['Response']['RequestId']
336
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
337
+ end
338
+ rescue TencentCloud::Common::TencentCloudSDKException => e
339
+ raise e
340
+ rescue StandardError => e
341
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
342
+ end
343
+
344
+ # 该接口用于删除告警通知模板
345
+
346
+ # @param request: Request instance for DeleteAlarmNotice.
347
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteAlarmNoticeRequest`
348
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteAlarmNoticeResponse`
349
+ def DeleteAlarmNotice(request)
350
+ body = send_request('DeleteAlarmNotice', request.serialize)
351
+ response = JSON.parse(body)
352
+ if response['Response'].key?('Error') == false
353
+ model = DeleteAlarmNoticeResponse.new
354
+ model.deserialize(response['Response'])
355
+ model
356
+ else
357
+ code = response['Response']['Error']['Code']
358
+ message = response['Response']['Error']['Message']
359
+ reqid = response['Response']['RequestId']
360
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
361
+ end
362
+ rescue TencentCloud::Common::TencentCloudSDKException => e
363
+ raise e
364
+ rescue StandardError => e
365
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
366
+ end
367
+
368
+ # 本接口用于删除离线上下文任务
369
+
370
+ # @param request: Request instance for DeleteAsyncContextTask.
371
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteAsyncContextTaskRequest`
372
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteAsyncContextTaskResponse`
373
+ def DeleteAsyncContextTask(request)
374
+ body = send_request('DeleteAsyncContextTask', request.serialize)
375
+ response = JSON.parse(body)
376
+ if response['Response'].key?('Error') == false
377
+ model = DeleteAsyncContextTaskResponse.new
378
+ model.deserialize(response['Response'])
379
+ model
380
+ else
381
+ code = response['Response']['Error']['Code']
382
+ message = response['Response']['Error']['Message']
383
+ reqid = response['Response']['RequestId']
384
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
385
+ end
386
+ rescue TencentCloud::Common::TencentCloudSDKException => e
387
+ raise e
388
+ rescue StandardError => e
389
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
390
+ end
391
+
392
+ # 本接口用于删除离线检索任务
393
+
394
+ # @param request: Request instance for DeleteAsyncSearchTask.
395
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteAsyncSearchTaskRequest`
396
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteAsyncSearchTaskResponse`
397
+ def DeleteAsyncSearchTask(request)
398
+ body = send_request('DeleteAsyncSearchTask', request.serialize)
399
+ response = JSON.parse(body)
400
+ if response['Response'].key?('Error') == false
401
+ model = DeleteAsyncSearchTaskResponse.new
402
+ model.deserialize(response['Response'])
403
+ model
404
+ else
405
+ code = response['Response']['Error']['Code']
406
+ message = response['Response']['Error']['Message']
407
+ reqid = response['Response']['RequestId']
408
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
409
+ end
410
+ rescue TencentCloud::Common::TencentCloudSDKException => e
411
+ raise e
412
+ rescue StandardError => e
413
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
414
+ end
415
+
416
+ # 删除采集规则配置
417
+
418
+ # @param request: Request instance for DeleteConfig.
419
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteConfigRequest`
420
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteConfigResponse`
421
+ def DeleteConfig(request)
422
+ body = send_request('DeleteConfig', request.serialize)
423
+ response = JSON.parse(body)
424
+ if response['Response'].key?('Error') == false
425
+ model = DeleteConfigResponse.new
426
+ model.deserialize(response['Response'])
427
+ model
428
+ else
429
+ code = response['Response']['Error']['Code']
430
+ message = response['Response']['Error']['Message']
431
+ reqid = response['Response']['RequestId']
432
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
433
+ end
434
+ rescue TencentCloud::Common::TencentCloudSDKException => e
435
+ raise e
436
+ rescue StandardError => e
437
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
438
+ end
439
+
440
+ # 删除应用到机器组的采集配置
441
+
442
+ # @param request: Request instance for DeleteConfigFromMachineGroup.
443
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteConfigFromMachineGroupRequest`
444
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteConfigFromMachineGroupResponse`
445
+ def DeleteConfigFromMachineGroup(request)
446
+ body = send_request('DeleteConfigFromMachineGroup', request.serialize)
447
+ response = JSON.parse(body)
448
+ if response['Response'].key?('Error') == false
449
+ model = DeleteConfigFromMachineGroupResponse.new
450
+ model.deserialize(response['Response'])
451
+ model
452
+ else
453
+ code = response['Response']['Error']['Code']
454
+ message = response['Response']['Error']['Message']
455
+ reqid = response['Response']['RequestId']
456
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
457
+ end
458
+ rescue TencentCloud::Common::TencentCloudSDKException => e
459
+ raise e
460
+ rescue StandardError => e
461
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
462
+ end
463
+
464
+ # 本接口用于删除日志下载任务
465
+
466
+ # @param request: Request instance for DeleteExport.
467
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteExportRequest`
468
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteExportResponse`
469
+ def DeleteExport(request)
470
+ body = send_request('DeleteExport', request.serialize)
471
+ response = JSON.parse(body)
472
+ if response['Response'].key?('Error') == false
473
+ model = DeleteExportResponse.new
474
+ model.deserialize(response['Response'])
475
+ model
476
+ else
477
+ code = response['Response']['Error']['Code']
478
+ message = response['Response']['Error']['Message']
479
+ reqid = response['Response']['RequestId']
480
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
481
+ end
482
+ rescue TencentCloud::Common::TencentCloudSDKException => e
483
+ raise e
484
+ rescue StandardError => e
485
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
486
+ end
487
+
488
+ # 本接口用于日志主题的索引配置
489
+
490
+ # @param request: Request instance for DeleteIndex.
491
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteIndexRequest`
492
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteIndexResponse`
493
+ def DeleteIndex(request)
494
+ body = send_request('DeleteIndex', request.serialize)
495
+ response = JSON.parse(body)
496
+ if response['Response'].key?('Error') == false
497
+ model = DeleteIndexResponse.new
498
+ model.deserialize(response['Response'])
499
+ model
500
+ else
501
+ code = response['Response']['Error']['Code']
502
+ message = response['Response']['Error']['Message']
503
+ reqid = response['Response']['RequestId']
504
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
505
+ end
506
+ rescue TencentCloud::Common::TencentCloudSDKException => e
507
+ raise e
508
+ rescue StandardError => e
509
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
510
+ end
511
+
512
+ # 本接口用于删除日志集。
513
+
514
+ # @param request: Request instance for DeleteLogset.
515
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteLogsetRequest`
516
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteLogsetResponse`
517
+ def DeleteLogset(request)
518
+ body = send_request('DeleteLogset', request.serialize)
519
+ response = JSON.parse(body)
520
+ if response['Response'].key?('Error') == false
521
+ model = DeleteLogsetResponse.new
522
+ model.deserialize(response['Response'])
523
+ model
524
+ else
525
+ code = response['Response']['Error']['Code']
526
+ message = response['Response']['Error']['Message']
527
+ reqid = response['Response']['RequestId']
528
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
529
+ end
530
+ rescue TencentCloud::Common::TencentCloudSDKException => e
531
+ raise e
532
+ rescue StandardError => e
533
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
534
+ end
535
+
536
+ # 删除机器组
537
+
538
+ # @param request: Request instance for DeleteMachineGroup.
539
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteMachineGroupRequest`
540
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteMachineGroupResponse`
541
+ def DeleteMachineGroup(request)
542
+ body = send_request('DeleteMachineGroup', request.serialize)
543
+ response = JSON.parse(body)
544
+ if response['Response'].key?('Error') == false
545
+ model = DeleteMachineGroupResponse.new
546
+ model.deserialize(response['Response'])
547
+ model
548
+ else
549
+ code = response['Response']['Error']['Code']
550
+ message = response['Response']['Error']['Message']
551
+ reqid = response['Response']['RequestId']
552
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
553
+ end
554
+ rescue TencentCloud::Common::TencentCloudSDKException => e
555
+ raise e
556
+ rescue StandardError => e
557
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
558
+ end
559
+
560
+ # 删除投递规则
561
+
562
+ # @param request: Request instance for DeleteShipper.
563
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteShipperRequest`
564
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteShipperResponse`
565
+ def DeleteShipper(request)
566
+ body = send_request('DeleteShipper', request.serialize)
567
+ response = JSON.parse(body)
568
+ if response['Response'].key?('Error') == false
569
+ model = DeleteShipperResponse.new
570
+ model.deserialize(response['Response'])
571
+ model
572
+ else
573
+ code = response['Response']['Error']['Code']
574
+ message = response['Response']['Error']['Message']
575
+ reqid = response['Response']['RequestId']
576
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
577
+ end
578
+ rescue TencentCloud::Common::TencentCloudSDKException => e
579
+ raise e
580
+ rescue StandardError => e
581
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
582
+ end
583
+
584
+ # 本接口用于删除日志主题。
585
+
586
+ # @param request: Request instance for DeleteTopic.
587
+ # @type request: :class:`Tencentcloud::cls::V20201016::DeleteTopicRequest`
588
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DeleteTopicResponse`
589
+ def DeleteTopic(request)
590
+ body = send_request('DeleteTopic', request.serialize)
591
+ response = JSON.parse(body)
592
+ if response['Response'].key?('Error') == false
593
+ model = DeleteTopicResponse.new
594
+ model.deserialize(response['Response'])
595
+ model
596
+ else
597
+ code = response['Response']['Error']['Code']
598
+ message = response['Response']['Error']['Message']
599
+ reqid = response['Response']['RequestId']
600
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
601
+ end
602
+ rescue TencentCloud::Common::TencentCloudSDKException => e
603
+ raise e
604
+ rescue StandardError => e
605
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
606
+ end
607
+
608
+ # 该接口用于获取告警通知模板列表
609
+
610
+ # @param request: Request instance for DescribeAlarmNotices.
611
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAlarmNoticesRequest`
612
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAlarmNoticesResponse`
613
+ def DescribeAlarmNotices(request)
614
+ body = send_request('DescribeAlarmNotices', request.serialize)
615
+ response = JSON.parse(body)
616
+ if response['Response'].key?('Error') == false
617
+ model = DescribeAlarmNoticesResponse.new
618
+ model.deserialize(response['Response'])
619
+ model
620
+ else
621
+ code = response['Response']['Error']['Code']
622
+ message = response['Response']['Error']['Message']
623
+ reqid = response['Response']['RequestId']
624
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
625
+ end
626
+ rescue TencentCloud::Common::TencentCloudSDKException => e
627
+ raise e
628
+ rescue StandardError => e
629
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
630
+ end
631
+
632
+ # 本接口用于获取告警策略。
633
+
634
+ # @param request: Request instance for DescribeAlarms.
635
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAlarmsRequest`
636
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAlarmsResponse`
637
+ def DescribeAlarms(request)
638
+ body = send_request('DescribeAlarms', request.serialize)
639
+ response = JSON.parse(body)
640
+ if response['Response'].key?('Error') == false
641
+ model = DescribeAlarmsResponse.new
642
+ model.deserialize(response['Response'])
643
+ model
644
+ else
645
+ code = response['Response']['Error']['Code']
646
+ message = response['Response']['Error']['Message']
647
+ reqid = response['Response']['RequestId']
648
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
649
+ end
650
+ rescue TencentCloud::Common::TencentCloudSDKException => e
651
+ raise e
652
+ rescue StandardError => e
653
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
654
+ end
655
+
656
+ # 本接口用户获取离线上下文任务的结果
657
+
658
+ # @param request: Request instance for DescribeAsyncContextResult.
659
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAsyncContextResultRequest`
660
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAsyncContextResultResponse`
661
+ def DescribeAsyncContextResult(request)
662
+ body = send_request('DescribeAsyncContextResult', request.serialize)
663
+ response = JSON.parse(body)
664
+ if response['Response'].key?('Error') == false
665
+ model = DescribeAsyncContextResultResponse.new
666
+ model.deserialize(response['Response'])
667
+ model
668
+ else
669
+ code = response['Response']['Error']['Code']
670
+ message = response['Response']['Error']['Message']
671
+ reqid = response['Response']['RequestId']
672
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
673
+ end
674
+ rescue TencentCloud::Common::TencentCloudSDKException => e
675
+ raise e
676
+ rescue StandardError => e
677
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
678
+ end
679
+
680
+ # 本接口用于获取离线上下文任务列表
681
+
682
+ # @param request: Request instance for DescribeAsyncContextTasks.
683
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAsyncContextTasksRequest`
684
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAsyncContextTasksResponse`
685
+ def DescribeAsyncContextTasks(request)
686
+ body = send_request('DescribeAsyncContextTasks', request.serialize)
687
+ response = JSON.parse(body)
688
+ if response['Response'].key?('Error') == false
689
+ model = DescribeAsyncContextTasksResponse.new
690
+ model.deserialize(response['Response'])
691
+ model
692
+ else
693
+ code = response['Response']['Error']['Code']
694
+ message = response['Response']['Error']['Message']
695
+ reqid = response['Response']['RequestId']
696
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
697
+ end
698
+ rescue TencentCloud::Common::TencentCloudSDKException => e
699
+ raise e
700
+ rescue StandardError => e
701
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
702
+ end
703
+
704
+ # 本接口用户获取离线检索任务的结果
705
+
706
+ # @param request: Request instance for DescribeAsyncSearchResult.
707
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAsyncSearchResultRequest`
708
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAsyncSearchResultResponse`
709
+ def DescribeAsyncSearchResult(request)
710
+ body = send_request('DescribeAsyncSearchResult', request.serialize)
711
+ response = JSON.parse(body)
712
+ if response['Response'].key?('Error') == false
713
+ model = DescribeAsyncSearchResultResponse.new
714
+ model.deserialize(response['Response'])
715
+ model
716
+ else
717
+ code = response['Response']['Error']['Code']
718
+ message = response['Response']['Error']['Message']
719
+ reqid = response['Response']['RequestId']
720
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
721
+ end
722
+ rescue TencentCloud::Common::TencentCloudSDKException => e
723
+ raise e
724
+ rescue StandardError => e
725
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
726
+ end
727
+
728
+ # 本接口用户获取离线检索任务列表
729
+
730
+ # @param request: Request instance for DescribeAsyncSearchTasks.
731
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeAsyncSearchTasksRequest`
732
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeAsyncSearchTasksResponse`
733
+ def DescribeAsyncSearchTasks(request)
734
+ body = send_request('DescribeAsyncSearchTasks', request.serialize)
735
+ response = JSON.parse(body)
736
+ if response['Response'].key?('Error') == false
737
+ model = DescribeAsyncSearchTasksResponse.new
738
+ model.deserialize(response['Response'])
739
+ model
740
+ else
741
+ code = response['Response']['Error']['Code']
742
+ message = response['Response']['Error']['Message']
743
+ reqid = response['Response']['RequestId']
744
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
745
+ end
746
+ rescue TencentCloud::Common::TencentCloudSDKException => e
747
+ raise e
748
+ rescue StandardError => e
749
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
750
+ end
751
+
752
+ # 获取采集规则配置所绑定的机器组
753
+
754
+ # @param request: Request instance for DescribeConfigMachineGroups.
755
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeConfigMachineGroupsRequest`
756
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeConfigMachineGroupsResponse`
757
+ def DescribeConfigMachineGroups(request)
758
+ body = send_request('DescribeConfigMachineGroups', request.serialize)
759
+ response = JSON.parse(body)
760
+ if response['Response'].key?('Error') == false
761
+ model = DescribeConfigMachineGroupsResponse.new
762
+ model.deserialize(response['Response'])
763
+ model
764
+ else
765
+ code = response['Response']['Error']['Code']
766
+ message = response['Response']['Error']['Message']
767
+ reqid = response['Response']['RequestId']
768
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
769
+ end
770
+ rescue TencentCloud::Common::TencentCloudSDKException => e
771
+ raise e
772
+ rescue StandardError => e
773
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
774
+ end
775
+
776
+ # 获取采集规则配置
777
+
778
+ # @param request: Request instance for DescribeConfigs.
779
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeConfigsRequest`
780
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeConfigsResponse`
781
+ def DescribeConfigs(request)
782
+ body = send_request('DescribeConfigs', request.serialize)
783
+ response = JSON.parse(body)
784
+ if response['Response'].key?('Error') == false
785
+ model = DescribeConfigsResponse.new
786
+ model.deserialize(response['Response'])
787
+ model
788
+ else
789
+ code = response['Response']['Error']['Code']
790
+ message = response['Response']['Error']['Message']
791
+ reqid = response['Response']['RequestId']
792
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
793
+ end
794
+ rescue TencentCloud::Common::TencentCloudSDKException => e
795
+ raise e
796
+ rescue StandardError => e
797
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
798
+ end
799
+
800
+ # 本接口用于获取日志下载任务列表
801
+
802
+ # @param request: Request instance for DescribeExports.
803
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeExportsRequest`
804
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeExportsResponse`
805
+ def DescribeExports(request)
806
+ body = send_request('DescribeExports', request.serialize)
807
+ response = JSON.parse(body)
808
+ if response['Response'].key?('Error') == false
809
+ model = DescribeExportsResponse.new
810
+ model.deserialize(response['Response'])
811
+ model
812
+ else
813
+ code = response['Response']['Error']['Code']
814
+ message = response['Response']['Error']['Message']
815
+ reqid = response['Response']['RequestId']
816
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
817
+ end
818
+ rescue TencentCloud::Common::TencentCloudSDKException => e
819
+ raise e
820
+ rescue StandardError => e
821
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
822
+ end
823
+
824
+ # 本接口用于获取索引配置信息
825
+
826
+ # @param request: Request instance for DescribeIndex.
827
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeIndexRequest`
828
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeIndexResponse`
829
+ def DescribeIndex(request)
830
+ body = send_request('DescribeIndex', request.serialize)
831
+ response = JSON.parse(body)
832
+ if response['Response'].key?('Error') == false
833
+ model = DescribeIndexResponse.new
834
+ model.deserialize(response['Response'])
835
+ model
836
+ else
837
+ code = response['Response']['Error']['Code']
838
+ message = response['Response']['Error']['Message']
839
+ reqid = response['Response']['RequestId']
840
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
841
+ end
842
+ rescue TencentCloud::Common::TencentCloudSDKException => e
843
+ raise e
844
+ rescue StandardError => e
845
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
846
+ end
847
+
848
+ # 本接口用于搜索日志上下文附近的内容
849
+
850
+ # @param request: Request instance for DescribeLogContext.
851
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeLogContextRequest`
852
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeLogContextResponse`
853
+ def DescribeLogContext(request)
854
+ body = send_request('DescribeLogContext', request.serialize)
855
+ response = JSON.parse(body)
856
+ if response['Response'].key?('Error') == false
857
+ model = DescribeLogContextResponse.new
858
+ model.deserialize(response['Response'])
859
+ model
860
+ else
861
+ code = response['Response']['Error']['Code']
862
+ message = response['Response']['Error']['Message']
863
+ reqid = response['Response']['RequestId']
864
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
865
+ end
866
+ rescue TencentCloud::Common::TencentCloudSDKException => e
867
+ raise e
868
+ rescue StandardError => e
869
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
870
+ end
871
+
872
+ # 本接口用于获取日志集信息列表。
873
+
874
+ # @param request: Request instance for DescribeLogsets.
875
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeLogsetsRequest`
876
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeLogsetsResponse`
877
+ def DescribeLogsets(request)
878
+ body = send_request('DescribeLogsets', request.serialize)
879
+ response = JSON.parse(body)
880
+ if response['Response'].key?('Error') == false
881
+ model = DescribeLogsetsResponse.new
882
+ model.deserialize(response['Response'])
883
+ model
884
+ else
885
+ code = response['Response']['Error']['Code']
886
+ message = response['Response']['Error']['Message']
887
+ reqid = response['Response']['RequestId']
888
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
889
+ end
890
+ rescue TencentCloud::Common::TencentCloudSDKException => e
891
+ raise e
892
+ rescue StandardError => e
893
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
894
+ end
895
+
896
+ # 获取机器组绑定的采集规则配置
897
+
898
+ # @param request: Request instance for DescribeMachineGroupConfigs.
899
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeMachineGroupConfigsRequest`
900
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeMachineGroupConfigsResponse`
901
+ def DescribeMachineGroupConfigs(request)
902
+ body = send_request('DescribeMachineGroupConfigs', request.serialize)
903
+ response = JSON.parse(body)
904
+ if response['Response'].key?('Error') == false
905
+ model = DescribeMachineGroupConfigsResponse.new
906
+ model.deserialize(response['Response'])
907
+ model
908
+ else
909
+ code = response['Response']['Error']['Code']
910
+ message = response['Response']['Error']['Message']
911
+ reqid = response['Response']['RequestId']
912
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
913
+ end
914
+ rescue TencentCloud::Common::TencentCloudSDKException => e
915
+ raise e
916
+ rescue StandardError => e
917
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
918
+ end
919
+
920
+ # 获取机器组信息列表
921
+
922
+ # @param request: Request instance for DescribeMachineGroups.
923
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeMachineGroupsRequest`
924
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeMachineGroupsResponse`
925
+ def DescribeMachineGroups(request)
926
+ body = send_request('DescribeMachineGroups', request.serialize)
927
+ response = JSON.parse(body)
928
+ if response['Response'].key?('Error') == false
929
+ model = DescribeMachineGroupsResponse.new
930
+ model.deserialize(response['Response'])
931
+ model
932
+ else
933
+ code = response['Response']['Error']['Code']
934
+ message = response['Response']['Error']['Message']
935
+ reqid = response['Response']['RequestId']
936
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
937
+ end
938
+ rescue TencentCloud::Common::TencentCloudSDKException => e
939
+ raise e
940
+ rescue StandardError => e
941
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
942
+ end
943
+
944
+ # 获取制定机器组下的机器状态
945
+
946
+ # @param request: Request instance for DescribeMachines.
947
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeMachinesRequest`
948
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeMachinesResponse`
949
+ def DescribeMachines(request)
950
+ body = send_request('DescribeMachines', request.serialize)
951
+ response = JSON.parse(body)
952
+ if response['Response'].key?('Error') == false
953
+ model = DescribeMachinesResponse.new
954
+ model.deserialize(response['Response'])
955
+ model
956
+ else
957
+ code = response['Response']['Error']['Code']
958
+ message = response['Response']['Error']['Message']
959
+ reqid = response['Response']['RequestId']
960
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
961
+ end
962
+ rescue TencentCloud::Common::TencentCloudSDKException => e
963
+ raise e
964
+ rescue StandardError => e
965
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
966
+ end
967
+
968
+ # 本接口用于获取主题分区列表。
969
+
970
+ # @param request: Request instance for DescribePartitions.
971
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribePartitionsRequest`
972
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribePartitionsResponse`
973
+ def DescribePartitions(request)
974
+ body = send_request('DescribePartitions', request.serialize)
975
+ response = JSON.parse(body)
976
+ if response['Response'].key?('Error') == false
977
+ model = DescribePartitionsResponse.new
978
+ model.deserialize(response['Response'])
979
+ model
980
+ else
981
+ code = response['Response']['Error']['Code']
982
+ message = response['Response']['Error']['Message']
983
+ reqid = response['Response']['RequestId']
984
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
985
+ end
986
+ rescue TencentCloud::Common::TencentCloudSDKException => e
987
+ raise e
988
+ rescue StandardError => e
989
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
990
+ end
991
+
992
+ # 获取投递任务列表
993
+
994
+ # @param request: Request instance for DescribeShipperTasks.
995
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeShipperTasksRequest`
996
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeShipperTasksResponse`
997
+ def DescribeShipperTasks(request)
998
+ body = send_request('DescribeShipperTasks', request.serialize)
999
+ response = JSON.parse(body)
1000
+ if response['Response'].key?('Error') == false
1001
+ model = DescribeShipperTasksResponse.new
1002
+ model.deserialize(response['Response'])
1003
+ model
1004
+ else
1005
+ code = response['Response']['Error']['Code']
1006
+ message = response['Response']['Error']['Message']
1007
+ reqid = response['Response']['RequestId']
1008
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1009
+ end
1010
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1011
+ raise e
1012
+ rescue StandardError => e
1013
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1014
+ end
1015
+
1016
+ # 获取投递规则信息列表
1017
+
1018
+ # @param request: Request instance for DescribeShippers.
1019
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeShippersRequest`
1020
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeShippersResponse`
1021
+ def DescribeShippers(request)
1022
+ body = send_request('DescribeShippers', request.serialize)
1023
+ response = JSON.parse(body)
1024
+ if response['Response'].key?('Error') == false
1025
+ model = DescribeShippersResponse.new
1026
+ model.deserialize(response['Response'])
1027
+ model
1028
+ else
1029
+ code = response['Response']['Error']['Code']
1030
+ message = response['Response']['Error']['Message']
1031
+ reqid = response['Response']['RequestId']
1032
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1033
+ end
1034
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1035
+ raise e
1036
+ rescue StandardError => e
1037
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1038
+ end
1039
+
1040
+ # 本接口用于获取日志主题列表,支持分页
1041
+
1042
+ # @param request: Request instance for DescribeTopics.
1043
+ # @type request: :class:`Tencentcloud::cls::V20201016::DescribeTopicsRequest`
1044
+ # @rtype: :class:`Tencentcloud::cls::V20201016::DescribeTopicsResponse`
1045
+ def DescribeTopics(request)
1046
+ body = send_request('DescribeTopics', request.serialize)
1047
+ response = JSON.parse(body)
1048
+ if response['Response'].key?('Error') == false
1049
+ model = DescribeTopicsResponse.new
1050
+ model.deserialize(response['Response'])
1051
+ model
1052
+ else
1053
+ code = response['Response']['Error']['Code']
1054
+ message = response['Response']['Error']['Message']
1055
+ reqid = response['Response']['RequestId']
1056
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1057
+ end
1058
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1059
+ raise e
1060
+ rescue StandardError => e
1061
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1062
+ end
1063
+
1064
+ # 本接口用于获取告警任务历史
1065
+
1066
+ # @param request: Request instance for GetAlarmLog.
1067
+ # @type request: :class:`Tencentcloud::cls::V20201016::GetAlarmLogRequest`
1068
+ # @rtype: :class:`Tencentcloud::cls::V20201016::GetAlarmLogResponse`
1069
+ def GetAlarmLog(request)
1070
+ body = send_request('GetAlarmLog', request.serialize)
1071
+ response = JSON.parse(body)
1072
+ if response['Response'].key?('Error') == false
1073
+ model = GetAlarmLogResponse.new
1074
+ model.deserialize(response['Response'])
1075
+ model
1076
+ else
1077
+ code = response['Response']['Error']['Code']
1078
+ message = response['Response']['Error']['Message']
1079
+ reqid = response['Response']['RequestId']
1080
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1081
+ end
1082
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1083
+ raise e
1084
+ rescue StandardError => e
1085
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1086
+ end
1087
+
1088
+ # 本接口用于合并一个读写态的主题分区,合并时指定一个主题分区 ID,日志服务会自动合并范围右相邻的分区。
1089
+
1090
+ # @param request: Request instance for MergePartition.
1091
+ # @type request: :class:`Tencentcloud::cls::V20201016::MergePartitionRequest`
1092
+ # @rtype: :class:`Tencentcloud::cls::V20201016::MergePartitionResponse`
1093
+ def MergePartition(request)
1094
+ body = send_request('MergePartition', request.serialize)
1095
+ response = JSON.parse(body)
1096
+ if response['Response'].key?('Error') == false
1097
+ model = MergePartitionResponse.new
1098
+ model.deserialize(response['Response'])
1099
+ model
1100
+ else
1101
+ code = response['Response']['Error']['Code']
1102
+ message = response['Response']['Error']['Message']
1103
+ reqid = response['Response']['RequestId']
1104
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1105
+ end
1106
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1107
+ raise e
1108
+ rescue StandardError => e
1109
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1110
+ end
1111
+
1112
+ # 本接口用于修改告警策略。需要至少修改一项有效内容。
1113
+
1114
+ # @param request: Request instance for ModifyAlarm.
1115
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyAlarmRequest`
1116
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyAlarmResponse`
1117
+ def ModifyAlarm(request)
1118
+ body = send_request('ModifyAlarm', request.serialize)
1119
+ response = JSON.parse(body)
1120
+ if response['Response'].key?('Error') == false
1121
+ model = ModifyAlarmResponse.new
1122
+ model.deserialize(response['Response'])
1123
+ model
1124
+ else
1125
+ code = response['Response']['Error']['Code']
1126
+ message = response['Response']['Error']['Message']
1127
+ reqid = response['Response']['RequestId']
1128
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1129
+ end
1130
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1131
+ raise e
1132
+ rescue StandardError => e
1133
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1134
+ end
1135
+
1136
+ # 该接口用于修改告警通知模板。
1137
+
1138
+ # @param request: Request instance for ModifyAlarmNotice.
1139
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyAlarmNoticeRequest`
1140
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyAlarmNoticeResponse`
1141
+ def ModifyAlarmNotice(request)
1142
+ body = send_request('ModifyAlarmNotice', request.serialize)
1143
+ response = JSON.parse(body)
1144
+ if response['Response'].key?('Error') == false
1145
+ model = ModifyAlarmNoticeResponse.new
1146
+ model.deserialize(response['Response'])
1147
+ model
1148
+ else
1149
+ code = response['Response']['Error']['Code']
1150
+ message = response['Response']['Error']['Message']
1151
+ reqid = response['Response']['RequestId']
1152
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1153
+ end
1154
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1155
+ raise e
1156
+ rescue StandardError => e
1157
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1158
+ end
1159
+
1160
+ # 修改采集规则配置
1161
+
1162
+ # @param request: Request instance for ModifyConfig.
1163
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyConfigRequest`
1164
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyConfigResponse`
1165
+ def ModifyConfig(request)
1166
+ body = send_request('ModifyConfig', request.serialize)
1167
+ response = JSON.parse(body)
1168
+ if response['Response'].key?('Error') == false
1169
+ model = ModifyConfigResponse.new
1170
+ model.deserialize(response['Response'])
1171
+ model
1172
+ else
1173
+ code = response['Response']['Error']['Code']
1174
+ message = response['Response']['Error']['Message']
1175
+ reqid = response['Response']['RequestId']
1176
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1177
+ end
1178
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1179
+ raise e
1180
+ rescue StandardError => e
1181
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1182
+ end
1183
+
1184
+ # 本接口用于修改索引配置
1185
+
1186
+ # @param request: Request instance for ModifyIndex.
1187
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyIndexRequest`
1188
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyIndexResponse`
1189
+ def ModifyIndex(request)
1190
+ body = send_request('ModifyIndex', request.serialize)
1191
+ response = JSON.parse(body)
1192
+ if response['Response'].key?('Error') == false
1193
+ model = ModifyIndexResponse.new
1194
+ model.deserialize(response['Response'])
1195
+ model
1196
+ else
1197
+ code = response['Response']['Error']['Code']
1198
+ message = response['Response']['Error']['Message']
1199
+ reqid = response['Response']['RequestId']
1200
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1201
+ end
1202
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1203
+ raise e
1204
+ rescue StandardError => e
1205
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1206
+ end
1207
+
1208
+ # 本接口用于修改日志集信息
1209
+
1210
+ # @param request: Request instance for ModifyLogset.
1211
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyLogsetRequest`
1212
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyLogsetResponse`
1213
+ def ModifyLogset(request)
1214
+ body = send_request('ModifyLogset', request.serialize)
1215
+ response = JSON.parse(body)
1216
+ if response['Response'].key?('Error') == false
1217
+ model = ModifyLogsetResponse.new
1218
+ model.deserialize(response['Response'])
1219
+ model
1220
+ else
1221
+ code = response['Response']['Error']['Code']
1222
+ message = response['Response']['Error']['Message']
1223
+ reqid = response['Response']['RequestId']
1224
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1225
+ end
1226
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1227
+ raise e
1228
+ rescue StandardError => e
1229
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1230
+ end
1231
+
1232
+ # 修改机器组
1233
+
1234
+ # @param request: Request instance for ModifyMachineGroup.
1235
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyMachineGroupRequest`
1236
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyMachineGroupResponse`
1237
+ def ModifyMachineGroup(request)
1238
+ body = send_request('ModifyMachineGroup', request.serialize)
1239
+ response = JSON.parse(body)
1240
+ if response['Response'].key?('Error') == false
1241
+ model = ModifyMachineGroupResponse.new
1242
+ model.deserialize(response['Response'])
1243
+ model
1244
+ else
1245
+ code = response['Response']['Error']['Code']
1246
+ message = response['Response']['Error']['Message']
1247
+ reqid = response['Response']['RequestId']
1248
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1249
+ end
1250
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1251
+ raise e
1252
+ rescue StandardError => e
1253
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1254
+ end
1255
+
1256
+ # 修改现有的投递规则,客户如果使用此接口,需要自行处理CLS对指定bucket的写权限。
1257
+
1258
+ # @param request: Request instance for ModifyShipper.
1259
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyShipperRequest`
1260
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyShipperResponse`
1261
+ def ModifyShipper(request)
1262
+ body = send_request('ModifyShipper', request.serialize)
1263
+ response = JSON.parse(body)
1264
+ if response['Response'].key?('Error') == false
1265
+ model = ModifyShipperResponse.new
1266
+ model.deserialize(response['Response'])
1267
+ model
1268
+ else
1269
+ code = response['Response']['Error']['Code']
1270
+ message = response['Response']['Error']['Message']
1271
+ reqid = response['Response']['RequestId']
1272
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1273
+ end
1274
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1275
+ raise e
1276
+ rescue StandardError => e
1277
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1278
+ end
1279
+
1280
+ # 本接口用于修改日志主题。
1281
+
1282
+ # @param request: Request instance for ModifyTopic.
1283
+ # @type request: :class:`Tencentcloud::cls::V20201016::ModifyTopicRequest`
1284
+ # @rtype: :class:`Tencentcloud::cls::V20201016::ModifyTopicResponse`
1285
+ def ModifyTopic(request)
1286
+ body = send_request('ModifyTopic', request.serialize)
1287
+ response = JSON.parse(body)
1288
+ if response['Response'].key?('Error') == false
1289
+ model = ModifyTopicResponse.new
1290
+ model.deserialize(response['Response'])
1291
+ model
1292
+ else
1293
+ code = response['Response']['Error']['Code']
1294
+ message = response['Response']['Error']['Message']
1295
+ reqid = response['Response']['RequestId']
1296
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1297
+ end
1298
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1299
+ raise e
1300
+ rescue StandardError => e
1301
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1302
+ end
1303
+
1304
+ # 重试失败的投递任务
1305
+
1306
+ # @param request: Request instance for RetryShipperTask.
1307
+ # @type request: :class:`Tencentcloud::cls::V20201016::RetryShipperTaskRequest`
1308
+ # @rtype: :class:`Tencentcloud::cls::V20201016::RetryShipperTaskResponse`
1309
+ def RetryShipperTask(request)
1310
+ body = send_request('RetryShipperTask', request.serialize)
1311
+ response = JSON.parse(body)
1312
+ if response['Response'].key?('Error') == false
1313
+ model = RetryShipperTaskResponse.new
1314
+ model.deserialize(response['Response'])
1315
+ model
1316
+ else
1317
+ code = response['Response']['Error']['Code']
1318
+ message = response['Response']['Error']['Message']
1319
+ reqid = response['Response']['RequestId']
1320
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1321
+ end
1322
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1323
+ raise e
1324
+ rescue StandardError => e
1325
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1326
+ end
1327
+
1328
+ # 本接口用于搜索日志
1329
+
1330
+ # @param request: Request instance for SearchLog.
1331
+ # @type request: :class:`Tencentcloud::cls::V20201016::SearchLogRequest`
1332
+ # @rtype: :class:`Tencentcloud::cls::V20201016::SearchLogResponse`
1333
+ def SearchLog(request)
1334
+ body = send_request('SearchLog', request.serialize)
1335
+ response = JSON.parse(body)
1336
+ if response['Response'].key?('Error') == false
1337
+ model = SearchLogResponse.new
1338
+ model.deserialize(response['Response'])
1339
+ model
1340
+ else
1341
+ code = response['Response']['Error']['Code']
1342
+ message = response['Response']['Error']['Message']
1343
+ reqid = response['Response']['RequestId']
1344
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1345
+ end
1346
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1347
+ raise e
1348
+ rescue StandardError => e
1349
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1350
+ end
1351
+
1352
+ # 本接口用于分裂主题分区
1353
+
1354
+ # @param request: Request instance for SplitPartition.
1355
+ # @type request: :class:`Tencentcloud::cls::V20201016::SplitPartitionRequest`
1356
+ # @rtype: :class:`Tencentcloud::cls::V20201016::SplitPartitionResponse`
1357
+ def SplitPartition(request)
1358
+ body = send_request('SplitPartition', request.serialize)
1359
+ response = JSON.parse(body)
1360
+ if response['Response'].key?('Error') == false
1361
+ model = SplitPartitionResponse.new
1362
+ model.deserialize(response['Response'])
1363
+ model
1364
+ else
1365
+ code = response['Response']['Error']['Code']
1366
+ message = response['Response']['Error']['Message']
1367
+ reqid = response['Response']['RequestId']
1368
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1369
+ end
1370
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1371
+ raise e
1372
+ rescue StandardError => e
1373
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1374
+ end
1375
+
1376
+ # ## 功能描述
1377
+
1378
+ # 本接口用于将日志写入到指定的日志主题。
1379
+
1380
+ # 日志服务提供以下两种模式:
1381
+
1382
+ # #### 负载均衡模式
1383
+
1384
+ # 系统根据当前日志主题下所有可读写的分区,遵循负载均衡原则自动分配写入的目标分区。该模式适合消费不保序的场景。
1385
+
1386
+ # #### 哈希路由模式
1387
+
1388
+ # 系统根据携带的哈希值(X-CLS-HashKey)将数据写入到符合范围要求的目标分区。例如,可以将某个日志源端通过 hashkey 与某个主题分区强绑定,这样可以保证数据在该分区上写入和消费是严格保序的。
1389
+
1390
+ # 此外日志服务还为用户提供以下两种不同的日志上传模式:
1391
+
1392
+
1393
+ # #### 输入参数(pb二进制流,位于body中)
1394
+
1395
+ # | 字段名 | 类型 | 位置 | 必须 | 含义 |
1396
+ # | ------------ | ------- | ---- | ---- | ------------------------------------------------------------ |
1397
+ # | logGroupList | message | pb | 是 | logGroup 列表,封装好的日志组列表内容,建议 logGroup 数量不要超过5个 |
1398
+
1399
+ # LogGroup 说明:
1400
+
1401
+ # | 字段名 | 是否必选 | 含义 |
1402
+ # | ----------- | -------- | ------------------------------------------------------------ |
1403
+ # | logs | 是 | 日志数组,表示有多个 Log 组成的集合,一个 Log 表示一条日志,一个 LogGroup 中 Log 个数不能超过10000 |
1404
+ # | contextFlow | 否 | LogGroup 的唯一ID,需要使用上下文功能时传入。格式:"{上下文ID}-{LogGroupID}"。<br>上下文ID:唯一标识一个上下文(连续滚动的一系列日志文件,或者是需要保序的一系列日志),16进制64位整型字符串。<br>LogGroupID:连续递增的一串整型,16进制64位整型字符串。样例:"102700A66102516A-59F59"。 |
1405
+ # | filename | 否 | 日志文件名 |
1406
+ # | source | 否 | 日志来源,一般使用机器 IP 作为标识 |
1407
+ # | logTags | 否 | 日志的标签列表 |
1408
+
1409
+ # Log 说明:
1410
+
1411
+ # | 字段名 | 是否必选 | 含义 |
1412
+ # | -------- | -------- | ------------------------------------------------------------ |
1413
+ # | time | 是 | 日志时间(Unix 格式时间戳),支持秒、毫秒,建议采用毫秒 |
1414
+ # | contents | 否 | key-value 格式的日志内容,表示一条日志里的多个 key-value 组合 |
1415
+
1416
+ # Content 说明:
1417
+
1418
+ # | 字段名 | 是否必选 | 含义 |
1419
+ # | ------ | -------- | ------------------------------------------------------------ |
1420
+ # | key | 是 | 单条日志里某个字段组的 key 值,不能以`_`开头 |
1421
+ # | value | 是 | 单条日志某个字段组的 value 值,单条日志 value 不能超过1MB,LogGroup 中所有 value 总和不能超过5MB |
1422
+
1423
+ # LogTag 说明:
1424
+
1425
+ # | 字段名 | 是否必选 | 含义 |
1426
+ # | ------ | -------- | -------------------------------- |
1427
+ # | key | 是 | 自定义的标签 key |
1428
+ # | value | 是 | 自定义的标签 key 对应的 value 值 |
1429
+
1430
+ # ## PB 编译示例
1431
+
1432
+ # 本示例将说明如何使用官方 protoc 编译工具将 PB 描述文件 编译生成为 C++ 语言可调用的上传日志接口。
1433
+
1434
+ # > ?目前 protoc 官方支持 Java、C++、Python 等语言的编译,详情请参见 [protoc](https://github.com/protocolbuffers/protobuf)。
1435
+
1436
+ # #### 1. 安装 Protocol Buffer
1437
+
1438
+ # 下载 [Protocol Buffer](https://main.qcloudimg.com/raw/d7810aaf8b3073fbbc9d4049c21532aa/protobuf-2.6.1.tar.gz) ,解压并安装。示例版本为 protobuf 2.6.1,环境为 Centos 7.3 系统。 解压`protobuf-2.6.1.tar.gz`压缩包至`/usr/local`目录并进入该目录,执行命令如下:
1439
+
1440
+ # ```
1441
+ # tar -zxvf protobuf-2.6.1.tar.gz -C /usr/local/ && cd /usr/local/protobuf-2.6.1
1442
+ # ```
1443
+
1444
+ # 开始编译和安装,配置环境变量,执行命令如下:
1445
+
1446
+ # ```
1447
+ # [root@VM_0_8_centos protobuf-2.6.1]# ./configure
1448
+ # [root@VM_0_8_centos protobuf-2.6.1]# make && make install
1449
+ # [root@VM_0_8_centos protobuf-2.6.1]# export PATH=$PATH:/usr/local/protobuf-2.6.1/bin
1450
+ # ```
1451
+
1452
+ # 编译成功后,您可以使用以下命令查看版本:
1453
+
1454
+ # ```
1455
+ # [root@VM_0_8_centos protobuf-2.6.1]# protoc --version
1456
+ # liprotoc 2.6.1
1457
+ # ```
1458
+
1459
+ # #### 2. 创建 PB 描述文件
1460
+
1461
+ # PB 描述文件是通信双方约定的数据交换格式,上传日志时须将规定的协议格式编译成对应语言版本的调用接口,然后添加到工程代码里,详情请参见 [protoc](https://github.com/protocolbuffers/protobuf) 。
1462
+
1463
+ # 以日志服务所规定的 PB 数据格式内容为准, 在本地创建 PB 消息描述文件 cls.proto。
1464
+
1465
+ # > !PB 描述文件内容不可更改,且文件名须以`.proto`结尾。
1466
+
1467
+ # cls.proto 内容(PB 描述文件)如下:
1468
+
1469
+ # ```
1470
+ # package cls;
1471
+
1472
+ # message Log
1473
+ # {
1474
+ # message Content
1475
+ # {
1476
+ # required string key = 1; // 每组字段的 key
1477
+ # required string value = 2; // 每组字段的 value
1478
+ # }
1479
+ # required int64 time = 1; // 时间戳,UNIX时间格式
1480
+ # repeated Content contents = 2; // 一条日志里的多个kv组合
1481
+ # }
1482
+
1483
+ # message LogTag
1484
+ # {
1485
+ # required string key = 1;
1486
+ # required string value = 2;
1487
+ # }
1488
+
1489
+ # message LogGroup
1490
+ # {
1491
+ # repeated Log logs = 1; // 多条日志合成的日志数组
1492
+ # optional string contextFlow = 2; // 目前暂无效用
1493
+ # optional string filename = 3; // 日志文件名
1494
+ # optional string source = 4; // 日志来源,一般使用机器IP
1495
+ # repeated LogTag logTags = 5;
1496
+ # }
1497
+
1498
+ # message LogGroupList
1499
+ # {
1500
+ # repeated LogGroup logGroupList = 1; // 日志组列表
1501
+ # }
1502
+ # ```
1503
+
1504
+ # #### 3. 编译生成
1505
+
1506
+ # 此例中,使用 proto 编译器生成 C++ 语言的文件,在 cls.proto 文件的同一目录下,执行如下编译命令:
1507
+
1508
+ # ```
1509
+ # protoc --cpp_out=./ ./cls.proto
1510
+ # ```
1511
+
1512
+ # > ?`--cpp_out=./`表示编译成 cpp 格式并输出当前目录下,`./cls.proto`表示位于当前目录下的 cls.proto 描述文件。
1513
+
1514
+ # 编译成功后,会输出对应语言的代码文件。此例会生成 cls.pb.h 头文件和 [cls.pb.cc](http://cls.pb.cc) 代码实现文件,如下所示:
1515
+
1516
+ # ```
1517
+ # [root@VM_0_8_centos protobuf-2.6.1]# protoc --cpp_out=./ ./cls.proto
1518
+ # [root@VM_0_8_centos protobuf-2.6.1]# ls
1519
+ # cls.pb.cc cls.pb.h cls.proto
1520
+ # ```
1521
+
1522
+ # #### 4. 调用
1523
+
1524
+ # 将生成的 cls.pb.h 头文件引入代码中,调用接口进行数据格式封装。
1525
+
1526
+ # @param request: Request instance for UploadLog.
1527
+ # @type request: :class:`Tencentcloud::cls::V20201016::UploadLogRequest`
1528
+ # @rtype: :class:`Tencentcloud::cls::V20201016::UploadLogResponse`
1529
+ def UploadLog(request)
1530
+ body = send_request('UploadLog', request.serialize)
1531
+ response = JSON.parse(body)
1532
+ if response['Response'].key?('Error') == false
1533
+ model = UploadLogResponse.new
1534
+ model.deserialize(response['Response'])
1535
+ model
1536
+ else
1537
+ code = response['Response']['Error']['Code']
1538
+ message = response['Response']['Error']['Message']
1539
+ reqid = response['Response']['RequestId']
1540
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1541
+ end
1542
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1543
+ raise e
1544
+ rescue StandardError => e
1545
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1546
+ end
1547
+
1548
+
1549
+ end
1550
+ end
1551
+ end
1552
+ end