Share via


容器的產品擷取 API

產品擷取 API 是現代化 API,可統一所有商業市集產品的所有現有提交 API。 如需如何開始使用的詳細資訊,請參閱產品擷取 API

本文提供如何特別針對容器使用 API 的指引。

擷取現有的資源組態

在單一 API 呼叫中擷取特定產品中的所有資源。

GET resource-tree/<product-durableID>?$version=<schema-version>

您可以使用「資源樹狀結構」資源類型,以及產品的耐久標識符,擷取特定產品內的所有資源組態。 您提供的架構版本會作為所要求產品每個適用資源的最大支援版本。

注意

如果您不知道產品的耐久標識符,您可以改為使用產品的外部標識碼並執行,先擷取產品資源。 若要深入瞭解,請參閱 產品 API:方法 1:資源樹狀結構

範例 GET 呼叫

GET https://graph.microsoft.com/rp/product-ingestion/resource-tree/product/12345678-abcd-efgh-1234-12345678901?targetType="preview“&$version=2022-03-01-preview5

範例回應

{
  "$schema": "https://schema.mp.microsoft.com/schema/resource-tree/2022-03-01-preview2",
  "root": "product/12345678-abcd-efgh-1234-12345678901",
  "target": {
    "targetType": "preview"
  },
  "resources": [
  { 
    "$schema": "https://schema.mp.microsoft.com/schema/product/2022-03-01-preview3",
    "id": "product/12345678-abcd-efgh-1234-12345678901",
    "identity": {
      "externalID": "product_external_id_example"
    },
    "type": "azureContainer",
    "alias": "product_example"
  },
  { 
    "$schema": "https://schema.mp.microsoft.com/schema/commercial-marketplace-setup/2022-03-01-preview2",
    "id": "commercial-marketplace-setup/12345678-abcd-efgh-1234-12345678901",
    "product": "product/12345678-abcd-efgh-1234-12345678901",
    "sellThroughMicrosoft": true
  },
  {
    "$schema": "https://schema.mp.microsoft.com/schema/plan/2022-03-01-preview2",
    "id": "plan/12345678-abcd-efgh-1234-12345678901/98756328-04e9-55ae-9403-52b6c971a956
  ...
  }, 
     // The response would include all existing resources within this product.
  {
     ...
  }]
}

同步處理私人適用對象

針對實時產品,可以同時執行草稿、預覽和實時環境的私用物件更新,而不需要發佈。 您可以使用「price-and-availability-update-private-audiences」資源同步處理私人物件,方法是指定要從特定方案中新增或移除哪些物件。 這會同步草稿、預覽和實時環境,以擁有相同的私人物件值。 同步處理私人物件時,您不需要提供提交資源。

若要編輯草稿物件,請使用“price-and-availability-plan” 資源和 “privateAudiences” 屬性。 這需要經過一般發佈流程,才能在預覽和實時中設定值。

重要

如果您的產品支援多個識別碼類型來設定私人物件(例如,租使用者標識碼和訂用帳戶標識碼),則第一次提供新的標識符類型時,您必須執行完整發佈。 在此情況下,您無法同步處理私人物件。

同步私人物件設定的範例要求:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
  {
    "$schema": "https://schema.mp.microsoft.com/schema/price-and-availability-update-private-audiences/2022-03-01-preview3",
    "product": "product/12345678-abcd-efgh-1234-12345678901", // product durable ID
    "plan": "plan/12345678-abcd-efgh-1234-12345678901/7e70b11f-809e-4c45-ae2f-1fb3ceaca33b", //plan durable ID 
    "privateAudiences":
    {
      "add ":
      [
         {
   "type": "tenant",
           "id": " c0cab000-5c00-2ae9-acbe-f5f0bb264498 ",
           "label": "test 1"
         }
      ],
      "remove ":
      [
        {
    "type": "tenant",
           "id": " d1cab000-6c06-4ae9-acbe-b5f0bb264498 ",
           "label": "test 2"
        }
      ]
    }
  }
 ]
}

設定屬性

定義適用於容器產品、應用程式版本和法律合約的類別和產業。 請務必在 [屬性] 資源中提供您產品的完整和準確詳細數據,以便適當地顯示並提供給正確的客戶集合。 若要深入瞭解,請參閱 Appsource類別

設定屬性的範例要求本文:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
    {
      "$schema": "https://schema.mp.microsoft.com/schema/property/2022-03-01-preview5",
      "id": "property/a8b48be1-a630-41b5-b5a5-c2a9f7789922/public/main",
      "product": "product/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
      "kind": "azureContainer",
      "termsConditions": "standardMicrosoft",
      "categories": {
        "containers": [
          "container-apps",
   "container-images"
        ]
      }
    }
 ]
}

設定清單

透過清單資源提供的資訊會顯示在 Microsoft 商業市集在線商店中。 這包括產品的描述、螢幕快照和營銷資產。

設定清單的範例要求本文:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
    {
      "$schema": "https://schema.mp.microsoft.com/schema/listing/2022-03-01-preview5",
      "id": "listing/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b/public/main/default/en-us",
      "product": "product/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b",
      "kind": "azureContainer",
      "title": "ContainerCM0815",
      "description": "<div>This offer is in the early stages of development and not for general public consumption. Use is restricted to a limited audience, and has no commercial purpose beyond the testing for which it is intended.</div>",
      "searchResultSummary": "Container product",
      "shortDescription": "This offer is in the early stages of development and not for general public consumption",
      "privacyPolicyLink": "https://www.company.com/privacy",
      "generalLinks": [
 {
   "displayText": "Product link",
   "link": "https://www.company.com/mkt",
 }
      ],
      "globalSupportWebsite": "https://testprivacyurl.com",
      "governmentSupportWebsite": "https://testprivacyurl.com",
      "supportContact": {
        "name": "Support",
        "email": "support@company.com",
        "phone": "4255555555"
      },
      "engineeringContact": {
        "name": "Engineering",
        "email": "john@company.com",
        "phone": "4255555555"
      },
      "cloudSolutionProviderContact": {
        "name": "CSP",
        "email": "csp@company.com",
        "phone": "4255555555"
      },
      "languageID": "en-us"
    },
    {
      "$schema": "https://schema.mp.microsoft.com/schema/listing-asset/2022-03-01-preview5",
      "product": "product/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b",
      "kind": "azure",
      "listing": "listing/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b/public/main/default/en-us",
      "type": "azureLogoScreenshot",
      "languageID": "en-us",
      "description": "Image caption",
      "displayOrder": 0,
      "fileName": "test.png",
      "friendlyName": "test.png",
      "url": "https://company.com/12345/test.png"
    },
    {
      "$schema":  "https://schema.mp.microsoft.com/schema/listing-asset/2022-03-01-preview5",
      "product": "product/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b",
      "kind": "azure",
      "listing": "listing/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b/public/main/default/en-us",
      "type": "azureLogoLarge",
      "languageID": "en-us",
      "description": "",
      "displayOrder": 0,
      "fileName": "216x216.png",
      "friendlyName": "216x216.png",
      "url": "https://company.com/12345/216x216.png"
    },
    {
      "$schema": "https://schema.mp.microsoft.com/schema/listing-trailer/2022-03-01-preview5",
      "product": "product/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b",
      "kind": "azure",
      "listing": "listing/6d50c7bd-eb19-4d4c-b2f0-beb14aee084b/public/main/default/en-us",
      "streamingUrl": "https://www.youtube.com/watch?v=123",
      "assets": {
        "en-us": {
          "title": "Video",
          "imageList": [
            {
              "url": "https://company.com/12345/trailer.png"
            }
          ]
        }
      }
    }
  ]
}

設定預覽物件

如果您的容器產品透過 Microsoft 市集銷售,您必須透過訂用帳戶標識元定義預覽對象,他們可以在產品上市前檢閱您的產品清單。

設定預覽物件的範例要求本文:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
    {
      "$schema": "https://schema.mp.microsoft.com/schema/price-and-availability-offer/2022-03-01-preview3",
     "id": "price-and-availability-offer/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
     "product": "product/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
     "previewAudiences": [
       {
        "type": "subscription",
        "id": "c2d12fa0-c012-33b0-b0a0-c0a0a0011222",
        "label": "Test Subscription"
       }
     ]
    }
  ]
}

設定方案 - 技術設定

以 『PublisherName.ApplicationName』 格式提供叢集延伸模組類型名稱。 所有供應專案和方案的名稱都應該是唯一的。 一旦計劃發佈至預覽版,就無法修改此值。 若要深入瞭解,請參閱 設定 Kubernetes 應用程式型容器供應專案的計劃技術設定。 若要深入瞭解,請參閱 Azure 容器技術資產

設定可交易技術設定的範例要求本文:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
   {
      "$schema": "https://schema.mp.microsoft.com/schema/container-plan-technical-configuration/2022-03-01-preview3",
      "id": "container-plan-technical-configuration/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
      "product": "product/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
      "plan": "plan/a8b48be1-a630-41b5-b5a5-c2a9f7789922/4db792e6-8e10-439d-9db2-a0e98fa7e174",
      "payloadType": " cnab",
      "clusterExtensionType": " unique.extension.type",
      "cnabReferences": [
 {
          "tenantID": "421c00000-ac12-451e-b3ff-c5b469a13e2d",
          "subscriptionID": "537d2130-be25-451e-b3ff-c5b469a13e2d",
          "resourceGroupName": "TestResources",
          "registryName": "testregistry",
          "repositoryName": "containerrepo",
   "tag": "1.0.4",
          "digest": "sha256:000193bfefde1e9"
        },
      ]
    },
  ]
}

設定方案 - 價格和可用性

設定隱藏計劃的要求本文範例:

POST https://graph.microsoft.com/rp/product-ingestion/configure?$version=2022-03-01-preview2

{
  "$schema": "https://schema.mp.microsoft.com/schema/configure/2022-03-01-preview2"
  "resources": [
  {
      "$schema": "https://schema.mp.microsoft.com/schema/price-and-availability-plan/2022-03-01-preview4",
      "product": "product/a8b48be1-a630-41b5-b5a5-c2a9f7789922",
      "plan": "plan/a8b48be1-a630-41b5-b5a5-c2a9f7789922/0abbe45b-c405-4c08-bb14-ec485002084e",
      "visibility": "hidden",
      "audience": "public"
    }
  ]
}

容器供應專案支援各種計費選項。 若要深入瞭解支援的計費模型,請參閱 授權選項

API 版本和更新

更新 哪些變更了?
1-2024 所有架構端點已從 product-ingestion.azureedge.net 更新為 schema.mp.microsoft.com

下一步