API |
설명 |
CreateBackup |
CDB 백업 생성 |
DeleteBackup |
CDB 백업 삭제 |
DescribeBackupConfig |
CDB 백업 설정 정보 조회 |
DescribeBackupDatabases |
백업 데이터베이스 리스트 조회 |
DescribeBackupTables |
지정 데이터베이스 백업 데이터 테이블 조회 |
DescribeBackups |
백업 로그 조회 |
DescribeBinlogs |
이진법 로그 조회 |
DescribeSlowLogs |
슬로우 쿼리 로그 조회 |
ModifyBackupConfig |
데이터베이스 백업 설정 수정 |
CreateBackup CDB 백업 생성
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.BackupMethod = "logical"
print req
resp = client.CreateBackup(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DeleteBackup CDB 백업 삭제
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.BackupId = 105119782
resp = client.DeleteBackup(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBackupConfig CDB 백업 설정 정보 조회
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.DescribeDBZoneConfigRequest()
print req
resp = client.DescribeDBZoneConfig(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBackupDatabases 백업 데이터베이스 리스트 조회
import logging
import traceback
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.DescribeBackupDatabasesRequest()
req.StartTime = "2018-08-02 15:19:19"
print req
resp = client.DescribeBackupDatabases(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
msg = traceback.format_exc()
print (msg)
DescribeBackupTables 지정 데이터베이스 백업 데이터 테이블 조회
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.DescribeBackupTablesRequest()
req.StartTime = "2018-08-02 15:19:19"
req.DatabaseName ="sissi"
resp = client.DescribeBackupTables(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBackups 백업 로그 조회
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.DescribeDBPriceRequest()
resp = client.DescribeBackups(req)
print resp
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeBinlogs 이진법 로그 조회
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.DescribeDBPriceRequest()
resp = client.DescribeDBInstances(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
DescribeSlowLogs 슬로우 쿼리 로그 조회
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()
resp = client.DescribeSlowLogs(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
ModifyBackupConfig 데이터베이스 백업 설정 수정
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)
문제 해결에 도움이 되었나요?