사용자에게 적격 액세스 권한이 있는 리소스의 자식 리소스 가져오기
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 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
scope
|
path |
True
|
string
|
역할 관리 정책의 범위입니다.
|
api-version
|
query |
True
|
string
minLength: 1
|
이 작업에 사용할 API 버전입니다.
|
$filter
|
query |
|
string
|
작업에 적용할 필터입니다. $filter=resourceType+eq+'Subscription'을 사용하여 형식 = '구독'의 리소스만 필터링합니다. $filter=resourceType+eq+'subscription'+또는+resourceType+eq+'resourcegroup'을 사용하여 유형 = '구독' 또는 'ResourceGroup'의 리소스를 필터링합니다.
|
응답
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Authorization.Models;
using Azure.ResourceManager.Authorization;
// Generated from example definition: specification/authorization/resource-manager/Microsoft.Authorization/stable/2020-10-01/examples/GetEligibleChildResourcesByScope.json
// this example is just showing the usage of "EligibleChildResources_Get" 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);
// invoke the operation and iterate over the result
ResourceIdentifier scope = new ResourceIdentifier("providers/Microsoft.Subscription/subscriptions/dfa2a084-766f-4003-8ae1-c4aeb893a99f");
string filter = "resourceType+eq+'resourcegroup'";
await foreach (EligibleChildResource item in client.GetEligibleChildResourcesAsync(scope, filter: filter))
{
Console.WriteLine($"Succeeded: {item}");
}
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
샘플 응답
{
"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
Object
서비스의 오류 응답입니다.
CloudErrorBody
Object
서비스의 오류 응답입니다.
Name |
형식 |
Description |
code
|
string
|
오류의 식별자입니다. 코드는 고정적이며 프로그래밍 방식으로 사용할 수 있습니다.
|
message
|
string
|
사용자 인터페이스에 표시하기에 적합한 오류를 설명하는 메시지입니다.
|
EligibleChildResource
Object
적격 자식 리소스
Name |
형식 |
Description |
id
|
string
|
리소스 범위 ID입니다.
|
name
|
string
|
리소스 이름입니다.
|
type
|
string
|
리소스 종류입니다.
|
EligibleChildResourcesListResult
Object
적격 자식 리소스 목록 작업 결과입니다.
Name |
형식 |
Description |
nextLink
|
string
|
다음 결과 집합을 가져오는 데 사용할 URL입니다.
|
value
|
EligibleChildResource[]
|
적격 자식 리소스 목록입니다.
|