Hiermee haalt u een lijst met autorisatieregels voor een naamruimte op.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules?api-version=2024-01-01
URI-parameters
Name |
In |
Vereist |
Type |
Description |
namespaceName
|
path |
True
|
string
|
De naam van de naamruimte
Regex-patroon: ^[a-zA-Z][a-zA-Z0-9-]{6,50}[a-zA-Z0-9]$
|
resourceGroupName
|
path |
True
|
string
|
Naam van de resourcegroep binnen het Azure-abonnement.
|
subscriptionId
|
path |
True
|
string
|
Abonnementsreferenties waarmee een Microsoft Azure-abonnement uniek wordt geïdentificeerd. De abonnements-id maakt deel uit van de URI voor elke service-aanroep.
|
api-version
|
query |
True
|
string
|
Client-API-versie.
|
Antwoorden
Name |
Type |
Description |
200 OK
|
AuthorizationRuleListResult
|
Naamruimte AuthorizationRule is geretourneerd.
|
Other Status Codes
|
ErrorResponse
|
Eventhub-foutreactie waarin wordt beschreven waarom de bewerking is mislukt.
|
Beveiliging
azure_auth
Azure Active Directory OAuth2-stroom
Type:
oauth2
Stroom:
implicit
Autorisatie-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiken
Name |
Description |
user_impersonation
|
Uw gebruikersaccount imiteren
|
Voorbeelden
ListAuthorizationRules
Voorbeeldaanvraag
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://learn.microsoft.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
Voorbeeldrespons
{
"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"
]
}
}
]
}
Definities
Name |
Description |
AccessRights
|
De rechten die zijn gekoppeld aan de regel.
|
AuthorizationRule
|
Eén item in een bewerking List of Get AuthorizationRule
|
AuthorizationRuleListResult
|
Het antwoord van de bewerking Lijstnaamruimte.
|
createdByType
|
Het type identiteit waarmee de resource is gemaakt.
|
ErrorAdditionalInfo
|
Aanvullende informatie over de resourcebeheerfout.
|
ErrorDetail
|
De foutdetails.
|
ErrorResponse
|
Foutreactie geeft aan dat de Event Hub-service de binnenkomende aanvraag niet kan verwerken. De reden wordt opgegeven in het foutbericht.
|
systemData
|
Metagegevens met betrekking tot het maken en laatste wijzigen van de resource.
|
AccessRights
De rechten die zijn gekoppeld aan de regel.
Name |
Type |
Description |
Listen
|
string
|
|
Manage
|
string
|
|
Send
|
string
|
|
AuthorizationRule
Eén item in een bewerking List of Get AuthorizationRule
Name |
Type |
Description |
id
|
string
|
Volledig gekwalificeerde resource-id voor de resource. Bijvoorbeeld - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
De geografische locatie waar de resource zich bevindt
|
name
|
string
|
De naam van de resource
|
properties.rights
|
AccessRights[]
|
De rechten die zijn gekoppeld aan de regel.
|
systemData
|
systemData
|
De systeemmetagegevens met betrekking tot deze resource.
|
type
|
string
|
Het type resource. Bijvoorbeeld 'Microsoft.EventHub/Namespaces' of 'Microsoft.EventHub/Namespaces/EventHubs'
|
AuthorizationRuleListResult
Het antwoord van de bewerking Lijstnaamruimte.
Name |
Type |
Description |
nextLink
|
string
|
Maak een koppeling naar de volgende set resultaten. Niet leeg als Waarde een onvolledige lijst met autorisatieregels bevat
|
value
|
AuthorizationRule[]
|
Resultaat van de bewerking Autorisatieregels weergeven.
|
createdByType
Het type identiteit waarmee de resource is gemaakt.
Name |
Type |
Description |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorAdditionalInfo
Aanvullende informatie over de resourcebeheerfout.
Name |
Type |
Description |
info
|
object
|
De aanvullende informatie.
|
type
|
string
|
Het type aanvullende informatie.
|
ErrorDetail
De foutdetails.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
De fout aanvullende informatie.
|
code
|
string
|
De foutcode.
|
details
|
ErrorDetail[]
|
De foutdetails.
|
message
|
string
|
Het foutbericht.
|
target
|
string
|
Het foutdoel.
|
ErrorResponse
Foutreactie geeft aan dat de Event Hub-service de binnenkomende aanvraag niet kan verwerken. De reden wordt opgegeven in het foutbericht.
Name |
Type |
Description |
error
|
ErrorDetail
|
Het foutobject.
|
systemData
Metagegevens met betrekking tot het maken en laatste wijzigen van de resource.
Name |
Type |
Description |
createdAt
|
string
|
De tijdstempel van het maken van resources (UTC).
|
createdBy
|
string
|
De identiteit die de resource heeft gemaakt.
|
createdByType
|
createdByType
|
Het type identiteit waarmee de resource is gemaakt.
|
lastModifiedAt
|
string
|
Het type identiteit dat de resource het laatst heeft gewijzigd.
|
lastModifiedBy
|
string
|
De identiteit die de resource het laatst heeft gewijzigd.
|
lastModifiedByType
|
createdByType
|
Het type identiteit dat de resource het laatst heeft gewijzigd.
|