Ad Alanı için yetkilendirme kurallarının listesini alır.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules?api-version=2024-01-01
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
namespaceName
|
path |
True
|
string
|
Ad alanı adı
Normal ifade deseni: ^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$
|
resourceGroupName
|
path |
True
|
string
|
Azure aboneliğindeki kaynak grubunun adı.
|
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ü.
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
AuthorizationRuleListResult
|
Namespace AuthorizationRule 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
ListAuthorizationRules
Örnek isteği
GET https://management.azure.com/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.EventHub/namespaces/sdk-Namespace-2702/authorizationRules?api-version=2024-01-01
/**
* Samples for Namespaces ListAuthorizationRules.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/
* EHNameSpaceAuthorizationRuleListAll.json
*/
/**
* Sample code: ListAuthorizationRules.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listAuthorizationRules(com.azure.resourcemanager.AzureResourceManager azure) {
azure.eventHubs().manager().serviceClient().getNamespaces().listAuthorizationRules("ArunMonocle",
"sdk-Namespace-2702", 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 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_authorization_rule_list_all.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.list_authorization_rules(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-2702",
)
for item in response:
print(item)
# x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.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/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/EHNameSpaceAuthorizationRuleListAll.json
func ExampleNamespacesClient_NewListAuthorizationRulesPager() {
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)
}
pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("ArunMonocle", "sdk-Namespace-2702", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.AuthorizationRuleListResult = armeventhub.AuthorizationRuleListResult{
// Value: []*armeventhub.AuthorizationRule{
// {
// Name: to.Ptr("RootManageSharedAccessKey"),
// Type: to.Ptr("Microsoft.EventHub/Namespaces/AuthorizationRules"),
// ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.EventHub/namespaces/sdk-Namespace-2702/AuthorizationRules?api-version=2017-04-01/RootManageSharedAccessKey"),
// Properties: &armeventhub.AuthorizationRuleProperties{
// Rights: []*armeventhub.AccessRights{
// to.Ptr(armeventhub.AccessRightsListen),
// to.Ptr(armeventhub.AccessRightsManage),
// to.Ptr(armeventhub.AccessRightsSend)},
// },
// },
// {
// Name: to.Ptr("sdk-Authrules-1746"),
// Type: to.Ptr("Microsoft.EventHub/Namespaces/AuthorizationRules"),
// ID: to.Ptr("/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.EventHub/namespaces/sdk-Namespace-2702/AuthorizationRules?api-version=2017-04-01/sdk-Authrules-1746"),
// Properties: &armeventhub.AuthorizationRuleProperties{
// Rights: []*armeventhub.AccessRights{
// to.Ptr(armeventhub.AccessRightsListen),
// to.Ptr(armeventhub.AccessRightsSend)},
// },
// }},
// }
}
}
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 Gets a list of authorization rules for a Namespace.
*
* @summary Gets a list of authorization rules for a Namespace.
* x-ms-original-file: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json
*/
async function listAuthorizationRules() {
const subscriptionId =
process.env["EVENTHUB_SUBSCRIPTION_ID"] || "5f750a97-50d9-4e36-8081-c9ee4c0210d4";
const resourceGroupName = process.env["EVENTHUB_RESOURCE_GROUP"] || "ArunMonocle";
const namespaceName = "sdk-Namespace-2702";
const credential = new DefaultAzureCredential();
const client = new EventHubManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.namespaces.listAuthorizationRules(
resourceGroupName,
namespaceName,
)) {
resArray.push(item);
}
console.log(resArray);
}
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.EventHubs;
// Generated from example definition: specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json
// this example is just showing the usage of "Namespaces_ListAuthorizationRules" 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 EventHubsNamespaceResource created on azure
// for more information of creating EventHubsNamespaceResource, please refer to the document of EventHubsNamespaceResource
string subscriptionId = "5f750a97-50d9-4e36-8081-c9ee4c0210d4";
string resourceGroupName = "ArunMonocle";
string namespaceName = "sdk-Namespace-2702";
ResourceIdentifier eventHubsNamespaceResourceId = EventHubsNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName);
EventHubsNamespaceResource eventHubsNamespace = client.GetEventHubsNamespaceResource(eventHubsNamespaceResourceId);
// get the collection of this EventHubsNamespaceAuthorizationRuleResource
EventHubsNamespaceAuthorizationRuleCollection collection = eventHubsNamespace.GetEventHubsNamespaceAuthorizationRules();
// invoke the operation and iterate over the result
await foreach (EventHubsNamespaceAuthorizationRuleResource item in collection.GetAllAsync())
{
// the variable item is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
EventHubsAuthorizationRuleData resourceData = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine($"Succeeded");
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
{
"value": [
{
"id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.EventHub/namespaces/sdk-Namespace-2702/AuthorizationRules?api-version=2017-04-01/RootManageSharedAccessKey",
"name": "RootManageSharedAccessKey",
"type": "Microsoft.EventHub/Namespaces/AuthorizationRules",
"properties": {
"rights": [
"Listen",
"Manage",
"Send"
]
}
},
{
"id": "/subscriptions/5f750a97-50d9-4e36-8081-c9ee4c0210d4/resourceGroups/ArunMonocle/providers/Microsoft.EventHub/namespaces/sdk-Namespace-2702/AuthorizationRules?api-version=2017-04-01/sdk-Authrules-1746",
"name": "sdk-Authrules-1746",
"type": "Microsoft.EventHub/Namespaces/AuthorizationRules",
"properties": {
"rights": [
"Listen",
"Send"
]
}
}
]
}
Tanımlar
AccessRights
Kuralla ilişkili haklar.
Name |
Tür |
Description |
Listen
|
string
|
|
Manage
|
string
|
|
Send
|
string
|
|
AuthorizationRule
List veya Get AuthorizationRule işlemindeki tek öğe
Name |
Tür |
Description |
id
|
string
|
Kaynağın tam kaynak kimliği. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
Kaynağın bulunduğu coğrafi konum
|
name
|
string
|
Kaynağın adı
|
properties.rights
|
AccessRights[]
|
Kuralla ilişkili haklar.
|
systemData
|
systemData
|
Bu kaynakla ilgili sistem meta verileri.
|
type
|
string
|
Kaynağın türü. Örneğin, "Microsoft.EventHub/Namespaces" veya "Microsoft.EventHub/Namespaces/EventHubs"
|
AuthorizationRuleListResult
Liste ad alanı işleminden gelen yanıt.
Name |
Tür |
Description |
nextLink
|
string
|
Sonraki sonuç kümesinin bağlantısı. Değer, Yetkilendirme Kurallarının tamamlanmamış bir listesini içeriyorsa boş değildir
|
value
|
AuthorizationRule[]
|
Yetkilendirme Kurallarını Listele işleminin sonucu.
|
createdByType
Kaynağı oluşturan kimliğin türü.
Name |
Tür |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
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.
systemData
Kaynağın oluşturulması ve son değiştirilmesiyle ilgili meta veriler.
Name |
Tür |
Description |
createdAt
|
string
|
Kaynak oluşturma (UTC) zaman damgası.
|
createdBy
|
string
|
Kaynağı oluşturan kimlik.
|
createdByType
|
createdByType
|
Kaynağı oluşturan kimliğin türü.
|
lastModifiedAt
|
string
|
Kaynağı en son değiştiren kimliğin türü.
|
lastModifiedBy
|
string
|
Kaynağı son değiştiren kimlik.
|
lastModifiedByType
|
createdByType
|
Kaynağı en son değiştiren kimliğin türü.
|