Servers - Check Name Availability
Determina se è possibile creare una risorsa con il nome specificato.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability?api-version=2023-08-01
Parametri dell'URI
| Nome | In | Necessario | Tipo | Descrizione |
|---|---|---|---|---|
|
subscription
|
path | True |
string |
ID sottoscrizione che identifica una sottoscrizione di Azure. |
|
api-version
|
query | True |
string |
Versione dell'API da usare per la richiesta. |
Corpo della richiesta
| Nome | Necessario | Tipo | Descrizione |
|---|---|---|---|
| name | True |
string |
|
| type | True |
Risposte
| Nome | Tipo | Descrizione |
|---|---|---|
| 200 OK |
Completato correttamente il controllo della disponibilità. |
|
| Other Status Codes |
Risposte di errore:
|
Esempio
| Check for a server name that already exists |
| Check for a server name that is available |
| Check for a server name that is invalid |
Check for a server name that already exists
Esempio di richiesta
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/checkNameAvailability?api-version=2023-08-01
{
"name": "server1",
"type": "Microsoft.Sql/servers"
}
Risposta di esempio
{
"name": "server1",
"available": false,
"reason": "AlreadyExists",
"message": "Specified server name is already used"
}
Check for a server name that is available
Esempio di richiesta
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/checkNameAvailability?api-version=2023-08-01
{
"name": "server1",
"type": "Microsoft.Sql/servers"
}
Risposta di esempio
{
"name": "server1",
"available": true
}
Check for a server name that is invalid
Esempio di richiesta
POST https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/checkNameAvailability?api-version=2023-08-01
{
"name": "SERVER1",
"type": "Microsoft.Sql/servers"
}
Risposta di esempio
{
"name": "SERVER1",
"available": false,
"reason": "Invalid",
"message": "Specified server name contains unsupported characters or is too long. Server name must be no longer than 63 characters long, contain only lower-case characters or digits, cannot contain '.' or '_' characters and can't start or end with '-' character."
}
Definizioni
| Nome | Descrizione |
|---|---|
|
Check |
Codice motivo che spiega perché il nome non è disponibile. Se il nome è disponibile, non sarà definito. |
|
Check |
Richiesta di verificare se il nome specificato per una risorsa è disponibile. |
|
Check |
|
|
Check |
Risultato di un controllo di disponibilità del nome. |
|
Error |
Informazioni aggiuntive sull'errore di gestione delle risorse. |
|
Error |
Dettagli dell'errore. |
|
Error |
Risposta di errore |
CheckNameAvailabilityReason
Codice motivo che spiega perché il nome non è disponibile. Se il nome è disponibile, non sarà definito.
| Valore | Descrizione |
|---|---|
| Invalid | |
| AlreadyExists |
CheckNameAvailabilityRequest
Richiesta di verificare se il nome specificato per una risorsa è disponibile.
| Nome | Tipo | Descrizione |
|---|---|---|
| name |
string |
|
| type |
CheckNameAvailabilityResourceType
| Valore | Descrizione |
|---|---|
| Microsoft.Sql/servers |
CheckNameAvailabilityResponse
Risultato di un controllo di disponibilità del nome.
| Nome | Tipo | Descrizione |
|---|---|---|
| available |
boolean |
True se il nome è disponibile; in caso contrario, false. |
| message |
string |
Messaggio che spiega perché il nome non è disponibile. Se il nome è disponibile, non sarà definito. |
| name |
string |
Nome di cui è stata verificata la disponibilità. |
| reason |
Codice motivo che spiega perché il nome non è disponibile. Se il nome è disponibile, non sarà definito. |
ErrorAdditionalInfo
Informazioni aggiuntive sull'errore di gestione delle risorse.
| Nome | Tipo | Descrizione |
|---|---|---|
| info |
object |
Informazioni aggiuntive. |
| type |
string |
Tipo di informazioni aggiuntive. |
ErrorDetail
Dettagli dell'errore.
| Nome | Tipo | Descrizione |
|---|---|---|
| additionalInfo |
Informazioni aggiuntive sull'errore. |
|
| code |
string |
Codice di errore. |
| details |
Dettagli dell'errore. |
|
| message |
string |
Messaggio di errore. |
| target |
string |
Destinazione dell'errore. |
ErrorResponse
Risposta di errore
| Nome | Tipo | Descrizione |
|---|---|---|
| error |
Oggetto error. |