다음을 통해 공유


셀프 서비스 정책 목록 가져오기

엔터티에 대한 셀프 서비스 정책을 나타내는 리소스 컬렉션을 가져옵니다.

필수 구성 요소

  • 자격 증명(파트너 센터 인증에서 설명). 이 시나리오에서는 Application+User 자격 증명을 사용한 인증을 지원합니다.

C#

모든 셀프 서비스 정책 목록을 얻으려면 다음을 수행합니다.

  1. 엔터티 식별자를 사용하여 IAggregatePartner.With(IRequestContext) 메서드를 호출하여 정책에 대한 작업에 대한 인터페이스를 검색합니다.
// IAggregatePartner partnerOperations;

// All the operations executed on this partner operation instance will share the same correlation Id but will differ in request Id
IPartner scopedPartnerOperations = partnerOperations.With(RequestContextFactory.Instance.Create(Guid.NewGuid()));

// gets the self-serve policies
var SelfServePolicies = scopedPartnerOperations.SelfServePolicies.Get(customerIdAsEntity);

예제는 다음을 참조하세요.

  • 샘플: 콘솔 테스트 앱
  • 프로젝트: PartnerSDK.FeatureSamples
  • 클래스: GetSelfServePolicies.cs

REST 요청

요청 구문

방법 요청 URI
GET {baseURL}/v1/SelfServePolicy?entity_id={entity_id} HTTP/1.1

URI 매개 변수

다음 쿼리 매개 변수를 사용하여 고객 목록을 가져옵니다.

Name 형식 필수 Description
entity_id string Y 액세스를 요청하는 엔터티 식별자입니다. 고객의 테넌트 ID입니다.

요청 헤더

자세한 내용은 헤더를 참조하세요.

요청 본문

없음

요청 예제

GET https://api.partnercenter.microsoft.com/v1/SelfServePolicy?entity_id=0431a72c-7d8a-4393-b25e-ef63f5efb415 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 3705fc6d-4127-4a87-bdba-9658f73fe019
MS-CorrelationId: b12260fb-82de-4701-a25f-dcd367690645

REST 응답

성공하면 이 메서드는 응답 본문에 SelfServePolicy 리소스 컬렉션을 반환합니다.

응답 성공 및 오류 코드

각 응답에는 성공 또는 실패와 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽을 수 있습니다. 전체 목록은 오류 코드를 참조하세요.

응답 예제

HTTP/1.1 200 OK
Content-Length: 15650
Content-Type: application/json
MS-CorrelationId: b12260fb-82de-4701-a25f-dcd367690645
MS-RequestId: 3705fc6d-4127-4a87-bdba-9658f73fe019
Date: Fri, 20 Nov 2015 01:08:23 GMT

{
    "totalCount": 1,
    "items": [{
        "id": "634f6379-ad54-449b-9821-564f737158ab_0431a72c-7d8a-4393-b25e-ef63f5efb415",
        "selfServeEntity": {
            "selfServeEntityType": "customer",
            "tenantID": "0431a72c-7d8a-4393-b25e-ef63f5efb415"
        },
        "grantor": {
            "grantorType": "billToPartner",
            "tenantID": "634f6379-ad54-449b-9821-564f737158ab"
        },
        "permissions": [
            {
                "resource": "AzureReservedInstances",
                "action": "Purchase"
            },
            {
                "resource": "AzureSavingsPlan",
                "action": "Purchase"
            }
        ],
        "attributes": {
            "etag": "\"933523d1-3f63-4fc3-8789-5e21c02cdaed\"",
            "objectType": "SelfServePolicy"
        }
    }],
    "attributes": {
        "objectType": "Collection"
    }
}