def ModifyDisksChargeType(self, request): """接口请求域名: cbs.tencentcloudapi.com 。 本接口 (ModifyDisksChargeType) 用于切换云盘的计费模式。 只支持从 POSTPAID_BY_HOUR 计费模式切换为PREPAID计费模式。 非弹性云盘不支持此接口,请通过修改实例计费模式接口将实例连同非弹性云盘一起转换。 默认接口请求频率限制:10次/秒。 :param request: Request instance for ModifyDisksChargeType. :type request: :class:`tencentcloud.cbs.v20170312.models.ModifyDisksChargeTypeRequest` :rtype: :class:`tencentcloud.cbs.v20170312.models.ModifyDisksChargeTypeResponse` """ try: params = request._serialize() body = self.call("ModifyDisksChargeType", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.ModifyDisksChargeTypeResponse() model._deserialize(response["Response"]) return model else: code = response["Response"]["Error"]["Code"] message = response["Response"]["Error"]["Message"] reqid = response["Response"]["RequestId"] raise TencentCloudSDKException(code, message, reqid) except Exception as e: if isinstance(e, TencentCloudSDKException): raise else: raise TencentCloudSDKException(e.message, e.message)
def ModifyDisksChargeType(self, request): """API domain name: cbs.tencentcloudapi.com. This API is used to change the billing mode of cloud disks. You can only use this API to change the billing method from `POSTPAID_BY_HOUR` to `PREPAID`. This API does not support non-elastic cloud disks. Please use `modifyinstanceschargetype` API to convert CVM instances and the bound non-elastic cloud disks. Default API request frequency limit: 10 times/second. :param request: Request instance for ModifyDisksChargeType. :type request: :class:`tencentcloud.cbs.v20170312.models.ModifyDisksChargeTypeRequest` :rtype: :class:`tencentcloud.cbs.v20170312.models.ModifyDisksChargeTypeResponse` """ try: params = request._serialize() body = self.call("ModifyDisksChargeType", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.ModifyDisksChargeTypeResponse() model._deserialize(response["Response"]) return model else: code = response["Response"]["Error"]["Code"] message = response["Response"]["Error"]["Message"] reqid = response["Response"]["RequestId"] raise TencentCloudSDKException(code, message, reqid) except Exception as e: if isinstance(e, TencentCloudSDKException): raise else: raise TencentCloudSDKException(e.message, e.message)