1 Star 1 Fork 0

tencentcloud/tencentcloud-sdk-ruby

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
client.rb 202.56 KB
Copy Edit Raw Blame History
tencentcloud authored 2024-07-08 04:46 . release 3.0.859
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116
# frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'json'
module TencentCloud
module Cdb
module V20170320
class Client < TencentCloud::Common::AbstractClient
def initialize(credential, region, profile = nil)
api_version = '2017-03-20'
api_endpoint = 'cdb.tencentcloudapi.com'
sdk_version = 'CDB_' + File.read(File.expand_path('../VERSION', __dir__)).strip
super(credential, region, api_version, api_endpoint, sdk_version, profile)
end
# 本接口(AddTimeWindow)用于添加云数据库实例的维护时间窗口,以指定实例在哪些时间段可以自动执行切换访问操作。
# @param request: Request instance for AddTimeWindow.
# @type request: :class:`Tencentcloud::cdb::V20170320::AddTimeWindowRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::AddTimeWindowResponse`
def AddTimeWindow(request)
body = send_request('AddTimeWindow', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AddTimeWindowResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 调整数据库代理配置
# @param request: Request instance for AdjustCdbProxy.
# @type request: :class:`Tencentcloud::cdb::V20170320::AdjustCdbProxyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::AdjustCdbProxyResponse`
def AdjustCdbProxy(request)
body = send_request('AdjustCdbProxy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AdjustCdbProxyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 调整数据库代理地址配置
# @param request: Request instance for AdjustCdbProxyAddress.
# @type request: :class:`Tencentcloud::cdb::V20170320::AdjustCdbProxyAddressRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::AdjustCdbProxyAddressResponse`
def AdjustCdbProxyAddress(request)
body = send_request('AdjustCdbProxyAddress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AdjustCdbProxyAddressResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 在不同过滤条件下的审计日志结果集中,选定特定的数据列进行聚合统计。
# @param request: Request instance for AnalyzeAuditLogs.
# @type request: :class:`Tencentcloud::cdb::V20170320::AnalyzeAuditLogsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::AnalyzeAuditLogsResponse`
def AnalyzeAuditLogs(request)
body = send_request('AnalyzeAuditLogs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AnalyzeAuditLogsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(AssociateSecurityGroups)用于安全组批量绑定实例。
# @param request: Request instance for AssociateSecurityGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::AssociateSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::AssociateSecurityGroupsResponse`
def AssociateSecurityGroups(request)
body = send_request('AssociateSecurityGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AssociateSecurityGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(BalanceRoGroupLoad)用于重新均衡 RO 组内实例的负载。注意,RO 组内 RO 实例会有一次数据库连接瞬断,请确保应用程序能重连数据库,谨慎操作。
# @param request: Request instance for BalanceRoGroupLoad.
# @type request: :class:`Tencentcloud::cdb::V20170320::BalanceRoGroupLoadRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::BalanceRoGroupLoadResponse`
def BalanceRoGroupLoad(request)
body = send_request('BalanceRoGroupLoad', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = BalanceRoGroupLoadResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 高可用实例一键迁移到集群版校验
# @param request: Request instance for CheckMigrateCluster.
# @type request: :class:`Tencentcloud::cdb::V20170320::CheckMigrateClusterRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CheckMigrateClusterResponse`
def CheckMigrateCluster(request)
body = send_request('CheckMigrateCluster', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CheckMigrateClusterResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 实例关闭审计服务
# @param request: Request instance for CloseAuditService.
# @type request: :class:`Tencentcloud::cdb::V20170320::CloseAuditServiceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CloseAuditServiceResponse`
def CloseAuditService(request)
body = send_request('CloseAuditService', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloseAuditServiceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 关闭数据库代理
# @param request: Request instance for CloseCDBProxy.
# @type request: :class:`Tencentcloud::cdb::V20170320::CloseCDBProxyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CloseCDBProxyResponse`
def CloseCDBProxy(request)
body = send_request('CloseCDBProxy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloseCDBProxyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 请求关闭数据库代理地址
# @param request: Request instance for CloseCdbProxyAddress.
# @type request: :class:`Tencentcloud::cdb::V20170320::CloseCdbProxyAddressRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CloseCdbProxyAddressResponse`
def CloseCdbProxyAddress(request)
body = send_request('CloseCdbProxyAddress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloseCdbProxyAddressResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 关闭SSL连接功能。
# @param request: Request instance for CloseSSL.
# @type request: :class:`Tencentcloud::cdb::V20170320::CloseSSLRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CloseSSLResponse`
def CloseSSL(request)
body = send_request('CloseSSL', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloseSSLResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CloseWanService)用于关闭云数据库实例的外网访问。关闭外网访问后,外网地址将不可访问。
# @param request: Request instance for CloseWanService.
# @type request: :class:`Tencentcloud::cdb::V20170320::CloseWanServiceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CloseWanServiceResponse`
def CloseWanService(request)
body = send_request('CloseWanService', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloseWanServiceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateAccounts)用于创建云数据库的账户,需要指定新的账户名和域名,以及所对应的密码,同时可以设置账号的备注信息以及最大可用连接数。
# @param request: Request instance for CreateAccounts.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateAccountsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateAccountsResponse`
def CreateAccounts(request)
body = send_request('CreateAccounts', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAccountsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateAuditLogFile)用于创建云数据库实例的审计日志文件。
# @param request: Request instance for CreateAuditLogFile.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateAuditLogFileRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateAuditLogFileResponse`
def CreateAuditLogFile(request)
body = send_request('CreateAuditLogFile', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAuditLogFileResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateAuditPolicy)用于创建云数据库实例的审计策略,即将审计规则绑定到具体的云数据库实例上。
# @param request: Request instance for CreateAuditPolicy.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateAuditPolicyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateAuditPolicyResponse`
def CreateAuditPolicy(request)
body = send_request('CreateAuditPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAuditPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateAuditRule)用于创建用户在当前地域的审计规则。
# @param request: Request instance for CreateAuditRule.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateAuditRuleRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateAuditRuleResponse`
def CreateAuditRule(request)
body = send_request('CreateAuditRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAuditRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 创建审计规则模板
# @param request: Request instance for CreateAuditRuleTemplate.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateAuditRuleTemplateRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateAuditRuleTemplateResponse`
def CreateAuditRuleTemplate(request)
body = send_request('CreateAuditRuleTemplate', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateAuditRuleTemplateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateBackup)用于创建数据库备份。
# @param request: Request instance for CreateBackup.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateBackupRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateBackupResponse`
def CreateBackup(request)
body = send_request('CreateBackup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateBackupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 主实例创建数据库代理
# @param request: Request instance for CreateCdbProxy.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateCdbProxyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateCdbProxyResponse`
def CreateCdbProxy(request)
body = send_request('CreateCdbProxy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateCdbProxyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 数据库代理增加代理地址
# @param request: Request instance for CreateCdbProxyAddress.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateCdbProxyAddressRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateCdbProxyAddressResponse`
def CreateCdbProxyAddress(request)
body = send_request('CreateCdbProxyAddress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateCdbProxyAddressResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateCloneInstance) 用于从目标源实例创建一个克隆实例,可以指定克隆实例回档到源实例的指定物理备份文件或者指定的回档时间点。
# @param request: Request instance for CreateCloneInstance.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateCloneInstanceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateCloneInstanceResponse`
def CreateCloneInstance(request)
body = send_request('CreateCloneInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateCloneInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDBImportJob)用于创建云数据库数据导入任务。
# 注意,用户进行数据导入任务的文件,必须提前上传到腾讯云。用户须在控制台进行文件导入。
# @param request: Request instance for CreateDBImportJob.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateDBImportJobRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateDBImportJobResponse`
def CreateDBImportJob(request)
body = send_request('CreateDBImportJob', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDBImportJobResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDBInstance)用于创建包年包月的云数据库实例(包括主实例、灾备实例和只读实例),可通过传入实例规格、MySQL 版本号、购买时长和数量等信息创建云数据库实例。
# 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为1,且 TaskStatus 为0,表示实例已经发货成功。
# 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
# 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
# 3. 支持创建 MySQL 5.5 、 MySQL 5.6 、 MySQL 5.7 、 MySQL 8.0 版本;
# 4. 支持创建主实例、只读实例、灾备实例;
# 5. 当入参指定 Port 和 ParamTemplateType 参数模板,相关参数才会自动初始化(不支持基础版实例);
# 6. 当入参指定 ParamTemplateId 或 AlarmPolicyList 时,需将SDK提升至最新版本方可支持;
# @param request: Request instance for CreateDBInstance.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateDBInstanceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateDBInstanceResponse`
def CreateDBInstance(request)
body = send_request('CreateDBInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDBInstanceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDBInstanceHour)用于创建按量计费的实例,可通过传入实例规格、MySQL 版本号和数量等信息创建云数据库实例,支持主实例、灾备实例和只读实例的创建。
# 该接口为异步接口,您还可以使用 [查询实例列表](https://cloud.tencent.com/document/api/236/15872) 接口查询该实例的详细信息。当该实例的 Status 为 1,且 TaskStatus 为 0,表示实例已经发货成功。
# 1. 首先请使用 [获取云数据库可售卖规格](https://cloud.tencent.com/document/api/236/17229) 接口查询可创建的实例规格信息,然后请使用 [查询数据库价格](https://cloud.tencent.com/document/api/236/18566) 接口查询可创建实例的售卖价格;
# 2. 单次创建实例最大支持 100 个,实例时长最大支持 36 个月;
# 3. 支持创建 MySQL 5.5、MySQL 5.6 、MySQL 5.7 和 MySQL 8.0 版本;
# 4. 支持创建主实例、灾备实例和只读实例;
# 5. 当入参指定 Port,ParamTemplateType 或 Password 时,该实例会进行初始化操作;
# @param request: Request instance for CreateDBInstanceHour.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateDBInstanceHourRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateDBInstanceHourResponse`
def CreateDBInstanceHour(request)
body = send_request('CreateDBInstanceHour', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDBInstanceHourResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDatabase)用于在云数据库实例中创建数据库。
# @param request: Request instance for CreateDatabase.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateDatabaseRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateDatabaseResponse`
def CreateDatabase(request)
body = send_request('CreateDatabase', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDatabaseResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateDeployGroup)用于创建放置实例的置放群组
# @param request: Request instance for CreateDeployGroup.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateDeployGroupRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateDeployGroupResponse`
def CreateDeployGroup(request)
body = send_request('CreateDeployGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateDeployGroupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(CreateParamTemplate)用于创建参数模板,全地域公共参数Region均为ap-guangzhou。
# @param request: Request instance for CreateParamTemplate.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateParamTemplateRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateParamTemplateResponse`
def CreateParamTemplate(request)
body = send_request('CreateParamTemplate', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateParamTemplateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(CreateRoInstanceIp)用于创建云数据库只读实例的独立VIP。
# @param request: Request instance for CreateRoInstanceIp.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateRoInstanceIpRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateRoInstanceIpResponse`
def CreateRoInstanceIp(request)
body = send_request('CreateRoInstanceIp', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateRoInstanceIpResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 开启密码轮转
# @param request: Request instance for CreateRotationPassword.
# @type request: :class:`Tencentcloud::cdb::V20170320::CreateRotationPasswordRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::CreateRotationPasswordResponse`
def CreateRotationPassword(request)
body = send_request('CreateRotationPassword', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateRotationPasswordResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteAccounts)用于删除云数据库的账户。
# @param request: Request instance for DeleteAccounts.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteAccountsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteAccountsResponse`
def DeleteAccounts(request)
body = send_request('DeleteAccounts', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAccountsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteAuditLogFile)用于删除云数据库实例的审计日志文件。
# @param request: Request instance for DeleteAuditLogFile.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteAuditLogFileRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteAuditLogFileResponse`
def DeleteAuditLogFile(request)
body = send_request('DeleteAuditLogFile', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAuditLogFileResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteAuditPolicy)用于删除用户的审计策略。
# @param request: Request instance for DeleteAuditPolicy.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteAuditPolicyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteAuditPolicyResponse`
def DeleteAuditPolicy(request)
body = send_request('DeleteAuditPolicy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAuditPolicyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteAuditRule)用于删除用户的审计规则。
# @param request: Request instance for DeleteAuditRule.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteAuditRuleRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteAuditRuleResponse`
def DeleteAuditRule(request)
body = send_request('DeleteAuditRule', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAuditRuleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 删除审计规则模板
# @param request: Request instance for DeleteAuditRuleTemplates.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteAuditRuleTemplatesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteAuditRuleTemplatesResponse`
def DeleteAuditRuleTemplates(request)
body = send_request('DeleteAuditRuleTemplates', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteAuditRuleTemplatesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteBackup)用于删除数据库备份。本接口只支持删除手动发起的备份。
# @param request: Request instance for DeleteBackup.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteBackupRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteBackupResponse`
def DeleteBackup(request)
body = send_request('DeleteBackup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteBackupResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteDatabase)用于在云数据库实例中删除数据库。
# @param request: Request instance for DeleteDatabase.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteDatabaseRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteDatabaseResponse`
def DeleteDatabase(request)
body = send_request('DeleteDatabase', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteDatabaseResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 根据置放群组ID删除置放群组(置放群组中有资源存在时不能删除该置放群组)
# @param request: Request instance for DeleteDeployGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteDeployGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteDeployGroupsResponse`
def DeleteDeployGroups(request)
body = send_request('DeleteDeployGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteDeployGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DeleteParamTemplate)用于删除参数模板,全地域公共参数Region均为ap-guangzhou。
# @param request: Request instance for DeleteParamTemplate.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteParamTemplateRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteParamTemplateResponse`
def DeleteParamTemplate(request)
body = send_request('DeleteParamTemplate', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteParamTemplateResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 关闭实例账户密码轮转
# @param request: Request instance for DeleteRotationPassword.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteRotationPasswordRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteRotationPasswordResponse`
def DeleteRotationPassword(request)
body = send_request('DeleteRotationPassword', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteRotationPasswordResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DeleteTimeWindow)用于删除云数据库实例的维护时间窗口。删除实例维护时间窗口之后,默认的维护时间窗为 03:00-04:00,即当选择在维护时间窗口内切换访问新实例时,默认会在 03:00-04:00 点进行切换访问新实例。
# @param request: Request instance for DeleteTimeWindow.
# @type request: :class:`Tencentcloud::cdb::V20170320::DeleteTimeWindowRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DeleteTimeWindowResponse`
def DeleteTimeWindow(request)
body = send_request('DeleteTimeWindow', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteTimeWindowResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAccountPrivileges)用于查询云数据库账户支持的权限信息。
# @param request: Request instance for DescribeAccountPrivileges.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAccountPrivilegesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAccountPrivilegesResponse`
def DescribeAccountPrivileges(request)
body = send_request('DescribeAccountPrivileges', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAccountPrivilegesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAccounts)用于查询云数据库的所有账户信息。
# @param request: Request instance for DescribeAccounts.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAccountsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAccountsResponse`
def DescribeAccounts(request)
body = send_request('DescribeAccounts', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAccountsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAsyncRequestInfo)用于查询云数据库实例异步任务的执行结果。
# @param request: Request instance for DescribeAsyncRequestInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAsyncRequestInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAsyncRequestInfoResponse`
def DescribeAsyncRequestInfo(request)
body = send_request('DescribeAsyncRequestInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAsyncRequestInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAuditConfig)用于查询云数据库审计策略的服务配置,包括审计日志保存时长等。
# @param request: Request instance for DescribeAuditConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditConfigResponse`
def DescribeAuditConfig(request)
body = send_request('DescribeAuditConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 获取审计实例列表
# @param request: Request instance for DescribeAuditInstanceList.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditInstanceListRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditInstanceListResponse`
def DescribeAuditInstanceList(request)
body = send_request('DescribeAuditInstanceList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditInstanceListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAuditLogFiles)用于查询云数据库实例的审计日志文件。
# @param request: Request instance for DescribeAuditLogFiles.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditLogFilesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditLogFilesResponse`
def DescribeAuditLogFiles(request)
body = send_request('DescribeAuditLogFiles', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditLogFilesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAuditLogs)用于查询数据库审计日志。
# @param request: Request instance for DescribeAuditLogs.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditLogsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditLogsResponse`
def DescribeAuditLogs(request)
body = send_request('DescribeAuditLogs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditLogsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAuditPolicies)用于查询云数据库实例的审计策略。
# @param request: Request instance for DescribeAuditPolicies.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditPoliciesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditPoliciesResponse`
def DescribeAuditPolicies(request)
body = send_request('DescribeAuditPolicies', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditPoliciesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询规则模板变更记录
# @param request: Request instance for DescribeAuditRuleTemplateModifyHistory.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRuleTemplateModifyHistoryRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRuleTemplateModifyHistoryResponse`
def DescribeAuditRuleTemplateModifyHistory(request)
body = send_request('DescribeAuditRuleTemplateModifyHistory', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditRuleTemplateModifyHistoryResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询审计规则模板信息
# @param request: Request instance for DescribeAuditRuleTemplates.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRuleTemplatesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRuleTemplatesResponse`
def DescribeAuditRuleTemplates(request)
body = send_request('DescribeAuditRuleTemplates', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditRuleTemplatesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeAuditRules)用于查询用户在当前地域的审计规则。
# @param request: Request instance for DescribeAuditRules.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRulesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeAuditRulesResponse`
def DescribeAuditRules(request)
body = send_request('DescribeAuditRules', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAuditRulesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackupConfig)用于查询数据库备份配置信息。
# @param request: Request instance for DescribeBackupConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupConfigResponse`
def DescribeBackupConfig(request)
body = send_request('DescribeBackupConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackupDecryptionKey)用于查询备份文件解密密钥。
# @param request: Request instance for DescribeBackupDecryptionKey.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupDecryptionKeyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupDecryptionKeyResponse`
def DescribeBackupDecryptionKey(request)
body = send_request('DescribeBackupDecryptionKey', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupDecryptionKeyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口用户查询当前地域用户设置的默认备份下载来源限制。
# @param request: Request instance for DescribeBackupDownloadRestriction.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupDownloadRestrictionRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupDownloadRestrictionResponse`
def DescribeBackupDownloadRestriction(request)
body = send_request('DescribeBackupDownloadRestriction', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupDownloadRestrictionResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackupEncryptionStatus)用于查询实例默认备份加密状态。
# @param request: Request instance for DescribeBackupEncryptionStatus.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupEncryptionStatusRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupEncryptionStatusResponse`
def DescribeBackupEncryptionStatus(request)
body = send_request('DescribeBackupEncryptionStatus', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupEncryptionStatusResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackupOverview)用于查询用户的备份概览。返回用户当前备份总个数、备份总的占用容量、赠送的免费容量、计费容量(容量单位为字节)。
# @param request: Request instance for DescribeBackupOverview.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupOverviewRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupOverviewResponse`
def DescribeBackupOverview(request)
body = send_request('DescribeBackupOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackupSummaries)用于查询备份的统计情况,返回以实例为维度的备份占用容量,以及每个实例的数据备份和日志备份的个数和容量(容量单位为字节)。
# @param request: Request instance for DescribeBackupSummaries.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupSummariesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupSummariesResponse`
def DescribeBackupSummaries(request)
body = send_request('DescribeBackupSummaries', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupSummariesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBackups)用于查询云数据库实例的备份数据。
# @param request: Request instance for DescribeBackups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBackupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBackupsResponse`
def DescribeBackups(request)
body = send_request('DescribeBackups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBinlogBackupOverview)用于查询用户在当前地域总的日志备份概览。
# @param request: Request instance for DescribeBinlogBackupOverview.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBinlogBackupOverviewRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBinlogBackupOverviewResponse`
def DescribeBinlogBackupOverview(request)
body = send_request('DescribeBinlogBackupOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBinlogBackupOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeBinlogs)用于查询云数据库实例的 binlog 文件列表。
# @param request: Request instance for DescribeBinlogs.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeBinlogsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeBinlogsResponse`
def DescribeBinlogs(request)
body = send_request('DescribeBinlogs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBinlogsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询数据库代理详情信息
# @param request: Request instance for DescribeCdbProxyInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeCdbProxyInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeCdbProxyInfoResponse`
def DescribeCdbProxyInfo(request)
body = send_request('DescribeCdbProxyInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeCdbProxyInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeCdbZoneConfig)用于查询云数据库各地域可售卖的规格配置。
# @param request: Request instance for DescribeCdbZoneConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeCdbZoneConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeCdbZoneConfigResponse`
def DescribeCdbZoneConfig(request)
body = send_request('DescribeCdbZoneConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeCdbZoneConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeCloneList) 用于查询用户实例的克隆任务列表。
# @param request: Request instance for DescribeCloneList.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeCloneListRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeCloneListResponse`
def DescribeCloneList(request)
body = send_request('DescribeCloneList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeCloneListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeClusterInfo)用于查询集群版实例信息。
# @param request: Request instance for DescribeClusterInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeClusterInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeClusterInfoResponse`
def DescribeClusterInfo(request)
body = send_request('DescribeClusterInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeClusterInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 通过该 API 可以查询实例的 CPU 弹性扩容策略
# @param request: Request instance for DescribeCpuExpandStrategy.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeCpuExpandStrategyRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeCpuExpandStrategyResponse`
def DescribeCpuExpandStrategy(request)
body = send_request('DescribeCpuExpandStrategy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeCpuExpandStrategyResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBFeatures)用于查询云数据库版本属性,包括是否支持数据库加密、数据库审计等功能。
# @param request: Request instance for DescribeDBFeatures.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBFeaturesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBFeaturesResponse`
def DescribeDBFeatures(request)
body = send_request('DescribeDBFeatures', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBFeaturesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBImportRecords)用于查询云数据库导入任务操作日志。
# @param request: Request instance for DescribeDBImportRecords.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBImportRecordsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBImportRecordsResponse`
def DescribeDBImportRecords(request)
body = send_request('DescribeDBImportRecords', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBImportRecordsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstanceCharset)用于查询云数据库实例的字符集,获取字符集的名称。
# @param request: Request instance for DescribeDBInstanceCharset.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceCharsetRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceCharsetResponse`
def DescribeDBInstanceCharset(request)
body = send_request('DescribeDBInstanceCharset', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceCharsetResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstanceConfig)用于云数据库实例的配置信息,包括同步模式,部署模式等。
# @param request: Request instance for DescribeDBInstanceConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceConfigResponse`
def DescribeDBInstanceConfig(request)
body = send_request('DescribeDBInstanceConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstanceGTID)用于查询云数据库实例是否开通了 GTID,不支持版本为 5.5 以及以下的实例。
# @param request: Request instance for DescribeDBInstanceGTID.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceGTIDRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceGTIDResponse`
def DescribeDBInstanceGTID(request)
body = send_request('DescribeDBInstanceGTID', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceGTIDResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询实例基本信息(实例 ID ,实例名称,是否开通加密 )
# @param request: Request instance for DescribeDBInstanceInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceInfoResponse`
def DescribeDBInstanceInfo(request)
body = send_request('DescribeDBInstanceInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstanceLogToCLS)用于查询实例慢日志、错误日志投递CLS的配置,通过AppId、Region以及实例ID过滤出当前实例日志投递CLS的配置。
# @param request: Request instance for DescribeDBInstanceLogToCLS.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceLogToCLSRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceLogToCLSResponse`
def DescribeDBInstanceLogToCLS(request)
body = send_request('DescribeDBInstanceLogToCLS', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceLogToCLSResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstanceRebootTime)用于查询云数据库实例重启预计所需的时间。
# @param request: Request instance for DescribeDBInstanceRebootTime.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceRebootTimeRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstanceRebootTimeResponse`
def DescribeDBInstanceRebootTime(request)
body = send_request('DescribeDBInstanceRebootTime', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstanceRebootTimeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目 ID、实例 ID、访问地址、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。
# @param request: Request instance for DescribeDBInstances.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstancesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBInstancesResponse`
def DescribeDBInstances(request)
body = send_request('DescribeDBInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBPrice)用于查询购买或续费云数据库实例的价格,支持查询按量计费或者包年包月的价格。可传入实例类型、购买时长、购买数量、内存大小、硬盘大小和可用区信息等来查询实例价格。可传入实例名称来查询实例续费价格。
# 注意:对某个地域进行询价,请使用对应地域的接入点,接入点信息请参照 <a href="https://cloud.tencent.com/document/api/236/15832">服务地址</a> 文档。例如:对广州地域进行询价,请把请求发到:cdb.ap-guangzhou.tencentcloudapi.com。同理对上海地域询价,把请求发到:cdb.ap-shanghai.tencentcloudapi.com。
# @param request: Request instance for DescribeDBPrice.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBPriceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBPriceResponse`
def DescribeDBPrice(request)
body = send_request('DescribeDBPrice', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBPriceResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBSecurityGroups)用于查询实例的安全组详情。
# @param request: Request instance for DescribeDBSecurityGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBSecurityGroupsResponse`
def DescribeDBSecurityGroups(request)
body = send_request('DescribeDBSecurityGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBSecurityGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDBSwitchRecords)用于查询云数据库实例切换记录。
# @param request: Request instance for DescribeDBSwitchRecords.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDBSwitchRecordsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDBSwitchRecordsResponse`
def DescribeDBSwitchRecords(request)
body = send_request('DescribeDBSwitchRecords', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDBSwitchRecordsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDataBackupOverview)用于查询用户在当前地域总的数据备份概览。
# @param request: Request instance for DescribeDataBackupOverview.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDataBackupOverviewRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDataBackupOverviewResponse`
def DescribeDataBackupOverview(request)
body = send_request('DescribeDataBackupOverview', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDataBackupOverviewResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDatabases)用于查询云数据库实例的数据库信息,仅支持主实例和灾备实例,不支持只读实例。
# @param request: Request instance for DescribeDatabases.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDatabasesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDatabasesResponse`
def DescribeDatabases(request)
body = send_request('DescribeDatabases', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDatabasesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DescribeDefaultParams)用于查询默认的可设置参数列表。
# @param request: Request instance for DescribeDefaultParams.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDefaultParamsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDefaultParamsResponse`
def DescribeDefaultParams(request)
body = send_request('DescribeDefaultParams', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDefaultParamsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDeployGroupList)用于查询用户的置放群组列表,可以指定置放群组 ID 或置放群组名称。
# @param request: Request instance for DescribeDeployGroupList.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDeployGroupListRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDeployGroupListResponse`
def DescribeDeployGroupList(request)
body = send_request('DescribeDeployGroupList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDeployGroupListResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeDeviceMonitorInfo)用于查询云数据库物理机当天的监控信息,暂只支持内存488G、硬盘6T的实例查询。
# @param request: Request instance for DescribeDeviceMonitorInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeDeviceMonitorInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeDeviceMonitorInfoResponse`
def DescribeDeviceMonitorInfo(request)
body = send_request('DescribeDeviceMonitorInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeDeviceMonitorInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 根据检索条件查询实例错误日志详情。只能查询一个月之内的错误日志。
# 使用时需要注意:可能存在单条错误日志太大,导致整个http请求的回包太大,进而引发接口超时。一旦发生超时,建议您缩小查询时的Limit参数值,从而降低包的大小,让接口能够及时返回内容。
# @param request: Request instance for DescribeErrorLogData.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeErrorLogDataRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeErrorLogDataResponse`
def DescribeErrorLogData(request)
body = send_request('DescribeErrorLogData', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeErrorLogDataResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询实例发生的事件信息
# @param request: Request instance for DescribeInstanceAlarmEvents.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceAlarmEventsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceAlarmEventsResponse`
def DescribeInstanceAlarmEvents(request)
body = send_request('DescribeInstanceAlarmEvents', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceAlarmEventsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DescribeInstanceParamRecords)用于查询实例参数修改历史。
# @param request: Request instance for DescribeInstanceParamRecords.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceParamRecordsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceParamRecordsResponse`
def DescribeInstanceParamRecords(request)
body = send_request('DescribeInstanceParamRecords', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceParamRecordsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DescribeInstanceParams)用于查询实例的参数列表。
# @param request: Request instance for DescribeInstanceParams.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceParamsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceParamsResponse`
def DescribeInstanceParams(request)
body = send_request('DescribeInstanceParams', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceParamsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeInstanceUpgradeType)用于查询数据库实例升级类型。
# @param request: Request instance for DescribeInstanceUpgradeType.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceUpgradeTypeRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeInstanceUpgradeTypeResponse`
def DescribeInstanceUpgradeType(request)
body = send_request('DescribeInstanceUpgradeType', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceUpgradeTypeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口用于查询实例本地binlog保留策略。
# @param request: Request instance for DescribeLocalBinlogConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeLocalBinlogConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeLocalBinlogConfigResponse`
def DescribeLocalBinlogConfig(request)
body = send_request('DescribeLocalBinlogConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeLocalBinlogConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DescribeParamTemplateInfo)用于查询参数模板详情,全地域公共参数Region均为ap-guangzhou。
# @param request: Request instance for DescribeParamTemplateInfo.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeParamTemplateInfoRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeParamTemplateInfoResponse`
def DescribeParamTemplateInfo(request)
body = send_request('DescribeParamTemplateInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeParamTemplateInfoResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口(DescribeParamTemplates)查询参数模板列表,全地域公共参数Region均为ap-guangzhou。
# @param request: Request instance for DescribeParamTemplates.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeParamTemplatesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeParamTemplatesResponse`
def DescribeParamTemplates(request)
body = send_request('DescribeParamTemplates', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeParamTemplatesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeProjectSecurityGroups)用于查询项目的安全组详情。
# @param request: Request instance for DescribeProjectSecurityGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeProjectSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeProjectSecurityGroupsResponse`
def DescribeProjectSecurityGroups(request)
body = send_request('DescribeProjectSecurityGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProjectSecurityGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询代理规格配置
# @param request: Request instance for DescribeProxyCustomConf.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeProxyCustomConfRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeProxyCustomConfResponse`
def DescribeProxyCustomConf(request)
body = send_request('DescribeProxyCustomConf', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProxyCustomConfResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询实例支持代理版本和参数
# @param request: Request instance for DescribeProxySupportParam.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeProxySupportParamRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeProxySupportParamResponse`
def DescribeProxySupportParam(request)
body = send_request('DescribeProxySupportParam', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProxySupportParamResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeRemoteBackupConfig)用于查询数据库异地备份配置信息。
# @param request: Request instance for DescribeRemoteBackupConfig.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeRemoteBackupConfigRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeRemoteBackupConfigResponse`
def DescribeRemoteBackupConfig(request)
body = send_request('DescribeRemoteBackupConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRemoteBackupConfigResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeRoGroups)用于查询云数据库实例的所有的RO组的信息。
# @param request: Request instance for DescribeRoGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeRoGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeRoGroupsResponse`
def DescribeRoGroups(request)
body = send_request('DescribeRoGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRoGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeRoMinScale)用于获取只读实例购买、升级时的最小规格。
# @param request: Request instance for DescribeRoMinScale.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeRoMinScaleRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeRoMinScaleResponse`
def DescribeRoMinScale(request)
body = send_request('DescribeRoMinScale', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRoMinScaleResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeRollbackRangeTime)用于查询云数据库实例可回档的时间范围。
# @param request: Request instance for DescribeRollbackRangeTime.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeRollbackRangeTimeRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeRollbackRangeTimeResponse`
def DescribeRollbackRangeTime(request)
body = send_request('DescribeRollbackRangeTime', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRollbackRangeTimeResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeRollbackTaskDetail)用于查询云数据库实例回档任务详情。
# @param request: Request instance for DescribeRollbackTaskDetail.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeRollbackTaskDetailRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeRollbackTaskDetailResponse`
def DescribeRollbackTaskDetail(request)
body = send_request('DescribeRollbackTaskDetail', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeRollbackTaskDetailResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 查询 SSL 开通情况。如果已经开通 SSL ,会同步返回证书下载链接。
# @param request: Request instance for DescribeSSLStatus.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeSSLStatusRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeSSLStatusResponse`
def DescribeSSLStatus(request)
body = send_request('DescribeSSLStatus', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSSLStatusResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 条件检索实例的慢日志。只允许查看一个月之内的慢日志。
# 使用时需要注意:可能存在单条慢日志太大,导致整个http请求的回包太大,进而引发接口超时。一旦发生超时,建议您缩小查询时的Limit参数值,从而降低包的大小,让接口能够及时返回内容。
# @param request: Request instance for DescribeSlowLogData.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeSlowLogDataRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeSlowLogDataResponse`
def DescribeSlowLogData(request)
body = send_request('DescribeSlowLogData', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSlowLogDataResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeSlowLogs)用于获取云数据库实例的慢查询日志。说明:若单次查询数据量过大,则有可能响应超时,建议缩短单次查询时间范围,如一小时,避免导致超时。
# @param request: Request instance for DescribeSlowLogs.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeSlowLogsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeSlowLogsResponse`
def DescribeSlowLogs(request)
body = send_request('DescribeSlowLogs', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSlowLogsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeSupportedPrivileges)用于查询云数据库的支持的权限信息,包括全局权限,数据库权限,表权限以及列权限。
# @param request: Request instance for DescribeSupportedPrivileges.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeSupportedPrivilegesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeSupportedPrivilegesResponse`
def DescribeSupportedPrivileges(request)
body = send_request('DescribeSupportedPrivileges', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSupportedPrivilegesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeTables)用于查询云数据库实例的数据库表信息,仅支持主实例和灾备实例,不支持只读实例。
# @param request: Request instance for DescribeTables.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeTablesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeTablesResponse`
def DescribeTables(request)
body = send_request('DescribeTables', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTablesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeTagsOfInstanceIds)用于获取云数据库实例的标签信息。
# @param request: Request instance for DescribeTagsOfInstanceIds.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeTagsOfInstanceIdsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeTagsOfInstanceIdsResponse`
def DescribeTagsOfInstanceIds(request)
body = send_request('DescribeTagsOfInstanceIds', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTagsOfInstanceIdsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeTasks)用于查询云数据库实例任务列表。
# @param request: Request instance for DescribeTasks.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeTasksRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeTasksResponse`
def DescribeTasks(request)
body = send_request('DescribeTasks', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTasksResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeTimeWindow)用于查询云数据库实例的维护时间窗口。
# @param request: Request instance for DescribeTimeWindow.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeTimeWindowRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeTimeWindowResponse`
def DescribeTimeWindow(request)
body = send_request('DescribeTimeWindow', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTimeWindowResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DescribeUploadedFiles)用于查询用户导入的SQL文件列表,全地域公共参数Region均为ap-shanghai。
# @param request: Request instance for DescribeUploadedFiles.
# @type request: :class:`Tencentcloud::cdb::V20170320::DescribeUploadedFilesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DescribeUploadedFilesResponse`
def DescribeUploadedFiles(request)
body = send_request('DescribeUploadedFiles', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeUploadedFilesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(DisassociateSecurityGroups)用于安全组批量解绑实例。
# @param request: Request instance for DisassociateSecurityGroups.
# @type request: :class:`Tencentcloud::cdb::V20170320::DisassociateSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::DisassociateSecurityGroupsResponse`
def DisassociateSecurityGroups(request)
body = send_request('DisassociateSecurityGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DisassociateSecurityGroupsResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 该接口不再维护,参考CreateDBInstance+API文档,在发货时即可完成初始化。
# 本接口(InitDBInstances)用于初始化云数据库实例,包括初始化密码、默认字符集、实例端口号等。该接口已经废弃,在发货接口CreateDBInstance、CreateDBInstanceHour可以直接使用参数Password设置密码,使用参数ParamList设置字符集,使用参数Port设置端口号。
# @param request: Request instance for InitDBInstances.
# @type request: :class:`Tencentcloud::cdb::V20170320::InitDBInstancesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::InitDBInstancesResponse`
def InitDBInstances(request)
body = send_request('InitDBInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InitDBInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(InquiryPriceUpgradeInstances)用于查询云数据库实例升级的价格,支持查询按量计费或者包年包月实例的升级价格,实例类型支持主实例、灾备实例和只读实例。
# @param request: Request instance for InquiryPriceUpgradeInstances.
# @type request: :class:`Tencentcloud::cdb::V20170320::InquiryPriceUpgradeInstancesRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::InquiryPriceUpgradeInstancesResponse`
def InquiryPriceUpgradeInstances(request)
body = send_request('InquiryPriceUpgradeInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceUpgradeInstancesResponse.new
model.deserialize(response['Response'])
model
else
code = response['Response']['Error']['Code']
message = response['Response']['Error']['Message']
reqid = response['Response']['RequestId']
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
end
rescue TencentCloud::Common::TencentCloudSDKException => e
raise e
rescue StandardError => e
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
end
# 本接口(IsolateDBInstance)用于隔离云数据库实例,隔离后不能通过IP和端口访问数据库。隔离的实例可在回收站中进行开机。若为欠费隔离,请尽快进行充值。
# @param request: Request instance for IsolateDBInstance.
# @type request: :class:`Tencentcloud::cdb::V20170320::IsolateDBInstanceRequest`
# @rtype: :class:`Tencentcloud::cdb::V20170320::IsolateDBInstanceResponse`
def IsolateDBInstance(request)
body = send_request('IsolateDBInstance', request.serialize)
response = JSON.parse(body)
if