lib/v20180411/client.rb in tencentcloud-sdk-dcdb-1.0.240 vs lib/v20180411/client.rb in tencentcloud-sdk-dcdb-1.0.241

- old
+ new

@@ -1238,9 +1238,33 @@ raise e rescue StandardError => e raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect) end + # 本接口(SwitchDBInstanceHA)用于实例主备切换。 + + # @param request: Request instance for SwitchDBInstanceHA. + # @type request: :class:`Tencentcloud::dcdb::V20180411::SwitchDBInstanceHARequest` + # @rtype: :class:`Tencentcloud::dcdb::V20180411::SwitchDBInstanceHAResponse` + def SwitchDBInstanceHA(request) + body = send_request('SwitchDBInstanceHA', request.serialize) + response = JSON.parse(body) + if response['Response'].key?('Error') == false + model = SwitchDBInstanceHAResponse.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 + # 本接口(UpgradeDCDBInstance)用于升级分布式数据库实例。本接口完成下单和支付两个动作,如果发生支付失败的错误,调用用户账户相关接口中的支付订单接口(PayDeals)重新支付即可。 # @param request: Request instance for UpgradeDCDBInstance. # @type request: :class:`Tencentcloud::dcdb::V20180411::UpgradeDCDBInstanceRequest` # @rtype: :class:`Tencentcloud::dcdb::V20180411::UpgradeDCDBInstanceResponse` \ No newline at end of file