問題描述
如何通過 API查看 Recovery Services Vaults(恢復(fù)保管庫(kù))的備份策略信息? 如備份中是否含有虛擬機(jī)的Disk。在Azure門戶中可以通過查看Backup Item查看 (Home --> Recovery Services Vaults --> Backup Items --> Backup Items)
問題回答
查看Azure的REST API 文檔氓润,可以通過 Backup Protected Items - List 接口來獲取信息:接口的功能為提供保管庫(kù)中備份的所有項(xiàng)的可分頁列表蜡歹。調(diào)用方式為:
中國(guó)區(qū)微軟云(China Azure)
GET https://management.chinacloudapi.cn/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}
/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems?api-version=2021-02-10
##如果需要攜帶參數(shù)
GET https://management.chinacloudapi.cn/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}
/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems?api-version=2021-02-10&$filter={$filter}&$skipToken={$skipToken}
國(guó)際版微軟云(Global Azure)
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}
/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems?api-version=2021-02-10
##如果需要攜帶參數(shù)
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}
/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems?api-version=2021-02-10&$filter={$filter}&$skipToken={$skipToken}
調(diào)用Backup Protected Items接口的返回JSON文件中屋厘,包含Extended Properties屬性(Azure IaasVM 備份的擴(kuò)展屬性)。此內(nèi)容中就包含了VM的備份項(xiàng)月而,如Disk信息汗洒。
如測(cè)試結(jié)果中的IsInclusionList值:
參考資料
Backup Protected Items - List:https://docs.microsoft.com/zh-cn/rest/api/backup/backup-protected-items/list#uri-parameters
Azure China developer guide:https://docs.azure.cn/en-us/articles/guidance/developerdifferences?toc=%2fguides%2fdeveloper%2ftoc.json#check-endpoints-in-azure
當(dāng)在復(fù)雜的環(huán)境中面臨問題,格物之道需:濁而靜之徐清父款,安以動(dòng)之徐生溢谤。 云中,恰是如此!
標(biāo)簽: 如備份中是否含有虛擬機(jī)的Disk, API查看 Recovery Services Vaults(恢復(fù)保管庫(kù))的備份策略信息, Azure REST API: