파트너 센터 API를 사용하여 특정 제품에 대해 국가/지역에서 사용할 수 있는 SKU 컬렉션을 가져올 수 있습니다.
필수 구성 요소
파트너 센터 인증에 설명된 대로 자격 증명. 이 시나리오는 독립 실행형 앱 및 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.
제품 식별자입니다.
C# (프로그래밍 언어)
제품에 대한 SKU 목록을 얻으려면 다음을 수행합니다.
인터페이스에서 SKU 속성을 선택하여 SKU에 사용 가능한 작업이 있는 인터페이스를 가져옵니다.
Get() 또는 GetAsync() 메서드를 호출하여 제품에 사용 가능한 SKU 컬렉션을 검색합니다.
(선택 사항) ByReservationScope() 메서드를 사용하여 예약 범위를 선택합니다.
(선택 사항) Get() 또는 GetAsync()호출하기 전에 ByTargetSegment() 메서드를 사용하여 대상 세그먼트별로 SKU를 필터링합니다.
IAggregatePartner partnerOperations;
string countryCode;
string productId;
string productIdForAzureReservation;
string targetSegment;
// Get the available SKUs.
var skus = partnerOperations.Products.ByCountry(countryCode).ById(productId).Skus.Get();
// Get the available SKUs, filtered by target segment.
var segmentSkus = partnerOperations.Products.ByCountry(countryCode).ById(productId).Skus.ByTargetSegment(targetSegment).Get();
// Get the skus for an Azure reservation product which are applicable to Microsoft Azure (MS-AZR-0145P) subscriptions only.
var skus = partnerOperations.Products.ByCountry(countryCode).ById(productIdForAzureReservation).Skus.Get();
// Get the skus for an Azure reservation product which are applicable to Azure plans only.
var skus = partnerOperations.Products.ByCountry(countryCode).ById(productIdForAzureReservation).Skus.ByReservationScope("AzurePlan").Get();
자바
파트너 센터 Java SDK 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 유지 관리하며 Microsoft에서 공식적으로 지원하지 않는 오픈 소스 프로젝트입니다. 커뮤니티로부터 도움을 받거나 문제가 발생할 경우 GitHub에서 문제를 제기할 수 있습니다.
제품에 대한 SKU 목록을 얻으려면 다음을 수행합니다.
인터페이스에서 getSkus 함수를 선택하여 SKU에 사용 가능한 작업이 있는 인터페이스를 가져옵니다.
get() 함수를 호출하여 제품에 사용 가능한 SKU 컬렉션을 검색합니다.
(선택 사항) byTargetSegment() 함수를 사용하여 get() 함수를 호출하기 전에 대상 세그먼트별로 SKU를 필터링합니다.
// IAggregatePartner partnerOperations;
// String countryCode;
// String productId;
// String targetSegment;
// Get the available SKUs.
ResourceCollection<Sku> skus = partnerOperations.getProducts().byCountry(countryCode).byId(productId).getSkus().get();
// Get the available SKUs, filtered by target segment.
var segmentSkus = partnerOperations.getProducts().byCountry(countryCode).byId(productId).getSkus().byTargetSegment(targetSegment).get();
PowerShell
파트너 센터 PowerShell 모듈 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 유지 관리하며 Microsoft에서 공식적으로 지원하지 않는 오픈 소스 프로젝트입니다. 커뮤니티로부터 도움을 받거나 문제가 발생할 경우 GitHub에서 문제를 제기할 수 있습니다.
제품에 대한 SKU 목록을 얻으려면 다음을 수행합니다.
Get-PartnerProductSku 명령을 실행합니다.
(선택 사항) Segment 매개 변수를 지정하여 SKU를 대상 세그먼트별로 필터링합니다.
# $productId
# $targetSegment
# Get the available SKUs.
Get-PartnerProductSku -ProductId $productId
# Get the available SKUs, filtered by target segment.
Get-PartnerProductSku -ProductId $productId -Segment $targetSegment
REST 요청
요청 구문
메서드 | 요청 URI |
---|---|
가져오기 | {baseURL}/v1/products/{product-id}/skus?country={country-code}&targetSegment={target-segment} HTTP/1.1 |
URI 매개 변수
다음 경로 및 쿼리 매개 변수를 사용하여 제품에 대한 SKU 목록을 가져옵니다.
이름 | 타입 | 필수 | 묘사 |
---|---|---|---|
제품 ID | 문자열 | 예 | 제품을 식별하는 문자열입니다. |
국가 코드 | 문자열 | 예 | 국가/지역 ID입니다. |
타겟 세그먼트 | 문자열 | 아니요 | 필터링에 사용되는 대상 세그먼트를 식별하는 문자열입니다. |
예약 범위 (reservationScope) | 문자열 | 아니요 | Azure Reservation 제품에 대한 SKU 목록을 쿼리할 때, AzurePlan에 적용될 수 있는 SKU 목록을 가져오기 위해 reservationScope=AzurePlan 를 지정하세요. Microsoft Azure(MS-AZR-0145P) 구독에 적용할 수 있는 Azure Reservation 제품에 대한 SKU 목록을 얻으려면 이 매개 변수를 제외합니다. |
요청 헤더
요청 본문
없음.
요청 예제
지정된 제품에 대한 SKU 목록을 가져옵니다.
GET http://api.partnercenter.microsoft.com/v1/products/DZH318Z0BPS6/skus?country=US HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 18b41adf-29b5-48eb-b14f-c9683a4e5b7d
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Azure Reservation 제품에 대한 SKU 목록을 가져옵니다. Microsoft Azure(MS-AZR-0145P) 구독이 아닌 Azure 플랜에 적용되는 SKU만 포함합니다.
GET http://api.partnercenter.microsoft.com/v1/products/DZH318Z0BQ5S/skus?country=US&reservationScope=AzurePlan HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 18b41adf-29b5-48eb-b14f-c9683a4e5b7d
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Azure Reservation 제품에 대한 SKU 목록을 가져옵니다. Azure 플랜이 아닌 Microsoft Azure(MS-AZR-0145P) 구독에 적용되는 SKU만 포함합니다.
GET http://api.partnercenter.microsoft.com/v1/products/DZH318Z0BQ5S/skus?country=US HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 18b41adf-29b5-48eb-b14f-c9683a4e5b7d
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
REST 응답
성공하면 응답 본문에는 SKU 리소스 컬렉션이 포함됩니다.
응답 성공 및 오류 코드
각 응답에는 성공 또는 실패 및 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽습니다. 전체 목록은 파트너 센터 오류 코드참조하세요.
이 메서드는 다음 오류 코드를 반환합니다.
HTTP 상태 코드 | 오류 코드 | 묘사 |
---|---|---|
403 | 400030 | 요청된 targetSegment에 대한 액세스는 허용되지 않습니다. |
404 | 400013 | 상위 제품을 찾을 수 없습니다. |
Azure VM 예약에 대한 응답 예제(Azure 플랜)
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd,aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 18b41adf-29b5-48eb-b14f-c9683a4e5b7d,18b41adf-29b5-48eb-b14f-c9683a4e5b7d
X-Locale: en-US,en-US
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcbWFtZW5kZVxkZXZcZHBzLXJwZVxSUEUuUGFydG5lci5TZXJ2aWNlLkNhdGFsb2dcV2ViQXBpc1xDYXRhbG9nU2VydmljZS5WMi5XZWJcdjFccHJvZHVjdHNcRFpIMzE4WjBCUTVTXHNrdXM=?=
X-Powered-By: ASP.NET
Date: Thu, 15 Mar 2018 21:06:03 GMT
Content-Length: 50917
{
"totalCount": 40,
"items": [
{
"id": "0001",
"productId": "DZH318Z0BQ5S",
"title": "Reserved VM Instance, Standard_ND12s, US West 2, 1 Year",
"description": "Reserved Virtual Machines Instance, Standard_ND12s, US West 2, 1 Year",
"minimumQuantity": 1,
"maximumQuantity": 999999999,
"isTrial": false,
"supportedBillingCycles": [
"one_time"
],
"purchasePrerequisites": [
"AzureSubscriptionRegistration",
"InventoryCheck"
],
"provisioningVariables": [
"Scope",
"SubscriptionId"
],
"dynamicAttributes": {
"armSkuName": "Standard_ND12s",
"cores": "12",
"ram": "224",
"skuDisplayName": "ND12",
"category": "GPU",
"armRegionName": "westus2",
"duration": "1Year",
"region": "US West 2",
"diskType": "Hdd"
},
"links": {
"availabilities": {
"uri": "/products/DZH318Z0BQ5S/skus/0001/availabilities?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/DZH318Z0BQ5S/skus/0001?country=US",
"method": "GET",
"headers": []
}
}
},
{
"id": "0002",
"productId": "DZH318Z0BQ5S",
"title": "Reserved VM Instance, Standard_ND6s, US West 2, 1 Year",
"description": "Reserved Virtual Machines Instance, Standard_ND6s, US West 2, 1 Year",
"minimumQuantity": 1,
"maximumQuantity": 999999999,
"isTrial": false,
"supportedBillingCycles": [
"one_time"
],
"purchasePrerequisites": [
"AzureSubscriptionRegistration",
"InventoryCheck"
],
"provisioningVariables": [
"Scope",
"SubscriptionId"
],
"dynamicAttributes": {
"armSkuName": "Standard_ND6s",
"cores": "6",
"ram": "112",
"skuDisplayName": "ND6",
"category": "GPU",
"armRegionName": "westus2",
"duration": "1Year",
"region": "US West 2",
"diskType": "Hdd"
},
"links": {
"availabilities": {
"uri": "/products/DZH318Z0BQ5S/skus/0002/availabilities?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/DZH318Z0BQ5S/skus/0002?country=US",
"method": "GET",
"headers": []
}
}
}
[...]
],
"links": {
"self": {
"uri": "/products/DZH318Z0BQ5S/skus?country=US",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}
새 상거래 라이선스 기반 서비스에 대한 응답 예제
메모
라이선스 기반 서비스에 대한 새로운 상거래 환경에는 많은 새로운 기능이 포함되며 모든 CSP(클라우드 솔루션 공급자)에서 사용할 수 있습니다. 자세한 내용은 새 상거래 환경 개요참조하세요.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/10.0
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd,aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 18b41adf-29b5-48eb-b14f-c9683a4e5b7d,18b41adf-29b5-48eb-b14f-c9683a4e5b7d
X-Locale: en-US,en-US
X-SourceFiles: =?UTF-8?B?QzpcVXNlcnNcbWFtZW5kZVxkZXZcZHBzLXJwZVxSUEUuUGFydG5lci5TZXJ2aWNlLkNhdGFsb2dcV2ViQXBpc1xDYXRhbG9nU2VydmljZS5WMi5XZWJcdjFccHJvZHVjdHNcRFpIMzE4WjBCUTVTXHNrdXM=?=
X-Powered-By: ASP.NET
Date: Thu, 15 Mar 2018 21:06:03 GMT
Content-Length: 50917
{
"totalCount": 40,
"items": [
{
{
"id": "0001",
"productId": "CFQ7TTC0LH18",
"title": "Microsoft 365 Business Basic",
"description": "Best for businesses that need professional email, cloud file storage, and online meetings & chat. Desktop versions of Office apps like Excel, Word, and PowerPoint not included. For businesses with up to 300 employees.",
"minimumQuantity": 1,
"maximumQuantity": 300,
"isTrial": false,
"supportedBillingCycles": [
"annual",
"monthly"
],
"purchasePrerequisites": [
"MicrosoftCloudAgreement"
],
"inventoryVariables": [],
"provisioningVariables": [],
"actions": [
"Refund"
],
"dynamicAttributes": {
"isMicrosoftProduct": true,
"hasConstraints": true,
"isAddon": false,
"prerequisiteSkus": [],
"isSoftwareAssuranceApplicable": false,
"upgradeTargetOffers": [
"CFQ7TTC0LDPB:0001",
"CFQ7TTC0LF8Q:0001"
…
],
"provisioningId": "3b555118-da6a-4418-894f-7df1e2096870",
"internal": false
},
"links": {
"availabilities": {
"uri": "/products/CFQ7TTC0LH18/skus/0001/availabilities?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/products/CFQ7TTC0LH18/skus/0001?country=US",
"method": "GET",
"headers": []
}
}
} [...]
],
"links": {
"self": {
"uri": "/products/DZH318Z0BQ5S/skus?country=US",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Collection"
}
}