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 118.81 KB
Copy Edit Raw Blame History
tencentcloud authored 2024-06-19 11:38 . release 3.0.846
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484
# 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 Redis
module V20180412
class Client < TencentCloud::Common::AbstractClient
def initialize(credential, region, profile = nil)
api_version = '2018-04-12'
api_endpoint = 'redis.tencentcloudapi.com'
sdk_version = 'REDIS_' + File.read(File.expand_path('../VERSION', __dir__)).strip
super(credential, region, api_version, api_endpoint, sdk_version, profile)
end
# 添加复制组成员
# @param request: Request instance for AddReplicationInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::AddReplicationInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::AddReplicationInstanceResponse`
def AddReplicationInstance(request)
body = send_request('AddReplicationInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AddReplicationInstanceResponse.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 AllocateWanAddress.
# @type request: :class:`Tencentcloud::redis::V20180412::AllocateWanAddressRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::AllocateWanAddressResponse`
def AllocateWanAddress(request)
body = send_request('AllocateWanAddress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = AllocateWanAddressResponse.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 ApplyParamsTemplate.
# @type request: :class:`Tencentcloud::redis::V20180412::ApplyParamsTemplateRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ApplyParamsTemplateResponse`
def ApplyParamsTemplate(request)
body = send_request('ApplyParamsTemplate', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ApplyParamsTemplateResponse.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::redis::V20180412::AssociateSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 复制组实例更换角色
# @param request: Request instance for ChangeInstanceRole.
# @type request: :class:`Tencentcloud::redis::V20180412::ChangeInstanceRoleRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ChangeInstanceRoleResponse`
def ChangeInstanceRole(request)
body = send_request('ChangeInstanceRole', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ChangeInstanceRoleResponse.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
# 该接口(ChangeMasterInstance)用于将复制组内只读实例设置为主实例。
# @param request: Request instance for ChangeMasterInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::ChangeMasterInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ChangeMasterInstanceResponse`
def ChangeMasterInstance(request)
body = send_request('ChangeMasterInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ChangeMasterInstanceResponse.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
# 本接口(ChangeReplicaToMaster)适用于实例副本组提主或副本提主。
# @param request: Request instance for ChangeReplicaToMaster.
# @type request: :class:`Tencentcloud::redis::V20180412::ChangeReplicaToMasterRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ChangeReplicaToMasterResponse`
def ChangeReplicaToMaster(request)
body = send_request('ChangeReplicaToMaster', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ChangeReplicaToMasterResponse.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 CleanUpInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::CleanUpInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::CleanUpInstanceResponse`
def CleanUpInstance(request)
body = send_request('CleanUpInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CleanUpInstanceResponse.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
# 清空Redis实例的实例数据。
# @param request: Request instance for ClearInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::ClearInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ClearInstanceResponse`
def ClearInstance(request)
body = send_request('ClearInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ClearInstanceResponse.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
# 本接口(CloneInstances)用于基于当前实例的备份文件克隆一个完整的新实例。
# @param request: Request instance for CloneInstances.
# @type request: :class:`Tencentcloud::redis::V20180412::CloneInstancesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::CloneInstancesResponse`
def CloneInstances(request)
body = send_request('CloneInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CloneInstancesResponse.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::redis::V20180412::CloseSSLRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 该接口(CreateInstanceAccount)用于自定义访问实例的账号。
# @param request: Request instance for CreateInstanceAccount.
# @type request: :class:`Tencentcloud::redis::V20180412::CreateInstanceAccountRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::CreateInstanceAccountResponse`
def CreateInstanceAccount(request)
body = send_request('CreateInstanceAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateInstanceAccountResponse.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
# 本接口(CreateInstances)用于创建 Redis 实例。
# @param request: Request instance for CreateInstances.
# @type request: :class:`Tencentcloud::redis::V20180412::CreateInstancesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::CreateInstancesResponse`
def CreateInstances(request)
body = send_request('CreateInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateInstancesResponse.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 CreateParamTemplate.
# @type request: :class:`Tencentcloud::redis::V20180412::CreateParamTemplateRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 该接口(CreateReplicationGroup)用于创建复制组。
# @param request: Request instance for CreateReplicationGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::CreateReplicationGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::CreateReplicationGroupResponse`
def CreateReplicationGroup(request)
body = send_request('CreateReplicationGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = CreateReplicationGroupResponse.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 DeleteInstanceAccount.
# @type request: :class:`Tencentcloud::redis::V20180412::DeleteInstanceAccountRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DeleteInstanceAccountResponse`
def DeleteInstanceAccount(request)
body = send_request('DeleteInstanceAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteInstanceAccountResponse.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 DeleteParamTemplate.
# @type request: :class:`Tencentcloud::redis::V20180412::DeleteParamTemplateRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 移除复制组成员 注:接口下线中,请使用 RemoveReplicationInstance
# @param request: Request instance for DeleteReplicationInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::DeleteReplicationInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DeleteReplicationInstanceResponse`
def DeleteReplicationInstance(request)
body = send_request('DeleteReplicationInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DeleteReplicationInstanceResponse.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
# 本接口(DescribeAutoBackupConfig)用于获取自动备份配置规则。
# @param request: Request instance for DescribeAutoBackupConfig.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeAutoBackupConfigRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeAutoBackupConfigResponse`
def DescribeAutoBackupConfig(request)
body = send_request('DescribeAutoBackupConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeAutoBackupConfigResponse.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
# 本接口(DescribeBackupDetail)用于查询实例的备份信息详情。
# @param request: Request instance for DescribeBackupDetail.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeBackupDetailRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeBackupDetailResponse`
def DescribeBackupDetail(request)
body = send_request('DescribeBackupDetail', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupDetailResponse.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
# 本接口(DescribeBackupDownloadRestriction)用于查询当前地域数据库备份文件的下载地址。
# @param request: Request instance for DescribeBackupDownloadRestriction.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeBackupDownloadRestrictionRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 本接口(DescribeBackupUrl)用于查询备份 Rdb 文件的下载地址。
# @param request: Request instance for DescribeBackupUrl.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeBackupUrlRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeBackupUrlResponse`
def DescribeBackupUrl(request)
body = send_request('DescribeBackupUrl', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBackupUrlResponse.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
# 本接口(DescribeBandwidthRange)用于查询实例带宽信息。
# @param request: Request instance for DescribeBandwidthRange.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeBandwidthRangeRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeBandwidthRangeResponse`
def DescribeBandwidthRange(request)
body = send_request('DescribeBandwidthRange', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeBandwidthRangeResponse.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
# 查询Redis实例列表信息。该接口已废弃。
# @param request: Request instance for DescribeCommonDBInstances.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeCommonDBInstancesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeCommonDBInstancesResponse`
def DescribeCommonDBInstances(request)
body = send_request('DescribeCommonDBInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeCommonDBInstancesResponse.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::redis::V20180412::DescribeDBSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 查询全球复制支持地域信息
# @param request: Request instance for DescribeGlobalReplicationArea.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeGlobalReplicationAreaRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeGlobalReplicationAreaResponse`
def DescribeGlobalReplicationArea(request)
body = send_request('DescribeGlobalReplicationArea', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeGlobalReplicationAreaResponse.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
# 本接口(DescribeInstanceAccount)用于查看实例子账号信息。
# @param request: Request instance for DescribeInstanceAccount.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceAccountRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceAccountResponse`
def DescribeInstanceAccount(request)
body = send_request('DescribeInstanceAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceAccountResponse.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
# 本接口(DescribeInstanceBackups)用于查询实例备份列表。
# @param request: Request instance for DescribeInstanceBackups.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceBackupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceBackupsResponse`
def DescribeInstanceBackups(request)
body = send_request('DescribeInstanceBackups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceBackupsResponse.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
# 查询实例DTS信息
# @param request: Request instance for DescribeInstanceDTSInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceDTSInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceDTSInfoResponse`
def DescribeInstanceDTSInfo(request)
body = send_request('DescribeInstanceDTSInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceDTSInfoResponse.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
# 本接口(DescribeInstanceDealDetail)用于查询订单信息。
# @param request: Request instance for DescribeInstanceDealDetail.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceDealDetailRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceDealDetailResponse`
def DescribeInstanceDealDetail(request)
body = send_request('DescribeInstanceDealDetail', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceDealDetailResponse.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
# 本接口(DescribeInstanceEvents)用于查询 Redis 实例事件信息。
# @param request: Request instance for DescribeInstanceEvents.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceEventsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceEventsResponse`
def DescribeInstanceEvents(request)
body = send_request('DescribeInstanceEvents', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceEventsResponse.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
# 腾讯云数据库 Redis 已经于2022年10月31日下线查询实例大 Key 接口。具体公告,请参见[查询实例大 Key 接口下线公告](https://cloud.tencent.com/document/product/239/81005)。
# @param request: Request instance for DescribeInstanceMonitorBigKey.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeyResponse`
def DescribeInstanceMonitorBigKey(request)
body = send_request('DescribeInstanceMonitorBigKey', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorBigKeyResponse.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
# 腾讯云数据库 Redis 已经于2022年10月31日下线查询实例大 Key 接口。具体公告,请参见 [查询实例大 Key 接口下线公告](https://cloud.tencent.com/document/product/239/81005)。
# @param request: Request instance for DescribeInstanceMonitorBigKeySizeDist.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeySizeDistRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeySizeDistResponse`
def DescribeInstanceMonitorBigKeySizeDist(request)
body = send_request('DescribeInstanceMonitorBigKeySizeDist', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorBigKeySizeDistResponse.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
# 腾讯云数据库 Redis 已经于2022年10月31日下线查询实例大 Key 接口。具体公告,请参见 [查询实例大 Key 接口下线公告](https://cloud.tencent.com/document/product/239/81005)。
# @param request: Request instance for DescribeInstanceMonitorBigKeyTypeDist.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeyTypeDistRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorBigKeyTypeDistResponse`
def DescribeInstanceMonitorBigKeyTypeDist(request)
body = send_request('DescribeInstanceMonitorBigKeyTypeDist', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorBigKeyTypeDistResponse.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
# 本接口(DescribeInstanceMonitorHotKey)用于查询实例热Key。
# @param request: Request instance for DescribeInstanceMonitorHotKey.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorHotKeyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorHotKeyResponse`
def DescribeInstanceMonitorHotKey(request)
body = send_request('DescribeInstanceMonitorHotKey', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorHotKeyResponse.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
# 该接口已下线,请使用数据库智能管家 DBbrain 接口 [DescribeProxyProcessStatistics] (https://cloud.tencent.com/document/product/1130/84544) 获取实例访问来源。
# @param request: Request instance for DescribeInstanceMonitorSIP.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorSIPRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorSIPResponse`
def DescribeInstanceMonitorSIP(request)
body = send_request('DescribeInstanceMonitorSIP', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorSIPResponse.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 DescribeInstanceMonitorTookDist.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTookDistRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTookDistResponse`
def DescribeInstanceMonitorTookDist(request)
body = send_request('DescribeInstanceMonitorTookDist', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorTookDistResponse.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 DescribeInstanceMonitorTopNCmd.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTopNCmdRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTopNCmdResponse`
def DescribeInstanceMonitorTopNCmd(request)
body = send_request('DescribeInstanceMonitorTopNCmd', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorTopNCmdResponse.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
# 查询实例CPU耗时
# @param request: Request instance for DescribeInstanceMonitorTopNCmdTook.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTopNCmdTookRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceMonitorTopNCmdTookResponse`
def DescribeInstanceMonitorTopNCmdTook(request)
body = send_request('DescribeInstanceMonitorTopNCmdTook', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceMonitorTopNCmdTookResponse.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
# 本接口(DescribeInstanceNodeInfo)用于查询实例节点信息。
# @param request: Request instance for DescribeInstanceNodeInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceNodeInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceNodeInfoResponse`
def DescribeInstanceNodeInfo(request)
body = send_request('DescribeInstanceNodeInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceNodeInfoResponse.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 DescribeInstanceParamRecords.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceParamRecordsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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::redis::V20180412::DescribeInstanceParamsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 本接口(DescribeInstanceSecurityGroup)用于查询实例安全组信息。
# @param request: Request instance for DescribeInstanceSecurityGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSecurityGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSecurityGroupResponse`
def DescribeInstanceSecurityGroup(request)
body = send_request('DescribeInstanceSecurityGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceSecurityGroupResponse.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
# 本接口(DescribeInstanceShards)用于获取集群架构实例的分片信息。
# @param request: Request instance for DescribeInstanceShards.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceShardsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceShardsResponse`
def DescribeInstanceShards(request)
body = send_request('DescribeInstanceShards', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceShardsResponse.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
# 本接口(DescribeInstanceSpecBandwidth)用于查询或计算带宽规格。
# @param request: Request instance for DescribeInstanceSpecBandwidth.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSpecBandwidthRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSpecBandwidthResponse`
def DescribeInstanceSpecBandwidth(request)
body = send_request('DescribeInstanceSpecBandwidth', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceSpecBandwidthResponse.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
# 本接口(DescribeInstanceSupportFeature)用于查询实例支持的功能特性。
# @param request: Request instance for DescribeInstanceSupportFeature.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSupportFeatureRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceSupportFeatureResponse`
def DescribeInstanceSupportFeature(request)
body = send_request('DescribeInstanceSupportFeature', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceSupportFeatureResponse.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
# 本接口(DescribeInstanceZoneInfo)用于查询 Redis 节点详细信息。
# @param request: Request instance for DescribeInstanceZoneInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstanceZoneInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstanceZoneInfoResponse`
def DescribeInstanceZoneInfo(request)
body = send_request('DescribeInstanceZoneInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstanceZoneInfoResponse.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
# 本接口(DescribeInstances)用于查询Redis实例列表。
# @param request: Request instance for DescribeInstances.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeInstancesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeInstancesResponse`
def DescribeInstances(request)
body = send_request('DescribeInstances', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeInstancesResponse.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
# 本接口(DescribeMaintenanceWindow)用于查询实例维护时间窗。在实例需要进行版本升级或者架构升级的时候,会在维护时间窗时间内进行切换
# @param request: Request instance for DescribeMaintenanceWindow.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeMaintenanceWindowRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeMaintenanceWindowResponse`
def DescribeMaintenanceWindow(request)
body = send_request('DescribeMaintenanceWindow', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeMaintenanceWindowResponse.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)用于查询参数模板详情。
# @param request: Request instance for DescribeParamTemplateInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeParamTemplateInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 查询参数模板列表
# @param request: Request instance for DescribeParamTemplates.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeParamTemplatesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 本接口(DescribeProductInfo)用于查询全地域 Redis 的售卖规格。
# @param request: Request instance for DescribeProductInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeProductInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeProductInfoResponse`
def DescribeProductInfo(request)
body = send_request('DescribeProductInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProductInfoResponse.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 DescribeProjectSecurityGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeProjectSecurityGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeProjectSecurityGroupResponse`
def DescribeProjectSecurityGroup(request)
body = send_request('DescribeProjectSecurityGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProjectSecurityGroupResponse.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::redis::V20180412::DescribeProjectSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 本接口(DescribeProxySlowLog)用于查询代理慢查询。
# @param request: Request instance for DescribeProxySlowLog.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeProxySlowLogRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeProxySlowLogResponse`
def DescribeProxySlowLog(request)
body = send_request('DescribeProxySlowLog', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeProxySlowLogResponse.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
# 本接口(DescribeReplicationGroup)用于查询复制组。
# @param request: Request instance for DescribeReplicationGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeReplicationGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeReplicationGroupResponse`
def DescribeReplicationGroup(request)
body = send_request('DescribeReplicationGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeReplicationGroupResponse.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 DescribeReplicationGroupInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeReplicationGroupInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeReplicationGroupInstanceResponse`
def DescribeReplicationGroupInstance(request)
body = send_request('DescribeReplicationGroupInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeReplicationGroupInstanceResponse.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
# 本接口(DescribeSSLStatus)用于查询实例 SSL 认证相关信息,包括开启状态、配置状态、证书地址等。
# @param request: Request instance for DescribeSSLStatus.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeSSLStatusRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 本接口(DescribeSlowLog)查询实例慢查询记录。
# @param request: Request instance for DescribeSlowLog.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeSlowLogRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeSlowLogResponse`
def DescribeSlowLog(request)
body = send_request('DescribeSlowLog', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeSlowLogResponse.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
# 本接口(DescribeTaskInfo)用于获取指定任务的执行情况。
# @param request: Request instance for DescribeTaskInfo.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeTaskInfoRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeTaskInfoResponse`
def DescribeTaskInfo(request)
body = send_request('DescribeTaskInfo', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTaskInfoResponse.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
# 本接口(DescribeTaskList)用于查询指定实例的任务列表信息。
# @param request: Request instance for DescribeTaskList.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeTaskListRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeTaskListResponse`
def DescribeTaskList(request)
body = send_request('DescribeTaskList', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTaskListResponse.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
# 查询Tendis慢查询
# @param request: Request instance for DescribeTendisSlowLog.
# @type request: :class:`Tencentcloud::redis::V20180412::DescribeTendisSlowLogRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DescribeTendisSlowLogResponse`
def DescribeTendisSlowLog(request)
body = send_request('DescribeTendisSlowLog', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DescribeTendisSlowLogResponse.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 DestroyPostpaidInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::DestroyPostpaidInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DestroyPostpaidInstanceResponse`
def DestroyPostpaidInstance(request)
body = send_request('DestroyPostpaidInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DestroyPostpaidInstanceResponse.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 DestroyPrepaidInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::DestroyPrepaidInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DestroyPrepaidInstanceResponse`
def DestroyPrepaidInstance(request)
body = send_request('DestroyPrepaidInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DestroyPrepaidInstanceResponse.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 DisableReplicaReadonly.
# @type request: :class:`Tencentcloud::redis::V20180412::DisableReplicaReadonlyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::DisableReplicaReadonlyResponse`
def DisableReplicaReadonly(request)
body = send_request('DisableReplicaReadonly', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = DisableReplicaReadonlyResponse.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::redis::V20180412::DisassociateSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::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
# 启用读写分离
# @param request: Request instance for EnableReplicaReadonly.
# @type request: :class:`Tencentcloud::redis::V20180412::EnableReplicaReadonlyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::EnableReplicaReadonlyResponse`
def EnableReplicaReadonly(request)
body = send_request('EnableReplicaReadonly', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = EnableReplicaReadonlyResponse.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 InquiryPriceCreateInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::InquiryPriceCreateInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::InquiryPriceCreateInstanceResponse`
def InquiryPriceCreateInstance(request)
body = send_request('InquiryPriceCreateInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceCreateInstanceResponse.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
# 本接口(InquiryPriceRenewInstance)用于查询包年包月计费实例的续费价格。
# @param request: Request instance for InquiryPriceRenewInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::InquiryPriceRenewInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::InquiryPriceRenewInstanceResponse`
def InquiryPriceRenewInstance(request)
body = send_request('InquiryPriceRenewInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceRenewInstanceResponse.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 InquiryPriceUpgradeInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::InquiryPriceUpgradeInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::InquiryPriceUpgradeInstanceResponse`
def InquiryPriceUpgradeInstance(request)
body = send_request('InquiryPriceUpgradeInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = InquiryPriceUpgradeInstanceResponse.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
# 本接口(KillMasterGroup)模拟故障。
# @param request: Request instance for KillMasterGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::KillMasterGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::KillMasterGroupResponse`
def KillMasterGroup(request)
body = send_request('KillMasterGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = KillMasterGroupResponse.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
# 本接口(ManualBackupInstance)用于手动备份Redis实例。
# @param request: Request instance for ManualBackupInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::ManualBackupInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ManualBackupInstanceResponse`
def ManualBackupInstance(request)
body = send_request('ManualBackupInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ManualBackupInstanceResponse.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
# 本接口(ModfiyInstancePassword)用于修改实例访问密码。
# @param request: Request instance for ModfiyInstancePassword.
# @type request: :class:`Tencentcloud::redis::V20180412::ModfiyInstancePasswordRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModfiyInstancePasswordResponse`
def ModfiyInstancePassword(request)
body = send_request('ModfiyInstancePassword', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModfiyInstancePasswordResponse.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
# 本接口(ModifyAutoBackupConfig)用于设置自动备份的配置。
# @param request: Request instance for ModifyAutoBackupConfig.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyAutoBackupConfigRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyAutoBackupConfigResponse`
def ModifyAutoBackupConfig(request)
body = send_request('ModifyAutoBackupConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyAutoBackupConfigResponse.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
# 本接口(ModifyBackupDownloadRestriction)用于修改备份文件下载的网络信息与地址。
# @param request: Request instance for ModifyBackupDownloadRestriction.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyBackupDownloadRestrictionRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyBackupDownloadRestrictionResponse`
def ModifyBackupDownloadRestriction(request)
body = send_request('ModifyBackupDownloadRestriction', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyBackupDownloadRestrictionResponse.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 ModifyConnectionConfig.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyConnectionConfigRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyConnectionConfigResponse`
def ModifyConnectionConfig(request)
body = send_request('ModifyConnectionConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyConnectionConfigResponse.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
# 本接口(ModifyDBInstanceSecurityGroups)用于修改实例绑定的安全组。
# @param request: Request instance for ModifyDBInstanceSecurityGroups.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyDBInstanceSecurityGroupsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyDBInstanceSecurityGroupsResponse`
def ModifyDBInstanceSecurityGroups(request)
body = send_request('ModifyDBInstanceSecurityGroups', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyDBInstanceSecurityGroupsResponse.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 ModifyInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceResponse`
def ModifyInstance(request)
body = send_request('ModifyInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceResponse.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 ModifyInstanceAccount.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceAccountRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceAccountResponse`
def ModifyInstanceAccount(request)
body = send_request('ModifyInstanceAccount', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceAccountResponse.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
# 本接口(ModifyInstanceAvailabilityZones)用于变更实例可用区
# @param request: Request instance for ModifyInstanceAvailabilityZones.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceAvailabilityZonesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceAvailabilityZonesResponse`
def ModifyInstanceAvailabilityZones(request)
body = send_request('ModifyInstanceAvailabilityZones', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceAvailabilityZonesResponse.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
# 本接口(ModifyInstanceEvent)用于修改实例的运维事件的执行计划。
# @param request: Request instance for ModifyInstanceEvent.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceEventRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceEventResponse`
def ModifyInstanceEvent(request)
body = send_request('ModifyInstanceEvent', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceEventResponse.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
# 本接口(ModifyInstanceParams)用于修改Redis实例的参数配置。
# @param request: Request instance for ModifyInstanceParams.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceParamsRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceParamsResponse`
def ModifyInstanceParams(request)
body = send_request('ModifyInstanceParams', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceParamsResponse.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 ModifyInstanceReadOnly.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyInstanceReadOnlyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyInstanceReadOnlyResponse`
def ModifyInstanceReadOnly(request)
body = send_request('ModifyInstanceReadOnly', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyInstanceReadOnlyResponse.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 ModifyMaintenanceWindow.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyMaintenanceWindowRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyMaintenanceWindowResponse`
def ModifyMaintenanceWindow(request)
body = send_request('ModifyMaintenanceWindow', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyMaintenanceWindowResponse.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
# 本接口(ModifyNetworkConfig)用于修改实例网络配置。
# @param request: Request instance for ModifyNetworkConfig.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyNetworkConfigRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyNetworkConfigResponse`
def ModifyNetworkConfig(request)
body = send_request('ModifyNetworkConfig', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyNetworkConfigResponse.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 ModifyParamTemplate.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyParamTemplateRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyParamTemplateResponse`
def ModifyParamTemplate(request)
body = send_request('ModifyParamTemplate', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyParamTemplateResponse.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 ModifyReplicationGroup.
# @type request: :class:`Tencentcloud::redis::V20180412::ModifyReplicationGroupRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ModifyReplicationGroupResponse`
def ModifyReplicationGroup(request)
body = send_request('ModifyReplicationGroup', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ModifyReplicationGroupResponse.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 OpenSSL.
# @type request: :class:`Tencentcloud::redis::V20180412::OpenSSLRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::OpenSSLResponse`
def OpenSSL(request)
body = send_request('OpenSSL', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = OpenSSLResponse.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 ReleaseWanAddress.
# @type request: :class:`Tencentcloud::redis::V20180412::ReleaseWanAddressRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ReleaseWanAddressResponse`
def ReleaseWanAddress(request)
body = send_request('ReleaseWanAddress', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ReleaseWanAddressResponse.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 RemoveReplicationInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::RemoveReplicationInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::RemoveReplicationInstanceResponse`
def RemoveReplicationInstance(request)
body = send_request('RemoveReplicationInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = RemoveReplicationInstanceResponse.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
# 本接口(RenewInstance)可用于为实例续费。
# @param request: Request instance for RenewInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::RenewInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::RenewInstanceResponse`
def RenewInstance(request)
body = send_request('RenewInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = RenewInstanceResponse.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 ResetPassword.
# @type request: :class:`Tencentcloud::redis::V20180412::ResetPasswordRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::ResetPasswordResponse`
def ResetPassword(request)
body = send_request('ResetPassword', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = ResetPasswordResponse.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
# 恢复 CRS 实例
# @param request: Request instance for RestoreInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::RestoreInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::RestoreInstanceResponse`
def RestoreInstance(request)
body = send_request('RestoreInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = RestoreInstanceResponse.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 StartupInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::StartupInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::StartupInstanceResponse`
def StartupInstance(request)
body = send_request('StartupInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = StartupInstanceResponse.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
# 本接口(SwitchAccessNewInstance)针对处于时间窗口中待切换操作的实例,用户可主动发起该操作。
# @param request: Request instance for SwitchAccessNewInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::SwitchAccessNewInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::SwitchAccessNewInstanceResponse`
def SwitchAccessNewInstance(request)
body = send_request('SwitchAccessNewInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = SwitchAccessNewInstanceResponse.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
# 在通过DTS支持跨可用区灾备的场景中,通过该接口交换实例VIP完成实例灾备切换。交换VIP后目标实例可写,源和目标实例VIP互换,同时源与目标实例间DTS同步任务断开
# @param request: Request instance for SwitchInstanceVip.
# @type request: :class:`Tencentcloud::redis::V20180412::SwitchInstanceVipRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::SwitchInstanceVipResponse`
def SwitchInstanceVip(request)
body = send_request('SwitchInstanceVip', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = SwitchInstanceVipResponse.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
# Proxy模拟故障接口
# @param request: Request instance for SwitchProxy.
# @type request: :class:`Tencentcloud::redis::V20180412::SwitchProxyRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::SwitchProxyResponse`
def SwitchProxy(request)
body = send_request('SwitchProxy', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = SwitchProxyResponse.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 UpgradeInstance.
# @type request: :class:`Tencentcloud::redis::V20180412::UpgradeInstanceRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::UpgradeInstanceResponse`
def UpgradeInstance(request)
body = send_request('UpgradeInstance', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeInstanceResponse.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 UpgradeInstanceVersion.
# @type request: :class:`Tencentcloud::redis::V20180412::UpgradeInstanceVersionRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::UpgradeInstanceVersionResponse`
def UpgradeInstanceVersion(request)
body = send_request('UpgradeInstanceVersion', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeInstanceVersionResponse.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
# 实例proxy版本升级
# @param request: Request instance for UpgradeProxyVersion.
# @type request: :class:`Tencentcloud::redis::V20180412::UpgradeProxyVersionRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::UpgradeProxyVersionResponse`
def UpgradeProxyVersion(request)
body = send_request('UpgradeProxyVersion', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeProxyVersionResponse.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 UpgradeSmallVersion.
# @type request: :class:`Tencentcloud::redis::V20180412::UpgradeSmallVersionRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::UpgradeSmallVersionResponse`
def UpgradeSmallVersion(request)
body = send_request('UpgradeSmallVersion', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeSmallVersionResponse.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
# 升级实例支持多AZ
# @param request: Request instance for UpgradeVersionToMultiAvailabilityZones.
# @type request: :class:`Tencentcloud::redis::V20180412::UpgradeVersionToMultiAvailabilityZonesRequest`
# @rtype: :class:`Tencentcloud::redis::V20180412::UpgradeVersionToMultiAvailabilityZonesResponse`
def UpgradeVersionToMultiAvailabilityZones(request)
body = send_request('UpgradeVersionToMultiAvailabilityZones', request.serialize)
response = JSON.parse(body)
if response['Response'].key?('Error') == false
model = UpgradeVersionToMultiAvailabilityZonesResponse.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
end
end
end
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-ruby.git
git@gitee.com:tencentcloud/tencentcloud-sdk-ruby.git
tencentcloud
tencentcloud-sdk-ruby
tencentcloud-sdk-ruby
master

Search