API |
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 backup logs |
DescribeBinlogs |
Queries binary logs |
DescribeSlowLogs |
Queries slow logs |
ModifyBackupConfig |
Modifies the database backup configuration |
CreateBackup for Creating a TencentDB Instance Backup
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.CreateBackupRequest()
req.InstanceId = "cdb-7ghaiocc"
req.BackupMethod = "logical"
print req
resp = client.CreateBackup(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DeleteBackup for Deleting a TencentDB Instance Backup
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.DeleteBackupRequest()
req.InstanceId = "cdb-7ghaiocc"
req.BackupId = 105119782
resp = client.DeleteBackup(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.DescribeBackupConfigRequest()
req.InstanceId = "cdb-7ghaiocc"
print req
resp = client.DescribeBackupConfig(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBackups for Querying Backup Logs
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.DescribeBackupsRequest()
req.InstanceId = "cdb-7ghaiocc"
resp = client.DescribeBackups(req)
print resp
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBinlogs for Querying Binary Logs
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.DescribeBinlogsRequest()
req.InstanceId = "cdb-7ghaiocc"
resp = client.DescribeBinlogs(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeSlowLogs for Querying Slow Logs
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.DescribeSlowLogsRequest()
req.InstanceId = "cdb-7ghaiocc"
resp = client.DescribeSlowLogs(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
ModifyBackupConfig for Modifying the Database Backup Configuration
from tencentcloud.common import credential
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdb.v20170320 import cdb_client, models
try:
cred = credential.Credential("secretId", "secretKey")
client = cdb_client.CdbClient(cred, "ap-shanghai")
req = models.ModifyBackupConfigRequest()
req.InstanceId = "cdb-1y6g3zj8"
req.ExpireDays = 10
req.StartTime = "06:00-10:00"
req.BackupMethod = "logical"
print req
resp = client.ModifyBackupConfig(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
Was this page helpful?