ユーザーが対象となるアクセス権を持つリソースの子リソースを取得する
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/eligibleChildResources?api-version=2020-10-01
省略可能なパラメーターを含む:
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/eligibleChildResources?$filter={$filter}&api-version=2020-10-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
scope
|
path |
True
|
string
|
ロール管理ポリシーのスコープ。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
$filter
|
query |
|
string
|
操作に適用するフィルター。 型 = 'Subscription' のリソースのみをフィルター処理するには、$filter=resourceType+eq+'Subscription' を使用します。 $filter=resourceType+eq+'subscription'または+resourceType+eq+'resourcegroup' を使用して、種類が 'Subscription' または 'ResourceGroup' のリソースをフィルター処理します
|
応答
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
GetEligibleChildResourcesByScope
要求のサンプル
GET https://management.azure.com/providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/providers/Microsoft.Authorization/eligibleChildResources?$filter=resourceType+eq+'resourcegroup'&api-version=2020-10-01
/**
* Samples for EligibleChildResources Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/
* GetEligibleChildResourcesByScope.json
*/
/**
* Sample code: GetEligibleChildResourcesByScope.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getEligibleChildResourcesByScope(com.azure.resourcemanager.AzureResourceManager azure) {
azure.accessManagement().roleAssignments().manager().roleServiceClient().getEligibleChildResources().get(
"providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f",
"resourceType eq 'resourcegroup'", 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
package armauthorization_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/authorization/armauthorization/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/53b1affe357b3bfbb53721d0a2002382a046d3b0/specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json
func ExampleEligibleChildResourcesClient_NewGetPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armauthorization.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewEligibleChildResourcesClient().NewGetPager("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f", &armauthorization.EligibleChildResourcesClientGetOptions{Filter: to.Ptr("resourceType+eq+'resourcegroup'")})
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.EligibleChildResourcesListResult = armauthorization.EligibleChildResourcesListResult{
// Value: []*armauthorization.EligibleChildResource{
// {
// Name: to.Ptr("RG-1"),
// Type: to.Ptr("resourcegroup"),
// ID: to.Ptr("/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/resourceGroups/RG-1"),
// },
// {
// Name: to.Ptr("RG-2"),
// Type: to.Ptr("resourcegroup"),
// ID: to.Ptr("/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/resourceGroups/RG-2"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AuthorizationManagementClient } = require("@azure/arm-authorization");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get the child resources of a resource on which user has eligible access
*
* @summary Get the child resources of a resource on which user has eligible access
* x-ms-original-file: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json
*/
async function getEligibleChildResourcesByScope() {
const subscriptionId =
process.env["AUTHORIZATION_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const scope =
"providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f";
const filter = "resourceType+eq+'resourcegroup'";
const options = { filter };
const credential = new DefaultAzureCredential();
const client = new AuthorizationManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.eligibleChildResources.list(scope, options)) {
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
応答のサンプル
{
"value": [
{
"name": "RG-1",
"id": "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/resourceGroups/RG-1",
"type": "resourcegroup"
},
{
"name": "RG-2",
"id": "/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f/resourceGroups/RG-2",
"type": "resourcegroup"
}
]
}
定義
CloudError
サービスからのエラー応答。
CloudErrorBody
サービスからのエラー応答。
名前 |
型 |
説明 |
code
|
string
|
エラーの識別子。 コードは不変であり、プログラムによって使用されることを意図しています。
|
message
|
string
|
ユーザー インターフェイスでの表示に適したエラーを説明するメッセージ。
|
EligibleChildResource
対象となる子リソース
名前 |
型 |
説明 |
id
|
string
|
リソース スコープ ID。
|
name
|
string
|
リソースの名前。
|
type
|
string
|
リソースの種類。
|
EligibleChildResourcesListResult
対象となる子リソースの一覧操作の結果。