Protection Intent - Validate
它将验证以下内容
- 保管库容量
- VM 已受到保护
- 传入属性的任何 VM 相关配置。
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection?api-version=2025-08-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
azure
|
path | True |
string |
要命中 Api 的 Azure 区域 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| properties |
string |
如果需要验证 VM(如 OS 类型等)的配置 |
| resourceId |
string |
ARM 虚拟机 ID |
| resourceType |
ProtectedItem 类型 - VM、SqlDataBase、AzureFileShare 等 |
|
| vaultId |
string |
恢复服务保管库的 ARM ID |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure作已成功完成。 |
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Validate Enable Protection on Azure Vm
示例请求
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.RecoveryServices/locations/southeastasia/backupPreValidateProtection?api-version=2025-08-01
{
"properties": "",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1",
"resourceType": "VM",
"vaultId": "/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault"
}
示例响应
{
"containerName": "iaasvmcontainer;iaasvmcontainerv2;arunaupgrade;upgrade1",
"errorCode": "VirtualMachineAlreadyProtected",
"errorMessage": "Virtual machine with same name and same resource group is already protected. Please select `Disable' choice above for backup and go to backup item corresponding to this VM in the vault",
"protectedItemName": "vm;iaasvmcontainerv2;arunaupgrade;upgrade1",
"recommendation": "Please do not enable protection again.",
"status": "Failed"
}
定义
| 名称 | 说明 |
|---|---|
|
Data |
此项表示的工作负荷类型。 |
|
Error |
Error Detail 类,用于封装 Code、Message 和 Recommendations。 |
|
Error |
错误响应 |
|
Pre |
用于验证是否可以在给定保管库和给定配置中的给定资源上启用备份的协定。 它将验证以下内容
|
|
Pre |
用于启用备份验证请求的响应协定 |
|
Validation |
验证状态 |
DataSourceType
此项表示的工作负荷类型。
| 值 | 说明 |
|---|---|
| Invalid | |
| VM | |
| FileFolder | |
| AzureSqlDb | |
| SQLDB | |
| Exchange | |
| Sharepoint | |
| VMwareVM | |
| SystemState | |
| Client | |
| GenericDataSource | |
| SQLDataBase | |
| AzureFileShare | |
| SAPHanaDatabase | |
| SAPAseDatabase | |
| SAPHanaDBInstance |
ErrorDetail
Error Detail 类,用于封装 Code、Message 和 Recommendations。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
与代码相关的错误消息。 |
| recommendations |
string[] |
建议字符串列表。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
PreValidateEnableBackupRequest
用于验证是否可以在给定保管库和给定配置中的给定资源上启用备份的协定。 它将验证以下内容
- 保管库容量
- VM 已受到保护
- 传入属性的任何 VM 相关配置。
| 名称 | 类型 | 说明 |
|---|---|---|
| properties |
string |
如果需要验证 VM(如 OS 类型等)的配置 |
| resourceId |
string |
ARM 虚拟机 ID |
| resourceType |
ProtectedItem 类型 - VM、SqlDataBase、AzureFileShare 等 |
|
| vaultId |
string |
恢复服务保管库的 ARM ID |
PreValidateEnableBackupResponse
用于启用备份验证请求的响应协定
| 名称 | 类型 | 说明 |
|---|---|---|
| containerName |
string |
指定特定于产品的容器名称。 例如 iaasvmcontainer;iaasvmcontainer;rgname;vmname。 门户需要此项 |
| errorCode |
string |
响应错误代码 |
| errorMessage |
string |
响应错误消息 |
| protectedItemName |
string |
指定特定于产品的 ds 名称。 例如 vm;iaasvmcontainer;rgname;vmname。 门户需要此项 |
| recommendation |
string |
针对用户的建议操作 |
| status |
验证状态 |
ValidationStatus
验证状态
| 值 | 说明 |
|---|---|
| Invalid | |
| Succeeded | |
| Failed |