Ad alanı adı kullanılabilirliğini denetleyin.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability?api-version=2024-01-01
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
subscriptionId
|
path |
True
|
string
|
Microsoft Azure aboneliğini benzersiz olarak tanımlayan abonelik kimlik bilgileri. Abonelik kimliği, her hizmet çağrısı için URI'nin bir parçasını oluşturur.
|
api-version
|
query |
True
|
string
|
İstemci API Sürümü.
|
İstek Gövdesi
Name |
Gerekli |
Tür |
Description |
name
|
True
|
string
|
Ad alanı adı kullanılabilirliğini denetlemek için ad
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
CheckNameAvailabilityResult
|
kullanılabilirliği denetle başarıyla döndürüldü.
|
Other Status Codes
|
ErrorResponse
|
İşlemin neden başarısız olduğunu açıklayan Eventhub hata yanıtı.
|
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow
Tür:
oauth2
Akış:
implicit
Yetkilendirme URL’si:
https://login.microsoftonline.com/common/oauth2/authorize
Kapsamlar
Name |
Description |
user_impersonation
|
kullanıcı hesabınızın kimliğine bürünme
|
Örnekler
NamespacesCheckNameAvailability
Örnek isteği
POST https://management.azure.com/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/providers/Microsoft.EventHub/checkNameAvailability?api-version=2024-01-01
{
"name": "sdk-Namespace-8458"
}
import com.azure.resourcemanager.eventhubs.models.CheckNameAvailabilityParameter;
/**
* Samples for Namespaces CheckNameAvailability.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/
* EHNameSpaceCheckNameAvailability.json
*/
/**
* Sample code: NamespacesCheckNameAvailability.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void namespacesCheckNameAvailability(com.azure.resourcemanager.AzureResourceManager azure) {
azure.eventHubs().manager().serviceClient().getNamespaces().checkNameAvailabilityWithResponse(
new CheckNameAvailabilityParameter().withName("sdk-Namespace-8458"), com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from typing import Any, IO, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.eventhub import EventHubManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-eventhub
# USAGE
python eh_name_space_check_name_availability.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = EventHubManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.check_name_availability(
parameters={"name": "sdk-Namespace-8458"},
)
print(response)
# x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armeventhub_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b574e2a41acda14a90ef237006e8bbdda2b63c63/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json
func ExampleNamespacesClient_CheckNameAvailability() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armeventhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewNamespacesClient().CheckNameAvailability(ctx, armeventhub.CheckNameAvailabilityParameter{
Name: to.Ptr("sdk-Namespace-8458"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CheckNameAvailabilityResult = armeventhub.CheckNameAvailabilityResult{
// Message: to.Ptr(""),
// NameAvailable: to.Ptr(true),
// Reason: to.Ptr(armeventhub.UnavailableReasonNone),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { EventHubManagementClient } = require("@azure/arm-eventhub");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Check the give Namespace name availability.
*
* @summary Check the give Namespace name availability.
* x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json
*/
async function namespacesCheckNameAvailability() {
const subscriptionId =
process.env["EVENTHUB_SUBSCRIPTION_ID"] || "5f750a97-50d9-4e36-8081-c9ee4c0210d4";
const parameters = {
name: "sdk-Namespace-8458",
};
const credential = new DefaultAzureCredential();
const client = new EventHubManagementClient(credential, subscriptionId);
const result = await client.namespaces.checkNameAvailability(parameters);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.EventHubs.Models;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.EventHubs;
// Generated from example definition: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json
// this example is just showing the usage of "Namespaces_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://video2.skills-academy.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "5f750a97-50d9-4e36-8081-c9ee4c0210d4";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation
EventHubsNameAvailabilityContent content = new EventHubsNameAvailabilityContent("sdk-Namespace-8458");
EventHubsNameAvailabilityResult result = await subscriptionResource.CheckEventHubsNamespaceNameAvailabilityAsync(content);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Örnek yanıt
{
"nameAvailable": true,
"reason": "None",
"message": ""
}
Tanımlar
CheckNameAvailabilityParameter
Ad alanı adı kullanılabilirlik işlemini denetlemek için sağlanan parametre
Name |
Tür |
Description |
name
|
string
|
Ad alanı adı kullanılabilirliğini denetlemek için ad
|
CheckNameAvailabilityResult
CheckNameAvailability işleminin sonucu
Name |
Tür |
Description |
message
|
string
|
Ad Alanı ile ilişkili nedenle ilgili ayrıntılı bilgiler.
|
nameAvailable
|
boolean
|
Ad Alanının kullanılabilir olduğunu belirten değer; Ad Alanı kullanılabilirse true; aksi takdirde false.
|
reason
|
UnavailableReason
|
Ad Alanının kullanılamama nedeni.
|
ErrorAdditionalInfo
Kaynak yönetimi hatası ek bilgileri.
Name |
Tür |
Description |
info
|
object
|
Ek bilgiler.
|
type
|
string
|
Ek bilgi türü.
|
ErrorDetail
Hata ayrıntısı.
Name |
Tür |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Hata ek bilgileri.
|
code
|
string
|
Hata kodu.
|
details
|
ErrorDetail[]
|
Hata ayrıntıları.
|
message
|
string
|
Hata iletisi.
|
target
|
string
|
Hata hedefi.
|
ErrorResponse
Hata yanıtı, Event Hub hizmetinin gelen isteği işleyemediğini gösterir. Nedeni hata iletisinde verilmiştir.
UnavailableReason
Hizmetin kullanılamama nedenini belirtir.
Name |
Tür |
Description |
InvalidName
|
string
|
|
NameInLockdown
|
string
|
|
NameInUse
|
string
|
|
None
|
string
|
|
SubscriptionIsDisabled
|
string
|
|
TooManyNamespaceInCurrentSubscription
|
string
|
|