查詢PolarDB執行個體備份策略。
介面說明
適用引擎
PolarDB MySQL 版
當前該介面僅針對特定客戶開放使用,如有需求,請到 DBS 客戶諮詢群(釘釘群號:35585947)申請使用。
相關功能文件
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
dbs:DescribeBackupPolicy |
get |
*All Resource
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionCode |
string |
否 |
備份集所在地域。 |
cn-beijing |
| InstanceName |
string |
否 |
PolarDB 執行個體 ID。 |
pc-2ze3nrr64c5**** |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回參數詳情。 |
||
| RequestId |
string |
請求 ID。 |
54A63B3B-AA10-1CC3-A6BB-6CCE98D19628 |
| Message |
string |
返回資訊。 |
instanceName can not be empty. |
| Data |
object |
備份策略詳情。 |
|
| PreferredBackupDate |
string |
基礎備份的備份週期,以一個 7 位數返回,從左到右每一位分別對應週一到週日,其中 1 代表備份,0 代表不進行備份。 |
1010101 |
| PreferredBackupWindowBegin |
string |
基礎備份視窗開始時間。 |
23:00Z |
| PreferredBackupWindow |
string |
基礎備份視窗。 |
23:00Z-24:00Z |
| BackupRetentionPeriod |
integer |
基礎備份保留時間,若開啟進階備份策略,則為一級備份策略中的最長保留時間。 |
7 |
| BackupRetentionPolicyOnClusterDeletion |
string |
已刪除執行個體的歸檔備份保留策略,返回值如下:
|
LATEST |
| HighFrequencyBakInterval |
integer |
高頻備份時間。例如 120 表示每兩小時備份一次,單位為分鐘。 |
120 |
| BackupPriority |
integer |
備庫備份的設定策略,返回值如下:
說明
該參數僅適用於 RDS SQL Server 執行個體,其他引擎返回值為 0。 |
0 |
| EnableLogBackup |
integer |
是否開啟日誌備份,返回值如下:
|
1 |
| LogBackupRetention |
integer |
日誌備份保留週期。 |
7 |
| LogBackupLocalRetentionNumber |
string |
本機日誌檔案保留個數。 |
10 |
| EnableBackup |
integer |
是否開啟備份。 |
1 |
| LocalLogRetentionSpace |
integer |
本機日誌最大空間使用率。 |
30 |
| HighSpaceUsageProtection |
string |
執行個體使用空間大於 80%,或者剩餘空間小於 5 GB 時,是否強制清理日誌:
|
Enable |
| Category |
string |
是否開啟秒級備份,返回值如下:
說明
該參數僅對 MySQL 生效。 |
Standard |
| IncBackupInterval |
integer |
高頻增量備份間隔。 |
-1 |
| EnableIncBackup |
integer |
是否開啟增量備份。 |
0 |
| BackupMethod |
string |
備份方式,返回值如下:
|
Physical |
| AdvanceLogPolicies |
array<object> |
日誌備份策略詳情。 |
|
|
object |
策略詳情。 |
||
| PolicyId |
string |
備份策略 ID。 |
dc13b153acc91141789122c23835**** |
| SrcType |
string |
備份策略源類型,傳回值如下:
|
level1 |
| SrcRegion |
string |
備份策略源地區。 |
cn-beijing |
| DestType |
string |
備份策略目標類型,傳回值如下:
|
level1 |
| DestRegion |
string |
備份策略目標地區。 |
cn-shanghai |
| EnableLogBackup |
integer |
預留參數,無需關注。 |
1 |
| LogRetentionType |
string |
記錄備份保留類型,傳回值如下:
|
delay |
| LogRetentionValue |
string |
記錄備份保留時間。 |
3 |
| FilterType |
string |
進階策略篩選類型,傳回值如下: crontab:周期調度 event:事件調度 |
crontab |
| FilterKey |
string |
調度類型,傳回值如下: dayOfWeek:按周調度 dayOfMonth:按月調度 dayOfYear:按年調度 backupInterval:固定間隔調度 說明 僅當 FilterType 為 crontab 時,返回該參數。 |
dayOfWeek |
| FilterValue |
string |
備份周期。 |
1,2,3,4,5,6,7 |
| AdvanceDataPolicies |
array<object> |
資料備份策略詳情。 |
|
|
object |
策略詳情。 |
||
| PolicyId |
string |
進階策略 ID。 |
71930ac2e9f15e41615e10627c****** |
| FilterType |
string |
進階策略篩選類型,傳回值如下:
|
crontab |
| FilterKey |
string |
調度類型,傳回值如下:
說明
僅當 FilterType 為 crontab 時,返回該參數。 |
dayOfWeek |
| FilterValue |
string |
備份周期。 |
1,2,3,4,5,6,7 |
| DumpAction |
string |
轉儲策略詳情,傳回值如下:
|
copy |
| RetentionType |
string |
備份組保留周期類型,傳回值如下:
|
delay |
| RetentionValue |
string |
到期天數。 |
7 |
| SrcType |
string |
備份策略源類型,傳回值如下:
|
db |
| SrcRegion |
string |
備份策略源地區。 |
cn-beijing |
| DestType |
string |
備份策略目標類型,傳回值如下:
|
level1 |
| DestRegion |
string |
備份策略目標地區。 |
cn-beijing |
| BakType |
string |
備份類型,傳回值如下:
|
F |
| AutoCreated |
boolean |
是否為系統自動產生的備份策略,傳回值如下:
|
true |
| StorageClass |
string |
資料存放區類型。 |
STANDARD |
| AdvanceIncPolicies |
array<object> |
進階策略篩選類型 Crontab - 週期排程 Event - 事件排程。 |
|
|
object |
|||
| PolicyId |
string |
進階策略 ID |
smp-l0bfdmlr4c*** |
| FilterType |
string |
進階策略篩選類型 Crontab - 周期調度 Event - 事件調度 |
crontab |
| FilterKey |
string |
調度類型,當前僅當 filterType 為 crontab 時有效 dayOfWeek - 按周調度 dayOfMonth - 按月調度 dayOfYear - 按年調度 backupInterval - 固定間隔調度 |
dayOfMonth |
| FilterValue |
string |
具體 Filter 的值 |
1 |
| DumpAction |
string |
轉儲策略 Copy - 複製 Move - 轉儲 |
Copy |
| RetentionType |
string |
保留周期類型 Never - 永不到期 Delay - 固定天數到期 |
delay |
| RetentionValue |
string |
到期天數 |
365 |
| SrcType |
string |
備份策略源類型 db - 資料庫 level1 - 一級備份 level2 - 二級備份 level2Cross - 二級跨地區備份 |
db |
| SrcRegion |
string |
備份策略源 region |
cn-hangzhou |
| DestType |
string |
備份策略目標類型 db - 資料庫 level1 - 一級備份 level2 - 二級備份 level2Cross - 二級跨地區備份 |
db |
| DestRegion |
string |
備份策略目標 region |
cn-hangzhou |
| BakType |
string |
備份類型 F - 全量 L 日誌 |
F |
| AutoCreated |
boolean |
是否系統自動產生 |
true |
| PreferredNextBackupTime |
string |
2025-07-08T16:05Z |
|
| EnablePitrProtection |
boolean |
||
| LogBackupLocalRetention |
integer |
7 |
|
| ColdRetention |
integer |
30 |
|
| ColdKeepPolicy |
integer |
1 |
|
| ColdKeepCount |
integer |
1 |
|
| ErrMessage |
string |
錯誤資訊。 |
The specified parameter %s value is not valid. |
| Code |
string |
狀態碼。 |
Success |
| Success |
string |
請求是否成功,返回值如下:
|
true |
| ErrCode |
string |
錯誤碼。 |
Success |
樣本
正常返回樣本
JSON格式
{
"RequestId": "54A63B3B-AA10-1CC3-A6BB-6CCE98D19628",
"Message": "instanceName can not be empty.",
"Data": {
"PreferredBackupDate": "1010101",
"PreferredBackupWindowBegin": "23:00Z",
"PreferredBackupWindow": "23:00Z-24:00Z",
"BackupRetentionPeriod": 7,
"BackupRetentionPolicyOnClusterDeletion": "LATEST",
"HighFrequencyBakInterval": 120,
"BackupPriority": 0,
"EnableLogBackup": 1,
"LogBackupRetention": 7,
"LogBackupLocalRetentionNumber": "10",
"EnableBackup": 1,
"LocalLogRetentionSpace": 30,
"HighSpaceUsageProtection": "Enable",
"Category": "Standard",
"IncBackupInterval": -1,
"EnableIncBackup": 0,
"BackupMethod": "Physical",
"AdvanceLogPolicies": [
{
"PolicyId": "dc13b153acc91141789122c23835****",
"SrcType": "level1",
"SrcRegion": "cn-beijing",
"DestType": "level1",
"DestRegion": "cn-shanghai",
"EnableLogBackup": 1,
"LogRetentionType": "delay",
"LogRetentionValue": "3",
"FilterType": "crontab",
"FilterKey": "dayOfWeek",
"FilterValue": "1,2,3,4,5,6,7"
}
],
"AdvanceDataPolicies": [
{
"PolicyId": "71930ac2e9f15e41615e10627c******",
"FilterType": "crontab",
"FilterKey": "dayOfWeek",
"FilterValue": "1,2,3,4,5,6,7",
"DumpAction": "copy",
"RetentionType": "delay",
"RetentionValue": "7",
"SrcType": "db",
"SrcRegion": "cn-beijing",
"DestType": "level1",
"DestRegion": "cn-beijing",
"BakType": "F",
"AutoCreated": true,
"StorageClass": "STANDARD"
}
],
"AdvanceIncPolicies": [
{
"PolicyId": "smp-l0bfdmlr4c***",
"FilterType": "crontab",
"FilterKey": "dayOfMonth",
"FilterValue": "1",
"DumpAction": "Copy",
"RetentionType": "delay",
"RetentionValue": "365",
"SrcType": "db",
"SrcRegion": "cn-hangzhou",
"DestType": "db",
"DestRegion": "cn-hangzhou",
"BakType": "F",
"AutoCreated": true
}
],
"PreferredNextBackupTime": "2025-07-08T16:05Z",
"EnablePitrProtection": false,
"LogBackupLocalRetention": 7,
"ColdRetention": 30,
"ColdKeepPolicy": 1,
"ColdKeepCount": 1
},
"ErrMessage": "The specified parameter %s value is not valid. ",
"Code": "Success",
"Success": "true",
"ErrCode": "Success"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 403 | Request.Forbidden | Have no Permissions |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。