API |
説明 |
CreateBackup |
MySQLのバックアップを作成する |
DeleteBackup |
MySQLのバックアップを削除する |
DescribeBackupConfig |
MySQLのバックアップのコンフィグレーション情報を問い合わせする |
DescribeBackupDatabases |
バックアップデータベースリストを問い合わせする |
DescribeBackupTables |
指定したデータベースのバックアップデータテーブルを問い合わせする |
DescribeBackups |
バックアップログを問い合わせする |
DescribeBinlogs |
バイナリーログを問い合わせする |
DescribeSlowLogs |
スロークエリログを問い合わせする |
ModifyBackupConfig |
データベースのバックアップ構成を変更する |
CreateBackup MySQLのバックアップを作成します
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 MySQLのバックアップを削除します
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)
DescribeBackupConfig MySQLのバックアップのコンフィグレーション情報を問い合わせします
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)
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.InstanceId = "cdb-7ghaiocc"
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.InstanceId = "cdb-7ghaiocc"
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.DescribeBackupsRequest()
req.InstanceId = "cdb-7ghaiocc"
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.DescribeBinlogsRequest()
req.InstanceId = "cdb-7ghaiocc"
resp = client.DescribeBinlogs(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()
req.InstanceId = "cdb-7ghaiocc"
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)
この記事はお役に立ちましたか?