APIs | Description |
CreateBackup | Creates a TencentDB instance backup |
DeleteBackup | Deletes a TencentDB instance backup |
DescribeBackupConfig | Queries the configuration information of a TencentDB instance backup |
DescribeBackups | Queries the list of data backup files |
DescribeBinlogs | Queries binary logs |
DescribeSlowLogs | Queries slow logs |
ModifyBackupConfig | Modifies the database backup configuration |
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.CreateBackupRequest()req.InstanceId = "cdb-7ghaiocc"req.BackupMethod = "logical"print req# Call the API you want to access through the client object. You need to pass in the request object.resp = client.CreateBackup(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.DeleteBackupRequest()req.InstanceId = "cdb-7ghaiocc"#print req.BackupIdreq.BackupId = 105119782# Call the API you want to access through the client object. You need to pass in the request object.resp = client.DeleteBackup(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.DescribeBackupConfigRequest()req.InstanceId = "cdb-7ghaiocc"print req# Call the API you want to access through the client object. You need to pass in the request object.resp = client.DescribeBackupConfig(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.DescribeBackupsRequest()req.InstanceId = "cdb-7ghaiocc"# Call the API you want to access through the client object. You need to pass in the request object.resp = client.DescribeBackups(req)print resp# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.DescribeBinlogsRequest()req.InstanceId = "cdb-7ghaiocc"# Call the API you want to access through the client object. You need to pass in the request object.resp = client.DescribeBinlogs(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.DescribeSlowLogsRequest()req.InstanceId = "cdb-7ghaiocc"# Call the API you want to access through the client object. You need to pass in the request object.resp = client.DescribeSlowLogs(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
#!/usr/bin/python# -*- coding: utf-8 -*-# Import the TencentCloud API entry modulefrom tencentcloud.common import credentialfrom tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKExceptionfrom tencentcloud.cdb.v20170320 import cdb_client, modelstry:# Instantiate an authentication object. The Tencent Cloud account `secretId` and `secretKey` need to be passed in as the input parameterscred = credential.Credential("secretId", "secretKey")# Instantiate the client object to request the product (with TencentDB as an example)client = cdb_client.CdbClient(cred, "ap-shanghai")# Instantiate a request object: req = models.ModifyInstanceParamRequest()req = models.ModifyBackupConfigRequest()req.InstanceId = "cdb-1y6g3zj8"req.ExpireDays = 10req.StartTime = "06:00-10:00"req.BackupMethod = "logical"print req# Call the API you want to access through the client object. You need to pass in the request object.resp = client.ModifyBackupConfig(req)# The output is a string return packet in JSON formatprint(resp.to_json_string())except TencentCloudSDKException as err:print(err)
Was this page helpful?