名前空間の承認規則。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Relay/namespaces/{namespaceName}/authorizationRules?api-version=2021-11-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
namespaceName
|
path |
True
|
string
|
名前空間名
|
resourceGroupName
|
path |
True
|
string
|
Azure サブスクリプション内のリソース グループの名前。
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure サブスクリプションを一意に識別するサブスクリプション資格情報。 サブスクリプション ID は、全ての修理依頼についてURI の一部を生じさせます。
|
api-version
|
query |
True
|
string
|
クライアント API バージョン。
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
RelayNameSpaceAuthorizationRuleListAll
Sample Request
GET https://management.azure.com/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Relay/namespaces/example-RelayNamespace-01/authorizationRules?api-version=2021-11-01
from azure.identity import DefaultAzureCredential
from azure.mgmt.relay import RelayAPI
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-relay
# USAGE
python relay_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 = RelayAPI(
credential=DefaultAzureCredential(),
subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff",
)
response = client.namespaces.list_authorization_rules(
resource_group_name="resourcegroup",
namespace_name="example-RelayNamespace-01",
)
for item in response:
print(item)
# x-ms-original-file: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleListAll.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 armrelay_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/relay/armrelay"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleListAll.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 := armrelay.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewNamespacesClient().NewListAuthorizationRulesPager("resourcegroup", "example-RelayNamespace-01", 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 = armrelay.AuthorizationRuleListResult{
// Value: []*armrelay.AuthorizationRule{
// {
// Name: to.Ptr("RootManageSharedAccessKey"),
// Type: to.Ptr("Microsoft.Relay/Namespaces/AuthorizationRules"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Relay/namespaces/example-RelayNamespace-01/AuthorizationRules/RootManageSharedAccessKey"),
// Properties: &armrelay.AuthorizationRuleProperties{
// Rights: []*armrelay.AccessRights{
// to.Ptr(armrelay.AccessRightsListen),
// to.Ptr(armrelay.AccessRightsManage),
// to.Ptr(armrelay.AccessRightsSend)},
// },
// },
// {
// Name: to.Ptr("example-RelayAuthRules-01"),
// Type: to.Ptr("Microsoft.Relay/Namespaces/AuthorizationRules"),
// ID: to.Ptr("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Relay/namespaces/example-RelayNamespace-01/AuthorizationRules/example-RelayAuthRules-01"),
// Properties: &armrelay.AuthorizationRuleProperties{
// Rights: []*armrelay.AccessRights{
// to.Ptr(armrelay.AccessRightsListen),
// to.Ptr(armrelay.AccessRightsSend)},
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Relay;
using Azure.ResourceManager.Relay.Models;
// Generated from example definition: specification/relay/resource-manager/Microsoft.Relay/stable/2021-11-01/examples/NameSpaces/RelayNameSpaceAuthorizationRuleListAll.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 RelayNamespaceResource created on azure
// for more information of creating RelayNamespaceResource, please refer to the document of RelayNamespaceResource
string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff";
string resourceGroupName = "resourcegroup";
string namespaceName = "example-RelayNamespace-01";
ResourceIdentifier relayNamespaceResourceId = RelayNamespaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, namespaceName);
RelayNamespaceResource relayNamespace = client.GetRelayNamespaceResource(relayNamespaceResourceId);
// get the collection of this RelayNamespaceAuthorizationRuleResource
RelayNamespaceAuthorizationRuleCollection collection = relayNamespace.GetRelayNamespaceAuthorizationRules();
// invoke the operation and iterate over the result
await foreach (RelayNamespaceAuthorizationRuleResource 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
RelayAuthorizationRuleData 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
Sample Response
{
"value": [
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Relay/namespaces/example-RelayNamespace-01/AuthorizationRules/RootManageSharedAccessKey",
"name": "RootManageSharedAccessKey",
"type": "Microsoft.Relay/Namespaces/AuthorizationRules",
"properties": {
"rights": [
"Listen",
"Manage",
"Send"
]
}
},
{
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/resourcegroup/providers/Microsoft.Relay/namespaces/example-RelayNamespace-01/AuthorizationRules/example-RelayAuthRules-01",
"name": "example-RelayAuthRules-01",
"type": "Microsoft.Relay/Namespaces/AuthorizationRules",
"properties": {
"rights": [
"Listen",
"Send"
]
}
}
]
}
定義
AccessRights
ルールに関連付けられている権限。
名前 |
型 |
説明 |
Listen
|
string
|
|
Manage
|
string
|
|
Send
|
string
|
|
AuthorizationRule
リスト承認規則操作の結果。
名前 |
型 |
説明 |
id
|
string
|
リソースの完全修飾リソース ID。 例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
location
|
string
|
リソースが保存されている地理的な場所
|
name
|
string
|
リソースの名前
|
properties.rights
|
AccessRights[]
|
ルールに関連付けられている権限。
|
systemData
|
systemData
|
このリソースに関連するシステム メタデータ。
|
type
|
string
|
リソースの型。 例: "Microsoft.EventHub/Namespaces" または "Microsoft.EventHub/Namespaces/EventHubs"
|
AuthorizationRuleListResult
リスト名前空間操作からの応答。
名前 |
型 |
説明 |
nextLink
|
string
|
次の結果セットにリンクします。 値に未完了の承認規則の一覧が含まれている場合は空ではありません。
|
value
|
AuthorizationRule[]
|
リスト承認規則操作の結果。
|
createdByType
リソースを作成した ID の種類。
名前 |
型 |
説明 |
Application
|
string
|
|
Key
|
string
|
|
ManagedIdentity
|
string
|
|
User
|
string
|
|
ErrorAdditionalInfo
リソース管理エラーの追加情報。
名前 |
型 |
説明 |
info
|
object
|
追加情報。
|
type
|
string
|
追加情報の種類。
|
ErrorDetail
エラーの詳細。
名前 |
型 |
説明 |
additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
code
|
string
|
エラー コード。
|
details
|
ErrorDetail[]
|
エラーの詳細です。
|
message
|
string
|
エラー メッセージ。
|
target
|
string
|
エラーのターゲット。
|
ErrorResponse
エラー応答
systemData
リソースの作成と最後の変更に関連するメタデータ。
名前 |
型 |
説明 |
createdAt
|
string
|
リソース作成のタイムスタンプ (UTC)。
|
createdBy
|
string
|
リソースを作成した ID。
|
createdByType
|
createdByType
|
リソースを作成した ID の種類。
|
lastModifiedAt
|
string
|
リソースの最終変更のタイムスタンプ (UTC)
|
lastModifiedBy
|
string
|
リソースを最後に変更した ID。
|
lastModifiedByType
|
createdByType
|
リソースを最後に変更した ID の種類。
|