Location - Check Name Availability
檢查 Batch 帳戶名稱是否可在指定的區域中使用。
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability?api-version=2025-06-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
location
|
path | True |
string |
名稱檢查所需的區域。 |
|
subscription
|
path | True |
string (uuid) |
目標訂用帳戶的標識碼。 此值必須是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用於此作業的 API 版本。 |
要求本文
| 名稱 | 必要 | 類型 | Description |
|---|---|---|---|
| name | True |
string |
要檢查可用性的名稱 |
| type | True |
資源類型。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
要求已成功。 |
|
| Other Status Codes |
未預期的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
| 名稱 | Description |
|---|---|
| user_impersonation | 模擬您的用戶帳戶 |
範例
|
Location |
|
Location |
LocationCheckNameAvailability_AlreadyExists
範例要求
POST https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/providers/Microsoft.Batch/locations/japaneast/checkNameAvailability?api-version=2025-06-01
{
"name": "existingaccountname",
"type": "Microsoft.Batch/batchAccounts"
}
範例回覆
{
"message": "An account named 'existingaccountname' is already in use.",
"nameAvailable": false,
"reason": "AlreadyExists"
}
LocationCheckNameAvailability_Available
範例要求
POST https://management.azure.com/subscriptions/12345678-1234-1234-1234-123456789012/providers/Microsoft.Batch/locations/japaneast/checkNameAvailability?api-version=2025-06-01
{
"name": "newaccountname",
"type": "Microsoft.Batch/batchAccounts"
}
範例回覆
{
"nameAvailable": true
}
定義
| 名稱 | Description |
|---|---|
|
Check |
檢查名稱可用性要求的參數。 |
|
Check |
CheckNameAvailability 作業回應。 |
|
Cloud |
Batch 服務的錯誤回應。 |
|
Cloud |
Batch 服務的錯誤回應。 |
|
Name |
取得無法使用 Batch 帳戶名稱的原因。 只有在 NameAvailable 為 false 時,才會傳回 Reason 元素。 |
|
Resource |
這是請求列出操作的結果。 |
CheckNameAvailabilityParameters
檢查名稱可用性要求的參數。
| 名稱 | 類型 | Description |
|---|---|---|
| name |
string |
要檢查可用性的名稱 |
| type |
資源類型。 |
CheckNameAvailabilityResult
CheckNameAvailability 作業回應。
| 名稱 | 類型 | Description |
|---|---|---|
| message |
string |
取得錯誤訊息,以更詳細地說明 Reason 值。 |
| nameAvailable |
boolean |
取得布爾值,指出名稱是否可供您使用。 如果為 true,則會提供名稱。 如果為 false,則表示名稱已取得或無效,且無法使用。 |
| reason |
取得無法使用 Batch 帳戶名稱的原因。 只有在 NameAvailable 為 false 時,才會傳回 Reason 元素。 |
CloudError
Batch 服務的錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| error |
錯誤回應的主體。 |
CloudErrorBody
Batch 服務的錯誤回應。
| 名稱 | 類型 | Description |
|---|---|---|
| code |
string |
錯誤的識別碼。 程序代碼是不變的,而且是要以程序設計方式取用。 |
| details |
錯誤的其他詳細數據清單。 |
|
| message |
string |
描述錯誤的訊息,適用於在使用者介面中顯示。 |
| target |
string |
特定錯誤的目標。 例如,錯誤中的屬性名稱。 |
NameAvailabilityReason
取得無法使用 Batch 帳戶名稱的原因。 只有在 NameAvailable 為 false 時,才會傳回 Reason 元素。
| 值 | Description |
|---|---|
| Invalid |
要求的名稱無效。 |
| AlreadyExists |
要求的名稱已在使用中。 |
ResourceType
這是請求列出操作的結果。
| 值 | Description |
|---|---|
| Microsoft.Batch/batchAccounts |
Microsoft.Batch/batchAccounts 的資源類型 |