Recovery Services - Check Name Availability
用于检查资源名称可用性的 API。 如果不存在具有相同 SubscriptionId、资源名称和类型的其他资源,或者存在一个或多个此类资源,则名称可用,其中每个资源都必须是 GC'd,并且删除时间超过 24 小时前
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/locations/{location}/checkNameAvailability?api-version=2025-01-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
location
|
path | True |
string |
资源的位置 |
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
api-version
|
query | True |
string minLength: 1 |
要用于此作的 API 版本。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
name |
string |
需要检查其可用性的资源名称 |
type |
string |
描述资源类型:Microsoft.RecoveryServices/Vaults |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户。 |
示例
Availability status of Resource Name when no resource with same name, type and subscription exists, nor has been deleted within last 24 hours
示例请求
POST https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/resGroupFoo/providers/Microsoft.RecoveryServices/locations/westus/checkNameAvailability?api-version=2025-01-01
{
"name": "swaggerExample",
"type": "Microsoft.RecoveryServices/Vaults"
}
示例响应
{
"nameAvailable": true
}
Availability status of Resource Name when resource with same name, type and subscription exists
示例请求
POST https://management.azure.com/subscriptions/77777777-b0c6-47a2-b37c-d8e65a629c18/resourceGroups/resGroupBar/providers/Microsoft.RecoveryServices/locations/westus/checkNameAvailability?api-version=2025-01-01
{
"name": "swaggerExample2",
"type": "Microsoft.RecoveryServices/Vaults"
}
示例响应
{
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "Resource already exists with the same name."
}
定义
名称 | 说明 |
---|---|
Check |
资源名称可用性输入参数 - 资源类型和资源名称 |
Check |
检查名称可用性 API 的响应。 资源提供程序将可用性设置为 true |假。 |
Cloud |
CloudError |
Error |
资源管理错误响应。 |
Error |
资源管理错误附加信息。 |
CheckNameAvailabilityParameters
资源名称可用性输入参数 - 资源类型和资源名称
名称 | 类型 | 说明 |
---|---|---|
name |
string |
需要检查其可用性的资源名称 |
type |
string |
描述资源类型:Microsoft.RecoveryServices/Vaults |
CheckNameAvailabilityResult
检查名称可用性 API 的响应。 资源提供程序将可用性设置为 true |假。
名称 | 类型 | 说明 |
---|---|---|
message |
string |
|
nameAvailable |
boolean |
|
reason |
string |
CloudError
CloudError
名称 | 类型 | 说明 |
---|---|---|
error |
资源管理错误响应。 |
Error
资源管理错误响应。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
Error[] |
错误详细信息。 |
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |