取得產品清單(依國家/地區)

適用於:合作夥伴中心 |由 21Vianet 營運的合作夥伴中心 |美國政府適用的 Microsoft Cloud 合作夥伴中心

您可以使用下列方法來取得特定國家/地區中可用的產品集合。

必要條件

  • 認證,如合作夥伴中心驗證所述。 此案例支援使用獨立應用程式和 App+使用者認證進行驗證。

  • 國家/地區。

C#

若要取得產品清單:

  1. 使用 IAggregatePartner.Products 集合,使用 ByCountry() 方法來選取國家/地區。

  2. 使用 ByTargetView() 方法來選取目錄檢視。

  3. (選擇性)使用 ByReservationScope() 方法來選取保留範圍。

  4. (選擇性)使用 ByTargetSegment() 方法來選取目標區段。

  5. 呼叫 Get()GetAsync() 方法來傳回集合。

IAggregatePartner partnerOperations;

// Get the products for the specified catalog view.
ResourceCollection<Products> products = partnerOperations.Products.ByCountry("US").ByTargetView("MicrosoftAzure").Get();

// Get the products filtered by target view and target segment.
ResourceCollection<Products> products = partnerOperations.Products.ByCountry("US").ByTargetView("MicrosoftAzure").ByTargetSegment("commercial").Get();

// Get the products for Azure reservations which are applicable to Microsoft Azure (MS-AZR-0145P) subscriptions only.
ResourceCollection<Product> products = partnerOperations.Products.ByCountry("US").ByTargetView("AzureReservations").Get();

// Get the products for Azure reservations which are applicable to Azure plans only.
ResourceCollection<Product> products = partnerOperations.Products.ByCountry("US").ByTargetView("AzureReservations").ByReservationScope("AzurePlan").Get();

Java

合作夥伴中心 Java SDK 可用來管理合作夥伴中心資源。 它是由合作夥伴社群維護的開放原始碼專案,且 Microsoft 未正式支援。 如果您遇到問題,可以從社群取得協助在 GitHub 上提出問題

若要取得產品清單:

  1. 使用您的 IAggregatePartner.getProducts 函式,使用 byCountry() 函式來選取國家/地區。

  2. 使用 byTargetView() 函式選取目錄檢視。

  3. (選擇性)使用 byTargetSegment() 函式選取目標區段。

  4. 呼叫 get() 函式以傳回集合。

// IAggregatePartner partnerOperations;

// Get the products for the specified catalog view.
ResourceCollection<Products> products = partnerOperations.getProducts().byCountry("US").byTargetView("Azure").get();

// Get the products filtered by target view and target segment.
ResourceCollection<Products> products = partnerOperations.getProducts().byCountry("US").byTargetView("Azure").byTargetSegment("commercial").get();

PowerShell

合作夥伴中心 PowerShell 模組可用來管理合作夥伴中心資源。 它是由合作夥伴社群維護的開放原始碼專案,且 Microsoft 未正式支援。 如果您遇到問題,可以從社群取得協助在 GitHub 上提出問題

若要取得產品清單:

  1. 執行 Get-PartnerProduct 命令。

  2. 藉由指定 Catalog 參數來選取目錄。

  3. (選擇性)藉由指定 Segment 參數來 選取目標區段

Get-PartnerProduct -Catalog 'Azure' -Segment 'commercial'

REST 要求

要求語法

方法 要求 URI
GET {baseURL}/v1/products?country={country}&targetView={targetView}&targetSegment={targetSegment} HTTP/1.1

URI 參數

使用下列路徑和查詢參數來取得產品清單。

名稱 類型​​ 必要 描述
國家/地區 string Yes 國家/地區標識碼。
targetView string Yes 識別目錄的目標檢視。 支援的值為:

Azure,其中包含所有 Azure 專案

AzureReservations,其中包含所有 Azure 保留專案

AzureReservationsVM,其中包含所有虛擬機 (VM) 保留專案

AzureReservationsSQL,其中包含所有 SQL 保留專案

AzureReservationsCosmosDb,其中包含所有 Cosmos 資料庫保留專案

MicrosoftAzure,其中包含 Microsoft Azure 訂用帳戶的專案 (MS-AZR-0145P) 和 Azure 方案

OnlineServices,其中包含所有在線服務專案,例如傳統授權型服務和新的商務授權型服務。

軟體,其中包含所有軟體專案

SoftwareSUSELinux,其中包含所有軟體 SUSE Linux 專案

SoftwarePerpetual,其中包含所有永久軟體專案

SoftwareSubscriptions,其中包含所有軟體訂閱專案

SpecializedOffers,其中包含已提供給某些合作夥伴的特殊供應專案

MarketplaceSaaS,其中包含獨立軟體供應商發佈的所有商業市集供應專案(ISV)
targetSegment string No 識別目標區段。 不同目標對象的檢視。 支援的值為:

商業
教育
政府
公益性
reservationScope string No 查詢 Azure 保留的產品清單時,請指定 reservationScope=AzurePlan 以取得適用於 Azure 方案的產品清單。 排除此參數以取得適用於 Microsoft Azure(MS-AZR-0145P) 訂用帳戶的產品清單。

要求標頭

如需詳細資訊,請參閱合作夥伴中心 REST 標頭

要求本文

無。

要求範例

依國家/地區的產品

請遵循此範例,依國家/地區取得 Microsoft Azure(MS-AZR-0145P) 訂用帳戶和 Azure 方案的產品清單。

GET https://api.partnercenter.microsoft.com/v1/products?country=US&targetView=MicrosoftAzure HTTP/1.1
Authorization: Bearer
Accept: application/json
MS-RequestId: 031160b2-b0b0-4d40-b2b1-aaa9bb84211d
MS-CorrelationId: 7c1f6619-c176-4040-a88f-2c71f3ba4533

Azure VM 保留專案 (Azure 方案)

請遵循此範例,針對適用於 Azure 方案的 Azure VM 保留專案,依國家 /地區取得產品清單。

GET https://api.partnercenter.microsoft.com/v1/products?country=US&targetView=AzureAzureReservationsVM&reservationScope=AzurePlan HTTP/1.1
Authorization: Bearer
Accept: application/json
MS-RequestId: 031160b2-b0b0-4d40-b2b1-aaa9bb84211d
MS-CorrelationId: 7c1f6619-c176-4040-a88f-2c71f3ba4533

Microsoft Azure 的 Azure VM 保留專案 (MS-AZR-0145P) 訂用帳戶

遵循此範例,依國家/地區取得適用於 Microsoft Azure(MS-AZR-0145P) 訂用帳戶的 Azure VM 保留項目清單。

GET https://api.partnercenter.microsoft.com/v1/products?country=US&targetView=AzureReservationsVM HTTP/1.1
Authorization: Bearer
Accept: application/json
MS-RequestId: 031160b2-b0b0-4d40-b2b1-aaa9bb84211d
MS-CorrelationId: 7c1f6619-c176-4040-a88f-2c71f3ba4533

新的商務授權型服務

注意

授權型服務的新商務體驗包含許多新功能,可供所有 雲端解決方案提供者 (CSP) 使用。 如需詳細資訊,請參閱 新的商務體驗概觀

請遵循此範例,依國家/地區取得以新商務授權為基礎的服務產品清單,作為新商務體驗技術預覽的一部分。 新的商務授權型服務將會透過 OnlineServicesNCEID 和 displayNames 值來識別。 請參閱下面的回應範例。

GET https://api.partnercenter.microsoft.com/v1/products?country=US&targetView=OnlineServices HTTP/1.1
Authorization: Bearer
Accept: application/json
MS-RequestId: 031160b2-b0b0-4d40-b2b1-aaa9bb84211d
MS-CorrelationId: 7c1f6619-c176-4040-a88f-2c71f3ba4533

REST 回應

如果成功,回應本文會包含 Product 資源的集合

回應成功和錯誤碼

每個回應都隨附 HTTP 狀態碼,會指出成功與否以及其他的偵錯資訊。 請使用網路追蹤工具來讀取此錯誤碼、錯誤類型和其他參數。 如需完整清單,請參閱 合作夥伴中心錯誤碼

此方法會傳回下列錯誤碼:

HTTP 狀態碼 錯誤碼 描述
403 400030 不允許存取要求的 targetSegment。
403 400036 不允許存取要求的 targetView。

Azure VM 保留的回應範例 (Azure 方案)

{
    "totalCount": 19,
    "items": [
        {
            "id": "DZH318Z0BQ3Q",
            "title": "Virtual Machines DSv2 Series",
            "description": "Dsv2-series instances are the latest generation of D-series instances that will carry more powerful CPUs which are on average about 35% faster than D-series instances, and carry the same memory and disk configurations as the D-series. Dsv2-series instances are based on the latest generation 2.4 GHz Intel Xeon® E5-2673 v3 (Haswell) processor, and with Intel Turbo Boost Technology 2.0 can go to 3.2 GHz.",
            "productType": {
                "id": "Azure",
                "displayName": "Azure",
                "subType": {
                "id": "VirtualMachines",
                "displayName": "VirtualMachines"
                }
            },
            "isMicrosoftProduct": true,
            "publisherName": "Microsoft",
            "links": {
                "skus": {
                    "uri": "/products/DZH318Z0BQ3Q/skus?country=US",
                    "method": "GET",
                    "headers": []
                },
                "self": {
                    "uri": "/products/DZH318Z0BQ3Q?country=US",
                    "method": "GET",
                    "headers": []
                }
            }
        },
        ...
    ],
    "links": {
        "self": {
            "uri": "/products?country=US&targetView=Azure",
            "method": "GET",
            "headers": []
        }
    },
    "attributes": {
        "objectType": "Collection"
    }
}

新商務授權型服務的回應範例

注意

授權型服務的新商務體驗包含許多新功能,並可供所有 雲端解決方案提供者 (CSP) 使用。 如需詳細資訊,請參閱 新的商務體驗概觀

{
  "totalCount": 19,
  "items": [{
      "id": "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.",
      "productType": {
        "id": "OnlineServicesNCE",
        "displayName": "OnlineServicesNCE"
      },
      "isMicrosoftProduct": true,
      "publisherName": "Microsoft Corporation",
      "links": {
        "skus": {
          "uri": "/products/CFQ7TTC0LH18/skus?country=US",
          "method": "GET",
          "headers": []
        },
        "self": {
          "uri": "/products/CFQ7TTC0LH18?country=US",
          "method": "GET",
          "headers": []
        }
      }
    },
    ...
  ],
  "links": {
    "self": {
      "uri": "/products?country=US&targetView=OnlineServices",
      "method": "GET",
      "headers": []
    }
  },
  "attributes": {
    "objectType": "Collection"
  }
}