tencentcloud-sdk-dcdb 1.0.200

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1247 @@
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 Dcdb
21
+ module V20180411
22
+ class Client < TencentCloud::Common::AbstractClient
23
+
24
+ def initialize(credential, region, profile = nil)
25
+ api_version = '2018-04-11'
26
+ api_endpoint = 'dcdb.tencentcloudapi.com'
27
+ sdk_version = 'DCDB_' + File.read(File.expand_path('../VERSION', __dir__)).strip
28
+ super(credential, region, api_version, api_endpoint, sdk_version, profile)
29
+ end
30
+
31
+
32
+ # 本接口 (AssociateSecurityGroups) 用于安全组批量绑定云资源。
33
+
34
+ # @param request: Request instance for AssociateSecurityGroups.
35
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::AssociateSecurityGroupsRequest`
36
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::AssociateSecurityGroupsResponse`
37
+ def AssociateSecurityGroups(request)
38
+ body = send_request('AssociateSecurityGroups', request.serialize)
39
+ response = JSON.parse(body)
40
+ if response['Response'].key?('Error') == false
41
+ model = AssociateSecurityGroupsResponse.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
+ # 取消DCN同步
57
+
58
+ # @param request: Request instance for CancelDcnJob.
59
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CancelDcnJobRequest`
60
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CancelDcnJobResponse`
61
+ def CancelDcnJob(request)
62
+ body = send_request('CancelDcnJob', request.serialize)
63
+ response = JSON.parse(body)
64
+ if response['Response'].key?('Error') == false
65
+ model = CancelDcnJobResponse.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
+ # 本接口(CloneAccount)用于克隆实例账户。
81
+
82
+ # @param request: Request instance for CloneAccount.
83
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CloneAccountRequest`
84
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CloneAccountResponse`
85
+ def CloneAccount(request)
86
+ body = send_request('CloneAccount', request.serialize)
87
+ response = JSON.parse(body)
88
+ if response['Response'].key?('Error') == false
89
+ model = CloneAccountResponse.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
+ # 本接口(CloseDBExtranetAccess)用于关闭云数据库实例的外网访问。关闭外网访问后,外网地址将不可访问,查询实例列表接口将不返回对应实例的外网域名和端口信息。
105
+
106
+ # @param request: Request instance for CloseDBExtranetAccess.
107
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CloseDBExtranetAccessRequest`
108
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CloseDBExtranetAccessResponse`
109
+ def CloseDBExtranetAccess(request)
110
+ body = send_request('CloseDBExtranetAccess', request.serialize)
111
+ response = JSON.parse(body)
112
+ if response['Response'].key?('Error') == false
113
+ model = CloseDBExtranetAccessResponse.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
+ # 本接口(CopyAccountPrivileges)用于复制云数据库账号的权限。
129
+ # 注意:相同用户名,不同Host是不同的账号,Readonly属性相同的账号之间才能复制权限。
130
+
131
+ # @param request: Request instance for CopyAccountPrivileges.
132
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CopyAccountPrivilegesRequest`
133
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CopyAccountPrivilegesResponse`
134
+ def CopyAccountPrivileges(request)
135
+ body = send_request('CopyAccountPrivileges', request.serialize)
136
+ response = JSON.parse(body)
137
+ if response['Response'].key?('Error') == false
138
+ model = CopyAccountPrivilegesResponse.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
+ # 本接口(CreateAccount)用于创建云数据库账号。一个实例可以创建多个不同的账号,相同的用户名+不同的host是不同的账号。
154
+
155
+ # @param request: Request instance for CreateAccount.
156
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CreateAccountRequest`
157
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CreateAccountResponse`
158
+ def CreateAccount(request)
159
+ body = send_request('CreateAccount', request.serialize)
160
+ response = JSON.parse(body)
161
+ if response['Response'].key?('Error') == false
162
+ model = CreateAccountResponse.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
+ # 本接口(CreateDCDBInstance)用于创建包年包月的云数据库实例,可通过传入实例规格、数据库版本号、购买时长等信息创建云数据库实例。
178
+
179
+ # @param request: Request instance for CreateDCDBInstance.
180
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CreateDCDBInstanceRequest`
181
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CreateDCDBInstanceResponse`
182
+ def CreateDCDBInstance(request)
183
+ body = send_request('CreateDCDBInstance', request.serialize)
184
+ response = JSON.parse(body)
185
+ if response['Response'].key?('Error') == false
186
+ model = CreateDCDBInstanceResponse.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
+ # 创建独享集群DCDB实例
202
+
203
+ # @param request: Request instance for CreateDedicatedClusterDCDBInstance.
204
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::CreateDedicatedClusterDCDBInstanceRequest`
205
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::CreateDedicatedClusterDCDBInstanceResponse`
206
+ def CreateDedicatedClusterDCDBInstance(request)
207
+ body = send_request('CreateDedicatedClusterDCDBInstance', request.serialize)
208
+ response = JSON.parse(body)
209
+ if response['Response'].key?('Error') == false
210
+ model = CreateDedicatedClusterDCDBInstanceResponse.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
+ # 本接口(DeleteAccount)用于删除云数据库账号。用户名+host唯一确定一个账号。
226
+
227
+ # @param request: Request instance for DeleteAccount.
228
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DeleteAccountRequest`
229
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DeleteAccountResponse`
230
+ def DeleteAccount(request)
231
+ body = send_request('DeleteAccount', request.serialize)
232
+ response = JSON.parse(body)
233
+ if response['Response'].key?('Error') == false
234
+ model = DeleteAccountResponse.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
+ # 本接口(DescribeAccountPrivileges)用于查询云数据库账号权限。
250
+ # 注意:注意:相同用户名,不同Host是不同的账号。
251
+
252
+ # @param request: Request instance for DescribeAccountPrivileges.
253
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeAccountPrivilegesRequest`
254
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeAccountPrivilegesResponse`
255
+ def DescribeAccountPrivileges(request)
256
+ body = send_request('DescribeAccountPrivileges', request.serialize)
257
+ response = JSON.parse(body)
258
+ if response['Response'].key?('Error') == false
259
+ model = DescribeAccountPrivilegesResponse.new
260
+ model.deserialize(response['Response'])
261
+ model
262
+ else
263
+ code = response['Response']['Error']['Code']
264
+ message = response['Response']['Error']['Message']
265
+ reqid = response['Response']['RequestId']
266
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
267
+ end
268
+ rescue TencentCloud::Common::TencentCloudSDKException => e
269
+ raise e
270
+ rescue StandardError => e
271
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
272
+ end
273
+
274
+ # 本接口(DescribeAccounts)用于查询指定云数据库实例的账号列表。
275
+
276
+ # @param request: Request instance for DescribeAccounts.
277
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeAccountsRequest`
278
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeAccountsResponse`
279
+ def DescribeAccounts(request)
280
+ body = send_request('DescribeAccounts', request.serialize)
281
+ response = JSON.parse(body)
282
+ if response['Response'].key?('Error') == false
283
+ model = DescribeAccountsResponse.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
+ # 本接口(DescribeDBLogFiles)用于获取数据库的各种日志列表,包括冷备、binlog、errlog和slowlog。
299
+
300
+ # @param request: Request instance for DescribeDBLogFiles.
301
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDBLogFilesRequest`
302
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDBLogFilesResponse`
303
+ def DescribeDBLogFiles(request)
304
+ body = send_request('DescribeDBLogFiles', request.serialize)
305
+ response = JSON.parse(body)
306
+ if response['Response'].key?('Error') == false
307
+ model = DescribeDBLogFilesResponse.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
+ # 本接口(DescribeDBParameters)用于获取数据库的当前参数设置。
323
+
324
+ # @param request: Request instance for DescribeDBParameters.
325
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDBParametersRequest`
326
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDBParametersResponse`
327
+ def DescribeDBParameters(request)
328
+ body = send_request('DescribeDBParameters', request.serialize)
329
+ response = JSON.parse(body)
330
+ if response['Response'].key?('Error') == false
331
+ model = DescribeDBParametersResponse.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
+ # 本接口(DescribeDBSecurityGroups)用于查询实例安全组信息
347
+
348
+ # @param request: Request instance for DescribeDBSecurityGroups.
349
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDBSecurityGroupsRequest`
350
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDBSecurityGroupsResponse`
351
+ def DescribeDBSecurityGroups(request)
352
+ body = send_request('DescribeDBSecurityGroups', request.serialize)
353
+ response = JSON.parse(body)
354
+ if response['Response'].key?('Error') == false
355
+ model = DescribeDBSecurityGroupsResponse.new
356
+ model.deserialize(response['Response'])
357
+ model
358
+ else
359
+ code = response['Response']['Error']['Code']
360
+ message = response['Response']['Error']['Message']
361
+ reqid = response['Response']['RequestId']
362
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
363
+ end
364
+ rescue TencentCloud::Common::TencentCloudSDKException => e
365
+ raise e
366
+ rescue StandardError => e
367
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
368
+ end
369
+
370
+ # 本接口(DescribeDBSyncMode)用于查询云数据库实例的同步模式。
371
+
372
+ # @param request: Request instance for DescribeDBSyncMode.
373
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDBSyncModeRequest`
374
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDBSyncModeResponse`
375
+ def DescribeDBSyncMode(request)
376
+ body = send_request('DescribeDBSyncMode', request.serialize)
377
+ response = JSON.parse(body)
378
+ if response['Response'].key?('Error') == false
379
+ model = DescribeDBSyncModeResponse.new
380
+ model.deserialize(response['Response'])
381
+ model
382
+ else
383
+ code = response['Response']['Error']['Code']
384
+ message = response['Response']['Error']['Message']
385
+ reqid = response['Response']['RequestId']
386
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
387
+ end
388
+ rescue TencentCloud::Common::TencentCloudSDKException => e
389
+ raise e
390
+ rescue StandardError => e
391
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
392
+ end
393
+
394
+ # 本接口(DescribeDCDBInstanceNodeInfo)用于获取实例节点信息
395
+
396
+ # @param request: Request instance for DescribeDCDBInstanceNodeInfo.
397
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBInstanceNodeInfoRequest`
398
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBInstanceNodeInfoResponse`
399
+ def DescribeDCDBInstanceNodeInfo(request)
400
+ body = send_request('DescribeDCDBInstanceNodeInfo', request.serialize)
401
+ response = JSON.parse(body)
402
+ if response['Response'].key?('Error') == false
403
+ model = DescribeDCDBInstanceNodeInfoResponse.new
404
+ model.deserialize(response['Response'])
405
+ model
406
+ else
407
+ code = response['Response']['Error']['Code']
408
+ message = response['Response']['Error']['Message']
409
+ reqid = response['Response']['RequestId']
410
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
411
+ end
412
+ rescue TencentCloud::Common::TencentCloudSDKException => e
413
+ raise e
414
+ rescue StandardError => e
415
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
416
+ end
417
+
418
+ # 查询云数据库实例列表,支持通过项目ID、实例ID、内网地址、实例名称等来筛选实例。
419
+ # 如果不指定任何筛选条件,则默认返回10条实例记录,单次请求最多支持返回100条实例记录。
420
+
421
+ # @param request: Request instance for DescribeDCDBInstances.
422
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBInstancesRequest`
423
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBInstancesResponse`
424
+ def DescribeDCDBInstances(request)
425
+ body = send_request('DescribeDCDBInstances', request.serialize)
426
+ response = JSON.parse(body)
427
+ if response['Response'].key?('Error') == false
428
+ model = DescribeDCDBInstancesResponse.new
429
+ model.deserialize(response['Response'])
430
+ model
431
+ else
432
+ code = response['Response']['Error']['Code']
433
+ message = response['Response']['Error']['Message']
434
+ reqid = response['Response']['RequestId']
435
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
436
+ end
437
+ rescue TencentCloud::Common::TencentCloudSDKException => e
438
+ raise e
439
+ rescue StandardError => e
440
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
441
+ end
442
+
443
+ # 本接口(DescribeDCDBPrice)用于在购买实例前,查询实例的价格。
444
+
445
+ # @param request: Request instance for DescribeDCDBPrice.
446
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBPriceRequest`
447
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBPriceResponse`
448
+ def DescribeDCDBPrice(request)
449
+ body = send_request('DescribeDCDBPrice', request.serialize)
450
+ response = JSON.parse(body)
451
+ if response['Response'].key?('Error') == false
452
+ model = DescribeDCDBPriceResponse.new
453
+ model.deserialize(response['Response'])
454
+ model
455
+ else
456
+ code = response['Response']['Error']['Code']
457
+ message = response['Response']['Error']['Message']
458
+ reqid = response['Response']['RequestId']
459
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
460
+ end
461
+ rescue TencentCloud::Common::TencentCloudSDKException => e
462
+ raise e
463
+ rescue StandardError => e
464
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
465
+ end
466
+
467
+ # 本接口(DescribeDCDBRenewalPrice)用于在续费分布式数据库实例时,查询续费的价格。
468
+
469
+ # @param request: Request instance for DescribeDCDBRenewalPrice.
470
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBRenewalPriceRequest`
471
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBRenewalPriceResponse`
472
+ def DescribeDCDBRenewalPrice(request)
473
+ body = send_request('DescribeDCDBRenewalPrice', request.serialize)
474
+ response = JSON.parse(body)
475
+ if response['Response'].key?('Error') == false
476
+ model = DescribeDCDBRenewalPriceResponse.new
477
+ model.deserialize(response['Response'])
478
+ model
479
+ else
480
+ code = response['Response']['Error']['Code']
481
+ message = response['Response']['Error']['Message']
482
+ reqid = response['Response']['RequestId']
483
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
484
+ end
485
+ rescue TencentCloud::Common::TencentCloudSDKException => e
486
+ raise e
487
+ rescue StandardError => e
488
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
489
+ end
490
+
491
+ # 本接口(DescribeDCDBSaleInfo)用于查询分布式数据库可售卖的地域和可用区信息。
492
+
493
+ # @param request: Request instance for DescribeDCDBSaleInfo.
494
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBSaleInfoRequest`
495
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBSaleInfoResponse`
496
+ def DescribeDCDBSaleInfo(request)
497
+ body = send_request('DescribeDCDBSaleInfo', request.serialize)
498
+ response = JSON.parse(body)
499
+ if response['Response'].key?('Error') == false
500
+ model = DescribeDCDBSaleInfoResponse.new
501
+ model.deserialize(response['Response'])
502
+ model
503
+ else
504
+ code = response['Response']['Error']['Code']
505
+ message = response['Response']['Error']['Message']
506
+ reqid = response['Response']['RequestId']
507
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
508
+ end
509
+ rescue TencentCloud::Common::TencentCloudSDKException => e
510
+ raise e
511
+ rescue StandardError => e
512
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
513
+ end
514
+
515
+ # 本接口(DescribeDCDBShards)用于查询云数据库实例的分片信息。
516
+
517
+ # @param request: Request instance for DescribeDCDBShards.
518
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBShardsRequest`
519
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBShardsResponse`
520
+ def DescribeDCDBShards(request)
521
+ body = send_request('DescribeDCDBShards', request.serialize)
522
+ response = JSON.parse(body)
523
+ if response['Response'].key?('Error') == false
524
+ model = DescribeDCDBShardsResponse.new
525
+ model.deserialize(response['Response'])
526
+ model
527
+ else
528
+ code = response['Response']['Error']['Code']
529
+ message = response['Response']['Error']['Message']
530
+ reqid = response['Response']['RequestId']
531
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
532
+ end
533
+ rescue TencentCloud::Common::TencentCloudSDKException => e
534
+ raise e
535
+ rescue StandardError => e
536
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
537
+ end
538
+
539
+ # 本接口(DescribeDCDBUpgradePrice)用于查询变配分布式数据库实例价格。
540
+
541
+ # @param request: Request instance for DescribeDCDBUpgradePrice.
542
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBUpgradePriceRequest`
543
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDCDBUpgradePriceResponse`
544
+ def DescribeDCDBUpgradePrice(request)
545
+ body = send_request('DescribeDCDBUpgradePrice', request.serialize)
546
+ response = JSON.parse(body)
547
+ if response['Response'].key?('Error') == false
548
+ model = DescribeDCDBUpgradePriceResponse.new
549
+ model.deserialize(response['Response'])
550
+ model
551
+ else
552
+ code = response['Response']['Error']['Code']
553
+ message = response['Response']['Error']['Message']
554
+ reqid = response['Response']['RequestId']
555
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
556
+ end
557
+ rescue TencentCloud::Common::TencentCloudSDKException => e
558
+ raise e
559
+ rescue StandardError => e
560
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
561
+ end
562
+
563
+ # 本接口(DescribeDatabaseObjects)用于查询云数据库实例的数据库中的对象列表,包含表、存储过程、视图和函数。
564
+
565
+ # @param request: Request instance for DescribeDatabaseObjects.
566
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabaseObjectsRequest`
567
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabaseObjectsResponse`
568
+ def DescribeDatabaseObjects(request)
569
+ body = send_request('DescribeDatabaseObjects', request.serialize)
570
+ response = JSON.parse(body)
571
+ if response['Response'].key?('Error') == false
572
+ model = DescribeDatabaseObjectsResponse.new
573
+ model.deserialize(response['Response'])
574
+ model
575
+ else
576
+ code = response['Response']['Error']['Code']
577
+ message = response['Response']['Error']['Message']
578
+ reqid = response['Response']['RequestId']
579
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
580
+ end
581
+ rescue TencentCloud::Common::TencentCloudSDKException => e
582
+ raise e
583
+ rescue StandardError => e
584
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
585
+ end
586
+
587
+ # 本接口(DescribeDatabaseTable)用于查询云数据库实例的表信息。
588
+
589
+ # @param request: Request instance for DescribeDatabaseTable.
590
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabaseTableRequest`
591
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabaseTableResponse`
592
+ def DescribeDatabaseTable(request)
593
+ body = send_request('DescribeDatabaseTable', request.serialize)
594
+ response = JSON.parse(body)
595
+ if response['Response'].key?('Error') == false
596
+ model = DescribeDatabaseTableResponse.new
597
+ model.deserialize(response['Response'])
598
+ model
599
+ else
600
+ code = response['Response']['Error']['Code']
601
+ message = response['Response']['Error']['Message']
602
+ reqid = response['Response']['RequestId']
603
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
604
+ end
605
+ rescue TencentCloud::Common::TencentCloudSDKException => e
606
+ raise e
607
+ rescue StandardError => e
608
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
609
+ end
610
+
611
+ # 本接口(DescribeDatabases)用于查询云数据库实例的数据库列表。
612
+
613
+ # @param request: Request instance for DescribeDatabases.
614
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabasesRequest`
615
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDatabasesResponse`
616
+ def DescribeDatabases(request)
617
+ body = send_request('DescribeDatabases', request.serialize)
618
+ response = JSON.parse(body)
619
+ if response['Response'].key?('Error') == false
620
+ model = DescribeDatabasesResponse.new
621
+ model.deserialize(response['Response'])
622
+ model
623
+ else
624
+ code = response['Response']['Error']['Code']
625
+ message = response['Response']['Error']['Message']
626
+ reqid = response['Response']['RequestId']
627
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
628
+ end
629
+ rescue TencentCloud::Common::TencentCloudSDKException => e
630
+ raise e
631
+ rescue StandardError => e
632
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
633
+ end
634
+
635
+ # 获取实例灾备详情
636
+
637
+ # @param request: Request instance for DescribeDcnDetail.
638
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeDcnDetailRequest`
639
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeDcnDetailResponse`
640
+ def DescribeDcnDetail(request)
641
+ body = send_request('DescribeDcnDetail', request.serialize)
642
+ response = JSON.parse(body)
643
+ if response['Response'].key?('Error') == false
644
+ model = DescribeDcnDetailResponse.new
645
+ model.deserialize(response['Response'])
646
+ model
647
+ else
648
+ code = response['Response']['Error']['Code']
649
+ message = response['Response']['Error']['Message']
650
+ reqid = response['Response']['RequestId']
651
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
652
+ end
653
+ rescue TencentCloud::Common::TencentCloudSDKException => e
654
+ raise e
655
+ rescue StandardError => e
656
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
657
+ end
658
+
659
+ # 本接口(DescribeFlow)用于查询流程状态
660
+
661
+ # @param request: Request instance for DescribeFlow.
662
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeFlowRequest`
663
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeFlowResponse`
664
+ def DescribeFlow(request)
665
+ body = send_request('DescribeFlow', request.serialize)
666
+ response = JSON.parse(body)
667
+ if response['Response'].key?('Error') == false
668
+ model = DescribeFlowResponse.new
669
+ model.deserialize(response['Response'])
670
+ model
671
+ else
672
+ code = response['Response']['Error']['Code']
673
+ message = response['Response']['Error']['Message']
674
+ reqid = response['Response']['RequestId']
675
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
676
+ end
677
+ rescue TencentCloud::Common::TencentCloudSDKException => e
678
+ raise e
679
+ rescue StandardError => e
680
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
681
+ end
682
+
683
+ # 本接口(DescribeOrders)用于查询分布式数据库订单信息。传入订单ID来查询订单关联的分布式数据库实例,和对应的任务流程ID。
684
+
685
+ # @param request: Request instance for DescribeOrders.
686
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeOrdersRequest`
687
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeOrdersResponse`
688
+ def DescribeOrders(request)
689
+ body = send_request('DescribeOrders', request.serialize)
690
+ response = JSON.parse(body)
691
+ if response['Response'].key?('Error') == false
692
+ model = DescribeOrdersResponse.new
693
+ model.deserialize(response['Response'])
694
+ model
695
+ else
696
+ code = response['Response']['Error']['Code']
697
+ message = response['Response']['Error']['Message']
698
+ reqid = response['Response']['RequestId']
699
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
700
+ end
701
+ rescue TencentCloud::Common::TencentCloudSDKException => e
702
+ raise e
703
+ rescue StandardError => e
704
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
705
+ end
706
+
707
+ # 本接口(DescribeProjectSecurityGroups)用于查询项目安全组信息
708
+
709
+ # @param request: Request instance for DescribeProjectSecurityGroups.
710
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeProjectSecurityGroupsRequest`
711
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeProjectSecurityGroupsResponse`
712
+ def DescribeProjectSecurityGroups(request)
713
+ body = send_request('DescribeProjectSecurityGroups', request.serialize)
714
+ response = JSON.parse(body)
715
+ if response['Response'].key?('Error') == false
716
+ model = DescribeProjectSecurityGroupsResponse.new
717
+ model.deserialize(response['Response'])
718
+ model
719
+ else
720
+ code = response['Response']['Error']['Code']
721
+ message = response['Response']['Error']['Message']
722
+ reqid = response['Response']['RequestId']
723
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
724
+ end
725
+ rescue TencentCloud::Common::TencentCloudSDKException => e
726
+ raise e
727
+ rescue StandardError => e
728
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
729
+ end
730
+
731
+ # 本接口(DescribeProjects)用于查询项目列表
732
+
733
+ # @param request: Request instance for DescribeProjects.
734
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeProjectsRequest`
735
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeProjectsResponse`
736
+ def DescribeProjects(request)
737
+ body = send_request('DescribeProjects', request.serialize)
738
+ response = JSON.parse(body)
739
+ if response['Response'].key?('Error') == false
740
+ model = DescribeProjectsResponse.new
741
+ model.deserialize(response['Response'])
742
+ model
743
+ else
744
+ code = response['Response']['Error']['Code']
745
+ message = response['Response']['Error']['Message']
746
+ reqid = response['Response']['RequestId']
747
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
748
+ end
749
+ rescue TencentCloud::Common::TencentCloudSDKException => e
750
+ raise e
751
+ rescue StandardError => e
752
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
753
+ end
754
+
755
+ # 查询可创建的分布式数据库可售卖的分片规格配置。
756
+
757
+ # @param request: Request instance for DescribeShardSpec.
758
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeShardSpecRequest`
759
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeShardSpecResponse`
760
+ def DescribeShardSpec(request)
761
+ body = send_request('DescribeShardSpec', request.serialize)
762
+ response = JSON.parse(body)
763
+ if response['Response'].key?('Error') == false
764
+ model = DescribeShardSpecResponse.new
765
+ model.deserialize(response['Response'])
766
+ model
767
+ else
768
+ code = response['Response']['Error']['Code']
769
+ message = response['Response']['Error']['Message']
770
+ reqid = response['Response']['RequestId']
771
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
772
+ end
773
+ rescue TencentCloud::Common::TencentCloudSDKException => e
774
+ raise e
775
+ rescue StandardError => e
776
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
777
+ end
778
+
779
+ # 本接口(DescribeSqlLogs)用于获取实例SQL日志。
780
+
781
+ # @param request: Request instance for DescribeSqlLogs.
782
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeSqlLogsRequest`
783
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeSqlLogsResponse`
784
+ def DescribeSqlLogs(request)
785
+ body = send_request('DescribeSqlLogs', request.serialize)
786
+ response = JSON.parse(body)
787
+ if response['Response'].key?('Error') == false
788
+ model = DescribeSqlLogsResponse.new
789
+ model.deserialize(response['Response'])
790
+ model
791
+ else
792
+ code = response['Response']['Error']['Code']
793
+ message = response['Response']['Error']['Message']
794
+ reqid = response['Response']['RequestId']
795
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
796
+ end
797
+ rescue TencentCloud::Common::TencentCloudSDKException => e
798
+ raise e
799
+ rescue StandardError => e
800
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
801
+ end
802
+
803
+ # 本接口(DescribeUserTasks)用于拉取用户任务列表
804
+
805
+ # @param request: Request instance for DescribeUserTasks.
806
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DescribeUserTasksRequest`
807
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DescribeUserTasksResponse`
808
+ def DescribeUserTasks(request)
809
+ body = send_request('DescribeUserTasks', request.serialize)
810
+ response = JSON.parse(body)
811
+ if response['Response'].key?('Error') == false
812
+ model = DescribeUserTasksResponse.new
813
+ model.deserialize(response['Response'])
814
+ model
815
+ else
816
+ code = response['Response']['Error']['Code']
817
+ message = response['Response']['Error']['Message']
818
+ reqid = response['Response']['RequestId']
819
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
820
+ end
821
+ rescue TencentCloud::Common::TencentCloudSDKException => e
822
+ raise e
823
+ rescue StandardError => e
824
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
825
+ end
826
+
827
+ # 本接口(DestroyDCDBInstance)用于销毁已隔离的包年包月实例。
828
+
829
+ # @param request: Request instance for DestroyDCDBInstance.
830
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DestroyDCDBInstanceRequest`
831
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DestroyDCDBInstanceResponse`
832
+ def DestroyDCDBInstance(request)
833
+ body = send_request('DestroyDCDBInstance', request.serialize)
834
+ response = JSON.parse(body)
835
+ if response['Response'].key?('Error') == false
836
+ model = DestroyDCDBInstanceResponse.new
837
+ model.deserialize(response['Response'])
838
+ model
839
+ else
840
+ code = response['Response']['Error']['Code']
841
+ message = response['Response']['Error']['Message']
842
+ reqid = response['Response']['RequestId']
843
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
844
+ end
845
+ rescue TencentCloud::Common::TencentCloudSDKException => e
846
+ raise e
847
+ rescue StandardError => e
848
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
849
+ end
850
+
851
+ # 本接口(DestroyHourDCDBInstance)用于销毁按量计费实例。
852
+
853
+ # @param request: Request instance for DestroyHourDCDBInstance.
854
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DestroyHourDCDBInstanceRequest`
855
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DestroyHourDCDBInstanceResponse`
856
+ def DestroyHourDCDBInstance(request)
857
+ body = send_request('DestroyHourDCDBInstance', request.serialize)
858
+ response = JSON.parse(body)
859
+ if response['Response'].key?('Error') == false
860
+ model = DestroyHourDCDBInstanceResponse.new
861
+ model.deserialize(response['Response'])
862
+ model
863
+ else
864
+ code = response['Response']['Error']['Code']
865
+ message = response['Response']['Error']['Message']
866
+ reqid = response['Response']['RequestId']
867
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
868
+ end
869
+ rescue TencentCloud::Common::TencentCloudSDKException => e
870
+ raise e
871
+ rescue StandardError => e
872
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
873
+ end
874
+
875
+ # 本接口(DisassociateSecurityGroups)用于安全组批量解绑实例。
876
+
877
+ # @param request: Request instance for DisassociateSecurityGroups.
878
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::DisassociateSecurityGroupsRequest`
879
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::DisassociateSecurityGroupsResponse`
880
+ def DisassociateSecurityGroups(request)
881
+ body = send_request('DisassociateSecurityGroups', request.serialize)
882
+ response = JSON.parse(body)
883
+ if response['Response'].key?('Error') == false
884
+ model = DisassociateSecurityGroupsResponse.new
885
+ model.deserialize(response['Response'])
886
+ model
887
+ else
888
+ code = response['Response']['Error']['Code']
889
+ message = response['Response']['Error']['Message']
890
+ reqid = response['Response']['RequestId']
891
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
892
+ end
893
+ rescue TencentCloud::Common::TencentCloudSDKException => e
894
+ raise e
895
+ rescue StandardError => e
896
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
897
+ end
898
+
899
+ # 相当于在所有分片的mysqld中执行flush logs,完成切分的binlog将展示在各个分片控制台binlog列表里。
900
+
901
+ # @param request: Request instance for FlushBinlog.
902
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::FlushBinlogRequest`
903
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::FlushBinlogResponse`
904
+ def FlushBinlog(request)
905
+ body = send_request('FlushBinlog', request.serialize)
906
+ response = JSON.parse(body)
907
+ if response['Response'].key?('Error') == false
908
+ model = FlushBinlogResponse.new
909
+ model.deserialize(response['Response'])
910
+ model
911
+ else
912
+ code = response['Response']['Error']['Code']
913
+ message = response['Response']['Error']['Message']
914
+ reqid = response['Response']['RequestId']
915
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
916
+ end
917
+ rescue TencentCloud::Common::TencentCloudSDKException => e
918
+ raise e
919
+ rescue StandardError => e
920
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
921
+ end
922
+
923
+ # 本接口(GrantAccountPrivileges)用于给云数据库账号赋权。
924
+ # 注意:相同用户名,不同Host是不同的账号。
925
+
926
+ # @param request: Request instance for GrantAccountPrivileges.
927
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::GrantAccountPrivilegesRequest`
928
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::GrantAccountPrivilegesResponse`
929
+ def GrantAccountPrivileges(request)
930
+ body = send_request('GrantAccountPrivileges', request.serialize)
931
+ response = JSON.parse(body)
932
+ if response['Response'].key?('Error') == false
933
+ model = GrantAccountPrivilegesResponse.new
934
+ model.deserialize(response['Response'])
935
+ model
936
+ else
937
+ code = response['Response']['Error']['Code']
938
+ message = response['Response']['Error']['Message']
939
+ reqid = response['Response']['RequestId']
940
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
941
+ end
942
+ rescue TencentCloud::Common::TencentCloudSDKException => e
943
+ raise e
944
+ rescue StandardError => e
945
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
946
+ end
947
+
948
+ # 本接口(InitDCDBInstances)用于初始化云数据库实例,包括设置默认字符集、表名大小写敏感等。
949
+
950
+ # @param request: Request instance for InitDCDBInstances.
951
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::InitDCDBInstancesRequest`
952
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::InitDCDBInstancesResponse`
953
+ def InitDCDBInstances(request)
954
+ body = send_request('InitDCDBInstances', request.serialize)
955
+ response = JSON.parse(body)
956
+ if response['Response'].key?('Error') == false
957
+ model = InitDCDBInstancesResponse.new
958
+ model.deserialize(response['Response'])
959
+ model
960
+ else
961
+ code = response['Response']['Error']['Code']
962
+ message = response['Response']['Error']['Message']
963
+ reqid = response['Response']['RequestId']
964
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
965
+ end
966
+ rescue TencentCloud::Common::TencentCloudSDKException => e
967
+ raise e
968
+ rescue StandardError => e
969
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
970
+ end
971
+
972
+ # 本接口(KillSession)用于杀死指定会话。
973
+
974
+ # @param request: Request instance for KillSession.
975
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::KillSessionRequest`
976
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::KillSessionResponse`
977
+ def KillSession(request)
978
+ body = send_request('KillSession', request.serialize)
979
+ response = JSON.parse(body)
980
+ if response['Response'].key?('Error') == false
981
+ model = KillSessionResponse.new
982
+ model.deserialize(response['Response'])
983
+ model
984
+ else
985
+ code = response['Response']['Error']['Code']
986
+ message = response['Response']['Error']['Message']
987
+ reqid = response['Response']['RequestId']
988
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
989
+ end
990
+ rescue TencentCloud::Common::TencentCloudSDKException => e
991
+ raise e
992
+ rescue StandardError => e
993
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
994
+ end
995
+
996
+ # 本接口(ModifyAccountDescription)用于修改云数据库账号备注。
997
+ # 注意:相同用户名,不同Host是不同的账号。
998
+
999
+ # @param request: Request instance for ModifyAccountDescription.
1000
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyAccountDescriptionRequest`
1001
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyAccountDescriptionResponse`
1002
+ def ModifyAccountDescription(request)
1003
+ body = send_request('ModifyAccountDescription', request.serialize)
1004
+ response = JSON.parse(body)
1005
+ if response['Response'].key?('Error') == false
1006
+ model = ModifyAccountDescriptionResponse.new
1007
+ model.deserialize(response['Response'])
1008
+ model
1009
+ else
1010
+ code = response['Response']['Error']['Code']
1011
+ message = response['Response']['Error']['Message']
1012
+ reqid = response['Response']['RequestId']
1013
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1014
+ end
1015
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1016
+ raise e
1017
+ rescue StandardError => e
1018
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1019
+ end
1020
+
1021
+ # 本接口(ModifyDBInstanceSecurityGroups)用于修改云数据库安全组
1022
+
1023
+ # @param request: Request instance for ModifyDBInstanceSecurityGroups.
1024
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyDBInstanceSecurityGroupsRequest`
1025
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyDBInstanceSecurityGroupsResponse`
1026
+ def ModifyDBInstanceSecurityGroups(request)
1027
+ body = send_request('ModifyDBInstanceSecurityGroups', request.serialize)
1028
+ response = JSON.parse(body)
1029
+ if response['Response'].key?('Error') == false
1030
+ model = ModifyDBInstanceSecurityGroupsResponse.new
1031
+ model.deserialize(response['Response'])
1032
+ model
1033
+ else
1034
+ code = response['Response']['Error']['Code']
1035
+ message = response['Response']['Error']['Message']
1036
+ reqid = response['Response']['RequestId']
1037
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1038
+ end
1039
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1040
+ raise e
1041
+ rescue StandardError => e
1042
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1043
+ end
1044
+
1045
+ # 本接口(ModifyDBInstancesProject)用于修改云数据库实例所属项目。
1046
+
1047
+ # @param request: Request instance for ModifyDBInstancesProject.
1048
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyDBInstancesProjectRequest`
1049
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyDBInstancesProjectResponse`
1050
+ def ModifyDBInstancesProject(request)
1051
+ body = send_request('ModifyDBInstancesProject', request.serialize)
1052
+ response = JSON.parse(body)
1053
+ if response['Response'].key?('Error') == false
1054
+ model = ModifyDBInstancesProjectResponse.new
1055
+ model.deserialize(response['Response'])
1056
+ model
1057
+ else
1058
+ code = response['Response']['Error']['Code']
1059
+ message = response['Response']['Error']['Message']
1060
+ reqid = response['Response']['RequestId']
1061
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1062
+ end
1063
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1064
+ raise e
1065
+ rescue StandardError => e
1066
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1067
+ end
1068
+
1069
+ # 本接口(ModifyDBParameters)用于修改数据库参数。
1070
+
1071
+ # @param request: Request instance for ModifyDBParameters.
1072
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyDBParametersRequest`
1073
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyDBParametersResponse`
1074
+ def ModifyDBParameters(request)
1075
+ body = send_request('ModifyDBParameters', request.serialize)
1076
+ response = JSON.parse(body)
1077
+ if response['Response'].key?('Error') == false
1078
+ model = ModifyDBParametersResponse.new
1079
+ model.deserialize(response['Response'])
1080
+ model
1081
+ else
1082
+ code = response['Response']['Error']['Code']
1083
+ message = response['Response']['Error']['Message']
1084
+ reqid = response['Response']['RequestId']
1085
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1086
+ end
1087
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1088
+ raise e
1089
+ rescue StandardError => e
1090
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1091
+ end
1092
+
1093
+ # 本接口(ModifyDBSyncMode)用于修改云数据库实例的同步模式。
1094
+
1095
+ # @param request: Request instance for ModifyDBSyncMode.
1096
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyDBSyncModeRequest`
1097
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyDBSyncModeResponse`
1098
+ def ModifyDBSyncMode(request)
1099
+ body = send_request('ModifyDBSyncMode', request.serialize)
1100
+ response = JSON.parse(body)
1101
+ if response['Response'].key?('Error') == false
1102
+ model = ModifyDBSyncModeResponse.new
1103
+ model.deserialize(response['Response'])
1104
+ model
1105
+ else
1106
+ code = response['Response']['Error']['Code']
1107
+ message = response['Response']['Error']['Message']
1108
+ reqid = response['Response']['RequestId']
1109
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1110
+ end
1111
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1112
+ raise e
1113
+ rescue StandardError => e
1114
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1115
+ end
1116
+
1117
+ # 本接口(ModifyRealServerAccessStrategy)用于修改云数据库的VPCGW到RS的访问策略。
1118
+
1119
+ # **注意**
1120
+ # - 修改策略后只对新建立的连接生效,老连接不受影响
1121
+ # - 就近访问只针对实例是跨可用区部署有用,单可用区部署实例就近与否并无作用
1122
+ # - DB每个Node对应一个proxy,如果开启就近访问,将会把连接集中到对应可用区的proxy上,可能造成热点问题,这种情况下如果是线上业务,请务必根据自己的业务请求量测试符合预期后再进行就近策略变更
1123
+
1124
+ # @param request: Request instance for ModifyRealServerAccessStrategy.
1125
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ModifyRealServerAccessStrategyRequest`
1126
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ModifyRealServerAccessStrategyResponse`
1127
+ def ModifyRealServerAccessStrategy(request)
1128
+ body = send_request('ModifyRealServerAccessStrategy', request.serialize)
1129
+ response = JSON.parse(body)
1130
+ if response['Response'].key?('Error') == false
1131
+ model = ModifyRealServerAccessStrategyResponse.new
1132
+ model.deserialize(response['Response'])
1133
+ model
1134
+ else
1135
+ code = response['Response']['Error']['Code']
1136
+ message = response['Response']['Error']['Message']
1137
+ reqid = response['Response']['RequestId']
1138
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1139
+ end
1140
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1141
+ raise e
1142
+ rescue StandardError => e
1143
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1144
+ end
1145
+
1146
+ # 本接口(OpenDBExtranetAccess)用于开通云数据库实例的外网访问。开通外网访问后,您可通过外网域名和端口访问实例,可使用查询实例列表接口获取外网域名和端口信息。
1147
+
1148
+ # @param request: Request instance for OpenDBExtranetAccess.
1149
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::OpenDBExtranetAccessRequest`
1150
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::OpenDBExtranetAccessResponse`
1151
+ def OpenDBExtranetAccess(request)
1152
+ body = send_request('OpenDBExtranetAccess', request.serialize)
1153
+ response = JSON.parse(body)
1154
+ if response['Response'].key?('Error') == false
1155
+ model = OpenDBExtranetAccessResponse.new
1156
+ model.deserialize(response['Response'])
1157
+ model
1158
+ else
1159
+ code = response['Response']['Error']['Code']
1160
+ message = response['Response']['Error']['Message']
1161
+ reqid = response['Response']['RequestId']
1162
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1163
+ end
1164
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1165
+ raise e
1166
+ rescue StandardError => e
1167
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1168
+ end
1169
+
1170
+ # 本接口(RenewDCDBInstance)用于续费分布式数据库实例。
1171
+
1172
+ # @param request: Request instance for RenewDCDBInstance.
1173
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::RenewDCDBInstanceRequest`
1174
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::RenewDCDBInstanceResponse`
1175
+ def RenewDCDBInstance(request)
1176
+ body = send_request('RenewDCDBInstance', request.serialize)
1177
+ response = JSON.parse(body)
1178
+ if response['Response'].key?('Error') == false
1179
+ model = RenewDCDBInstanceResponse.new
1180
+ model.deserialize(response['Response'])
1181
+ model
1182
+ else
1183
+ code = response['Response']['Error']['Code']
1184
+ message = response['Response']['Error']['Message']
1185
+ reqid = response['Response']['RequestId']
1186
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1187
+ end
1188
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1189
+ raise e
1190
+ rescue StandardError => e
1191
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1192
+ end
1193
+
1194
+ # 本接口(ResetAccountPassword)用于重置云数据库账号的密码。
1195
+ # 注意:相同用户名,不同Host是不同的账号。
1196
+
1197
+ # @param request: Request instance for ResetAccountPassword.
1198
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::ResetAccountPasswordRequest`
1199
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::ResetAccountPasswordResponse`
1200
+ def ResetAccountPassword(request)
1201
+ body = send_request('ResetAccountPassword', request.serialize)
1202
+ response = JSON.parse(body)
1203
+ if response['Response'].key?('Error') == false
1204
+ model = ResetAccountPasswordResponse.new
1205
+ model.deserialize(response['Response'])
1206
+ model
1207
+ else
1208
+ code = response['Response']['Error']['Code']
1209
+ message = response['Response']['Error']['Message']
1210
+ reqid = response['Response']['RequestId']
1211
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1212
+ end
1213
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1214
+ raise e
1215
+ rescue StandardError => e
1216
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1217
+ end
1218
+
1219
+ # 本接口(UpgradeDCDBInstance)用于升级分布式数据库实例。本接口完成下单和支付两个动作,如果发生支付失败的错误,调用用户账户相关接口中的支付订单接口(PayDeals)重新支付即可。
1220
+
1221
+ # @param request: Request instance for UpgradeDCDBInstance.
1222
+ # @type request: :class:`Tencentcloud::dcdb::V20180411::UpgradeDCDBInstanceRequest`
1223
+ # @rtype: :class:`Tencentcloud::dcdb::V20180411::UpgradeDCDBInstanceResponse`
1224
+ def UpgradeDCDBInstance(request)
1225
+ body = send_request('UpgradeDCDBInstance', request.serialize)
1226
+ response = JSON.parse(body)
1227
+ if response['Response'].key?('Error') == false
1228
+ model = UpgradeDCDBInstanceResponse.new
1229
+ model.deserialize(response['Response'])
1230
+ model
1231
+ else
1232
+ code = response['Response']['Error']['Code']
1233
+ message = response['Response']['Error']['Message']
1234
+ reqid = response['Response']['RequestId']
1235
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
1236
+ end
1237
+ rescue TencentCloud::Common::TencentCloudSDKException => e
1238
+ raise e
1239
+ rescue StandardError => e
1240
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
1241
+ end
1242
+
1243
+
1244
+ end
1245
+ end
1246
+ end
1247
+ end