tencentcloud-sdk-ssm 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: 0dc0451e3051d7ab611a1f15764c61717a5067fd
4
+ data.tar.gz: 99db22f343c3f1599f4913317fe82fab3e14af5f
5
+ SHA512:
6
+ metadata.gz: 9386e0d20091335857d08141396d0cdc5c7f7245ac270c2272de6cdfea883504f30853812e37134a3ba5c8a8e2cf356a7aca910d8a8f1ec664fa4d9b0d2fe2ea
7
+ data.tar.gz: 227b9d0c2b491849dd66c91dc1c5b55b3794ee701facf8f1aa92ef5ed363a4700220af6707cf6d922dc55d7ed01c0b43f9bd5073aeaeff54c8e28cbd46ac7737
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 'v20190923/client'
6
+ require_relative 'v20190923/models'
7
+
8
+ module TencentCloud
9
+ module Ssm
10
+ end
11
+ end
@@ -0,0 +1,621 @@
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 Ssm
21
+ module V20190923
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2019-09-23'
26
+ api_endpoint = 'ssm.tencentcloudapi.com'
27
+ sdk_version = 'SSM_' + 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 CreateProductSecret.
35
+ # @type request: :class:`Tencentcloud::ssm::V20190923::CreateProductSecretRequest`
36
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::CreateProductSecretResponse`
37
+ def CreateProductSecret(request)
38
+ body = send_request('CreateProductSecret', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = CreateProductSecretResponse.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
+ # 创建用于托管SSH密钥对的凭据
57
+
58
+ # @param request: Request instance for CreateSSHKeyPairSecret.
59
+ # @type request: :class:`Tencentcloud::ssm::V20190923::CreateSSHKeyPairSecretRequest`
60
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::CreateSSHKeyPairSecretResponse`
61
+ def CreateSSHKeyPairSecret(request)
62
+ body = send_request('CreateSSHKeyPairSecret', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CreateSSHKeyPairSecretResponse.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
+ # 创建新的凭据信息,通过KMS进行加密保护。每个Region最多可创建存储1000个凭据信息。
81
+
82
+ # @param request: Request instance for CreateSecret.
83
+ # @type request: :class:`Tencentcloud::ssm::V20190923::CreateSecretRequest`
84
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::CreateSecretResponse`
85
+ def CreateSecret(request)
86
+ body = send_request('CreateSecret', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = CreateSecretResponse.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
+ # 删除指定的凭据信息,可以通过RecoveryWindowInDays参数设置立即删除或者计划删除。对于计划删除的凭据,在删除日期到达之前状态为 PendingDelete,并可以通过RestoreSecret 进行恢复,超出指定删除日期之后会被彻底删除。您必须先通过 DisableSecret 停用凭据后才可以进行(计划)删除操作。
105
+
106
+ # @param request: Request instance for DeleteSecret.
107
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DeleteSecretRequest`
108
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DeleteSecretResponse`
109
+ def DeleteSecret(request)
110
+ body = send_request('DeleteSecret', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = DeleteSecretResponse.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
+
131
+ # @param request: Request instance for DeleteSecretVersion.
132
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DeleteSecretVersionRequest`
133
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DeleteSecretVersionResponse`
134
+ def DeleteSecretVersion(request)
135
+ body = send_request('DeleteSecretVersion', request.serialize)
136
+ response = JSON.parse(body)
137
+ if response['Response'].key?('Error') == false
138
+ model = DeleteSecretVersionResponse.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 DescribeAsyncRequestInfo.
156
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DescribeAsyncRequestInfoRequest`
157
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DescribeAsyncRequestInfoResponse`
158
+ def DescribeAsyncRequestInfo(request)
159
+ body = send_request('DescribeAsyncRequestInfo', request.serialize)
160
+ response = JSON.parse(body)
161
+ if response['Response'].key?('Error') == false
162
+ model = DescribeAsyncRequestInfoResponse.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
+
180
+ # @param request: Request instance for DescribeRotationDetail.
181
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DescribeRotationDetailRequest`
182
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DescribeRotationDetailResponse`
183
+ def DescribeRotationDetail(request)
184
+ body = send_request('DescribeRotationDetail', request.serialize)
185
+ response = JSON.parse(body)
186
+ if response['Response'].key?('Error') == false
187
+ model = DescribeRotationDetailResponse.new
188
+ model.deserialize(response['Response'])
189
+ model
190
+ else
191
+ code = response['Response']['Error']['Code']
192
+ message = response['Response']['Error']['Message']
193
+ reqid = response['Response']['RequestId']
194
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
195
+ end
196
+ rescue TencentCloud::Common::TencentCloudSDKException => e
197
+ raise e
198
+ rescue StandardError => e
199
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
200
+ end
201
+
202
+ # 查询凭据轮转历史版本。
203
+ # 本接口仅适用于云产品凭据。
204
+
205
+ # @param request: Request instance for DescribeRotationHistory.
206
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DescribeRotationHistoryRequest`
207
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DescribeRotationHistoryResponse`
208
+ def DescribeRotationHistory(request)
209
+ body = send_request('DescribeRotationHistory', request.serialize)
210
+ response = JSON.parse(body)
211
+ if response['Response'].key?('Error') == false
212
+ model = DescribeRotationHistoryResponse.new
213
+ model.deserialize(response['Response'])
214
+ model
215
+ else
216
+ code = response['Response']['Error']['Code']
217
+ message = response['Response']['Error']['Message']
218
+ reqid = response['Response']['RequestId']
219
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
220
+ end
221
+ rescue TencentCloud::Common::TencentCloudSDKException => e
222
+ raise e
223
+ rescue StandardError => e
224
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
225
+ end
226
+
227
+ # 获取凭据的详细属性信息。
228
+
229
+ # @param request: Request instance for DescribeSecret.
230
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DescribeSecretRequest`
231
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DescribeSecretResponse`
232
+ def DescribeSecret(request)
233
+ body = send_request('DescribeSecret', request.serialize)
234
+ response = JSON.parse(body)
235
+ if response['Response'].key?('Error') == false
236
+ model = DescribeSecretResponse.new
237
+ model.deserialize(response['Response'])
238
+ model
239
+ else
240
+ code = response['Response']['Error']['Code']
241
+ message = response['Response']['Error']['Message']
242
+ reqid = response['Response']['RequestId']
243
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
244
+ end
245
+ rescue TencentCloud::Common::TencentCloudSDKException => e
246
+ raise e
247
+ rescue StandardError => e
248
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
249
+ end
250
+
251
+ # 查询支持的云产品列表
252
+
253
+ # @param request: Request instance for DescribeSupportedProducts.
254
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DescribeSupportedProductsRequest`
255
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DescribeSupportedProductsResponse`
256
+ def DescribeSupportedProducts(request)
257
+ body = send_request('DescribeSupportedProducts', request.serialize)
258
+ response = JSON.parse(body)
259
+ if response['Response'].key?('Error') == false
260
+ model = DescribeSupportedProductsResponse.new
261
+ model.deserialize(response['Response'])
262
+ model
263
+ else
264
+ code = response['Response']['Error']['Code']
265
+ message = response['Response']['Error']['Message']
266
+ reqid = response['Response']['RequestId']
267
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
268
+ end
269
+ rescue TencentCloud::Common::TencentCloudSDKException => e
270
+ raise e
271
+ rescue StandardError => e
272
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
273
+ end
274
+
275
+ # 停用指定的凭据,停用后状态为 Disabled,无法通过接口获取该凭据的明文。
276
+
277
+ # @param request: Request instance for DisableSecret.
278
+ # @type request: :class:`Tencentcloud::ssm::V20190923::DisableSecretRequest`
279
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::DisableSecretResponse`
280
+ def DisableSecret(request)
281
+ body = send_request('DisableSecret', request.serialize)
282
+ response = JSON.parse(body)
283
+ if response['Response'].key?('Error') == false
284
+ model = DisableSecretResponse.new
285
+ model.deserialize(response['Response'])
286
+ model
287
+ else
288
+ code = response['Response']['Error']['Code']
289
+ message = response['Response']['Error']['Message']
290
+ reqid = response['Response']['RequestId']
291
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
292
+ end
293
+ rescue TencentCloud::Common::TencentCloudSDKException => e
294
+ raise e
295
+ rescue StandardError => e
296
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
297
+ end
298
+
299
+ # 该接口用于开启凭据,状态为Enabled。可以通过 GetSecretValue 接口获取凭据明文。处于PendingDelete状态的凭据不能直接开启,需要通过RestoreSecret 恢复后再开启使用。
300
+
301
+ # @param request: Request instance for EnableSecret.
302
+ # @type request: :class:`Tencentcloud::ssm::V20190923::EnableSecretRequest`
303
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::EnableSecretResponse`
304
+ def EnableSecret(request)
305
+ body = send_request('EnableSecret', request.serialize)
306
+ response = JSON.parse(body)
307
+ if response['Response'].key?('Error') == false
308
+ model = EnableSecretResponse.new
309
+ model.deserialize(response['Response'])
310
+ model
311
+ else
312
+ code = response['Response']['Error']['Code']
313
+ message = response['Response']['Error']['Message']
314
+ reqid = response['Response']['RequestId']
315
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
316
+ end
317
+ rescue TencentCloud::Common::TencentCloudSDKException => e
318
+ raise e
319
+ rescue StandardError => e
320
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
321
+ end
322
+
323
+ # 获取控制台展示region列表
324
+
325
+ # @param request: Request instance for GetRegions.
326
+ # @type request: :class:`Tencentcloud::ssm::V20190923::GetRegionsRequest`
327
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::GetRegionsResponse`
328
+ def GetRegions(request)
329
+ body = send_request('GetRegions', request.serialize)
330
+ response = JSON.parse(body)
331
+ if response['Response'].key?('Error') == false
332
+ model = GetRegionsResponse.new
333
+ model.deserialize(response['Response'])
334
+ model
335
+ else
336
+ code = response['Response']['Error']['Code']
337
+ message = response['Response']['Error']['Message']
338
+ reqid = response['Response']['RequestId']
339
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
340
+ end
341
+ rescue TencentCloud::Common::TencentCloudSDKException => e
342
+ raise e
343
+ rescue StandardError => e
344
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
345
+ end
346
+
347
+ # 获取SSH密钥对凭据明文信息。
348
+
349
+ # @param request: Request instance for GetSSHKeyPairValue.
350
+ # @type request: :class:`Tencentcloud::ssm::V20190923::GetSSHKeyPairValueRequest`
351
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::GetSSHKeyPairValueResponse`
352
+ def GetSSHKeyPairValue(request)
353
+ body = send_request('GetSSHKeyPairValue', request.serialize)
354
+ response = JSON.parse(body)
355
+ if response['Response'].key?('Error') == false
356
+ model = GetSSHKeyPairValueResponse.new
357
+ model.deserialize(response['Response'])
358
+ model
359
+ else
360
+ code = response['Response']['Error']['Code']
361
+ message = response['Response']['Error']['Message']
362
+ reqid = response['Response']['RequestId']
363
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
364
+ end
365
+ rescue TencentCloud::Common::TencentCloudSDKException => e
366
+ raise e
367
+ rescue StandardError => e
368
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
369
+ end
370
+
371
+ # 对于用户自定义凭据,通过指定凭据名称和版本来获取凭据的明文信息;
372
+ # 对于云产品凭据如Mysql凭据,通过指定凭据名称和历史版本号来获取历史轮转凭据的明文信息,如果要获取当前正在使用的凭据版本的明文,需要将版本号指定为:SSM_Current。
373
+
374
+ # @param request: Request instance for GetSecretValue.
375
+ # @type request: :class:`Tencentcloud::ssm::V20190923::GetSecretValueRequest`
376
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::GetSecretValueResponse`
377
+ def GetSecretValue(request)
378
+ body = send_request('GetSecretValue', request.serialize)
379
+ response = JSON.parse(body)
380
+ if response['Response'].key?('Error') == false
381
+ model = GetSecretValueResponse.new
382
+ model.deserialize(response['Response'])
383
+ model
384
+ else
385
+ code = response['Response']['Error']['Code']
386
+ message = response['Response']['Error']['Message']
387
+ reqid = response['Response']['RequestId']
388
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
389
+ end
390
+ rescue TencentCloud::Common::TencentCloudSDKException => e
391
+ raise e
392
+ rescue StandardError => e
393
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
394
+ end
395
+
396
+ # 该接口用户获取用户SecretsManager服务开通状态。
397
+
398
+ # @param request: Request instance for GetServiceStatus.
399
+ # @type request: :class:`Tencentcloud::ssm::V20190923::GetServiceStatusRequest`
400
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::GetServiceStatusResponse`
401
+ def GetServiceStatus(request)
402
+ body = send_request('GetServiceStatus', request.serialize)
403
+ response = JSON.parse(body)
404
+ if response['Response'].key?('Error') == false
405
+ model = GetServiceStatusResponse.new
406
+ model.deserialize(response['Response'])
407
+ model
408
+ else
409
+ code = response['Response']['Error']['Code']
410
+ message = response['Response']['Error']['Message']
411
+ reqid = response['Response']['RequestId']
412
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
413
+ end
414
+ rescue TencentCloud::Common::TencentCloudSDKException => e
415
+ raise e
416
+ rescue StandardError => e
417
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
418
+ end
419
+
420
+ # 该接口用于获取指定凭据下的版本列表信息
421
+
422
+ # @param request: Request instance for ListSecretVersionIds.
423
+ # @type request: :class:`Tencentcloud::ssm::V20190923::ListSecretVersionIdsRequest`
424
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::ListSecretVersionIdsResponse`
425
+ def ListSecretVersionIds(request)
426
+ body = send_request('ListSecretVersionIds', request.serialize)
427
+ response = JSON.parse(body)
428
+ if response['Response'].key?('Error') == false
429
+ model = ListSecretVersionIdsResponse.new
430
+ model.deserialize(response['Response'])
431
+ model
432
+ else
433
+ code = response['Response']['Error']['Code']
434
+ message = response['Response']['Error']['Message']
435
+ reqid = response['Response']['RequestId']
436
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
437
+ end
438
+ rescue TencentCloud::Common::TencentCloudSDKException => e
439
+ raise e
440
+ rescue StandardError => e
441
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
442
+ end
443
+
444
+ # 该接口用于获取所有凭据的详细列表,可以指定过滤字段、排序方式等。
445
+
446
+ # @param request: Request instance for ListSecrets.
447
+ # @type request: :class:`Tencentcloud::ssm::V20190923::ListSecretsRequest`
448
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::ListSecretsResponse`
449
+ def ListSecrets(request)
450
+ body = send_request('ListSecrets', request.serialize)
451
+ response = JSON.parse(body)
452
+ if response['Response'].key?('Error') == false
453
+ model = ListSecretsResponse.new
454
+ model.deserialize(response['Response'])
455
+ model
456
+ else
457
+ code = response['Response']['Error']['Code']
458
+ message = response['Response']['Error']['Message']
459
+ reqid = response['Response']['RequestId']
460
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
461
+ end
462
+ rescue TencentCloud::Common::TencentCloudSDKException => e
463
+ raise e
464
+ rescue StandardError => e
465
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
466
+ end
467
+
468
+ # 该接口在指定名称的凭据下增加新版本的凭据内容,一个凭据下最多可以支持10个版本。只能对处于Enabled 和 Disabled 状态的凭据添加新的版本。
469
+ # 本接口仅适用于用户自定义凭据,对云产品凭据不能操作。
470
+
471
+ # @param request: Request instance for PutSecretValue.
472
+ # @type request: :class:`Tencentcloud::ssm::V20190923::PutSecretValueRequest`
473
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::PutSecretValueResponse`
474
+ def PutSecretValue(request)
475
+ body = send_request('PutSecretValue', request.serialize)
476
+ response = JSON.parse(body)
477
+ if response['Response'].key?('Error') == false
478
+ model = PutSecretValueResponse.new
479
+ model.deserialize(response['Response'])
480
+ model
481
+ else
482
+ code = response['Response']['Error']['Code']
483
+ message = response['Response']['Error']['Message']
484
+ reqid = response['Response']['RequestId']
485
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
486
+ end
487
+ rescue TencentCloud::Common::TencentCloudSDKException => e
488
+ raise e
489
+ rescue StandardError => e
490
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
491
+ end
492
+
493
+ # 该接口用于恢复计划删除(PendingDelete状态)中的凭据,取消计划删除。取消计划删除的凭据将处于Disabled 状态,如需恢复使用,通过EnableSecret 接口开启凭据。
494
+
495
+ # @param request: Request instance for RestoreSecret.
496
+ # @type request: :class:`Tencentcloud::ssm::V20190923::RestoreSecretRequest`
497
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::RestoreSecretResponse`
498
+ def RestoreSecret(request)
499
+ body = send_request('RestoreSecret', request.serialize)
500
+ response = JSON.parse(body)
501
+ if response['Response'].key?('Error') == false
502
+ model = RestoreSecretResponse.new
503
+ model.deserialize(response['Response'])
504
+ model
505
+ else
506
+ code = response['Response']['Error']['Code']
507
+ message = response['Response']['Error']['Message']
508
+ reqid = response['Response']['RequestId']
509
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
510
+ end
511
+ rescue TencentCloud::Common::TencentCloudSDKException => e
512
+ raise e
513
+ rescue StandardError => e
514
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
515
+ end
516
+
517
+ # 轮转云产品凭据。该接口仅适用于处于Enabled状态的云产品凭据,对于其他状态的云产品凭据或用户自定义凭据不适用。
518
+
519
+ # @param request: Request instance for RotateProductSecret.
520
+ # @type request: :class:`Tencentcloud::ssm::V20190923::RotateProductSecretRequest`
521
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::RotateProductSecretResponse`
522
+ def RotateProductSecret(request)
523
+ body = send_request('RotateProductSecret', request.serialize)
524
+ response = JSON.parse(body)
525
+ if response['Response'].key?('Error') == false
526
+ model = RotateProductSecretResponse.new
527
+ model.deserialize(response['Response'])
528
+ model
529
+ else
530
+ code = response['Response']['Error']['Code']
531
+ message = response['Response']['Error']['Message']
532
+ reqid = response['Response']['RequestId']
533
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
534
+ end
535
+ rescue TencentCloud::Common::TencentCloudSDKException => e
536
+ raise e
537
+ rescue StandardError => e
538
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
539
+ end
540
+
541
+ # 该接口用于修改指定凭据的描述信息,仅能修改Enabled 和 Disabled 状态的凭据。
542
+
543
+ # @param request: Request instance for UpdateDescription.
544
+ # @type request: :class:`Tencentcloud::ssm::V20190923::UpdateDescriptionRequest`
545
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::UpdateDescriptionResponse`
546
+ def UpdateDescription(request)
547
+ body = send_request('UpdateDescription', request.serialize)
548
+ response = JSON.parse(body)
549
+ if response['Response'].key?('Error') == false
550
+ model = UpdateDescriptionResponse.new
551
+ model.deserialize(response['Response'])
552
+ model
553
+ else
554
+ code = response['Response']['Error']['Code']
555
+ message = response['Response']['Error']['Message']
556
+ reqid = response['Response']['RequestId']
557
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
558
+ end
559
+ rescue TencentCloud::Common::TencentCloudSDKException => e
560
+ raise e
561
+ rescue StandardError => e
562
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
563
+ end
564
+
565
+ # 设置云产品凭据轮转策略,可以设置:
566
+ # 是否开启轮转
567
+ # 轮转周期
568
+ # 轮转开始时间
569
+
570
+ # @param request: Request instance for UpdateRotationStatus.
571
+ # @type request: :class:`Tencentcloud::ssm::V20190923::UpdateRotationStatusRequest`
572
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::UpdateRotationStatusResponse`
573
+ def UpdateRotationStatus(request)
574
+ body = send_request('UpdateRotationStatus', request.serialize)
575
+ response = JSON.parse(body)
576
+ if response['Response'].key?('Error') == false
577
+ model = UpdateRotationStatusResponse.new
578
+ model.deserialize(response['Response'])
579
+ model
580
+ else
581
+ code = response['Response']['Error']['Code']
582
+ message = response['Response']['Error']['Message']
583
+ reqid = response['Response']['RequestId']
584
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
585
+ end
586
+ rescue TencentCloud::Common::TencentCloudSDKException => e
587
+ raise e
588
+ rescue StandardError => e
589
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
590
+ end
591
+
592
+ # 该接口用于更新指定凭据名称和版本号的内容,调用该接口会对新的凭据内容加密后覆盖旧的内容。仅允许更新Enabled 和 Disabled 状态的凭据。
593
+ # 本接口仅适用于用户自定义凭据,不能对云产品凭据操作。
594
+
595
+ # @param request: Request instance for UpdateSecret.
596
+ # @type request: :class:`Tencentcloud::ssm::V20190923::UpdateSecretRequest`
597
+ # @rtype: :class:`Tencentcloud::ssm::V20190923::UpdateSecretResponse`
598
+ def UpdateSecret(request)
599
+ body = send_request('UpdateSecret', request.serialize)
600
+ response = JSON.parse(body)
601
+ if response['Response'].key?('Error') == false
602
+ model = UpdateSecretResponse.new
603
+ model.deserialize(response['Response'])
604
+ model
605
+ else
606
+ code = response['Response']['Error']['Code']
607
+ message = response['Response']['Error']['Message']
608
+ reqid = response['Response']['RequestId']
609
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
610
+ end
611
+ rescue TencentCloud::Common::TencentCloudSDKException => e
612
+ raise e
613
+ rescue StandardError => e
614
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
615
+ end
616
+
617
+
618
+ end
619
+ end
620
+ end
621
+ end