适用于容器的产品引入 API
产品引入 API 是一种现代化 API,可跨所有商业市场产品统一所有现有提交 API。 有关如何 入门的详细信息,请参阅产品引入 API 。
本文提供有关如何专门用于容器的 API 的指导。
检索现有资源配置
在单个 API 调用中检索特定产品中的所有资源。
GET resource-tree/<product-durableID>?$version=<schema-version>
可以使用“资源树”资源类型以及产品的持久 ID 检索特定产品中的所有资源配置。 提供的架构版本用作所请求产品的每个适用资源的最大支持版本。
注意
如果不知道产品的持久 ID,可以改为使用产品的外部 ID 并运行来先检索产品资源。 若要了解详细信息,请参阅 产品 API:方法 1:资源树。
GET 调用示例:
示例响应:
{
"$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”资源同步专用受众。 这将同步草稿、预览和实时环境,使其具有相同的私人受众值。 同步专用受众时无需提供提交资源。
若要编辑草稿受众,请使用“价格和可用性计划”资源和“privateAudiences”属性。 这需要通过常规发布流,以便以预览和实时方式设置值。
重要
如果产品支持使用多种类型的标识符来配置专用受众(例如,租户 ID 和订阅 ID),则在首次提供新的标识符类型时必须执行完整发布。 在这种情况下,无法同步私人受众。
同步专用受众配置的示例请求:
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 市场销售,则需要通过订阅 ID 定义预览受众,他们可以在产品上市前查看产品列表。
配置预览受众的示例请求正文:
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 |