def BindAutoSnapshotPolicy(self, request): """本接口(BindAutoSnapshotPolicy)用于绑定云硬盘到指定的定期快照策略。 * 每个地域下的定期快照策略配额限制请参考文档[定期快照](/document/product/362/8191)。 * 当已绑定定期快照策略的云硬盘处于未使用状态(即弹性云盘未挂载或非弹性云盘的主机处于关机状态)将不会创建定期快照。 :param request: Request instance for BindAutoSnapshotPolicy. :type request: :class:`tencentcloud.cbs.v20170312.models.BindAutoSnapshotPolicyRequest` :rtype: :class:`tencentcloud.cbs.v20170312.models.BindAutoSnapshotPolicyResponse` """ try: params = request._serialize() body = self.call("BindAutoSnapshotPolicy", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.BindAutoSnapshotPolicyResponse() 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 BindAutoSnapshotPolicy(self, request): """This API (BindAutoSnapshotPolicy) is used to bind the cloud disk to the specified scheduled snapshot policy. * For the scheduled snapshot policy limit of each region, see [Scheduled Snapshots](/document/product/362/8191). * When a cloud disk that is bound to a scheduled snapshot policy is in the unused state (that is, an elastic cloud disk has not been mounted or the server of an inelastic disk is powered off) scheduled snapshots are not created. :param request: Request instance for BindAutoSnapshotPolicy. :type request: :class:`tencentcloud.cbs.v20170312.models.BindAutoSnapshotPolicyRequest` :rtype: :class:`tencentcloud.cbs.v20170312.models.BindAutoSnapshotPolicyResponse` """ try: params = request._serialize() body = self.call("BindAutoSnapshotPolicy", params) response = json.loads(body) if "Error" not in response["Response"]: model = models.BindAutoSnapshotPolicyResponse() 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)