API för produktinmatning för containrar

API:et för produktinmatning är ett moderniserat API som förenar alla befintliga api:er för insändning i alla produkter på den kommersiella marknadsplatsen. Mer information om hur du kommer igång finns i API för produktinmatning.

Den här artikeln innehåller vägledning om hur du använder API:erna specifikt för containrar.

Hämta befintliga resurskonfigurationer

Hämta alla resurser i en specifik produkt i ett enda API-anrop.

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

Du kan hämta alla resurskonfigurationer i en specifik produkt med resurstypen "resource-tree" tillsammans med produktens hållbara ID. Den schemaversion som du anger används som högsta möjliga version för var och en av de tillämpliga resurserna för den begärda produkten.

Kommentar

Om du inte känner till produktens varaktiga ID kan du hämta produktresursen först genom att använda produktens externa ID i stället och köra. Mer information finns i Produkt-API: Metod 1: resursträd.

Exempel på GET-anrop:

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

Exempelsvar:

{
  "$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.
  {
     ...
  }]
}

Synkronisera privata målgrupper

För en liveprodukt kan uppdateringar till privata målgrupper i utkast-, förhandsversions- och livemiljöer utföras samtidigt utan att en publicering krävs. Du kan synkronisera den privata målgruppen med hjälp av resursen "price-and-availability-update-private-audiences" genom att ange vilka målgrupper du vill lägga till eller ta bort från en specifik plan. Detta synkroniserar utkast-, förhandsversions- och livemiljöerna så att de har samma privata målgruppsvärden. Du behöver inte ange den inskickade resursen när du synkroniserar den privata målgruppen.

Om du vill redigera utkastens målgrupper använder du resursen "price-and-availability-plan" och egenskapen "privateAudiences". Detta måste gå igenom det vanliga publiceringsflödet för att värdena ska anges i förhandsversion och live.

Viktigt!

Om din produkt stöder mer än en typ av identifierare för att konfigurera den privata målgruppen (till exempel både klient-ID:n och prenumerations-ID:n) måste du utföra en fullständig publicering om du anger en ny identifierartyp för första gången. Du kan inte synkronisera den privata målgruppen i det här fallet.

Exempelbegäran om att synkronisera konfigurationen av den privata målgruppen:

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"
        }
      ]
    }
  }
 ]
}

Konfigurera egenskaper

Definiera de kategorier och branscher som gäller för din containerprodukt, din appversion och juridiska kontrakt. Se till att ange fullständig och korrekt information om din produkt i resursen Egenskaper, så att den visas på rätt sätt och erbjuds till rätt uppsättning kunder. Mer information finns i Appsource-kategorier.

Exempel på att konfigurera egenskaper för begärandetext:

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"
        ]
      }
    }
 ]
}

Konfigurera lista

Den information som du anger via listning av resurser visas i Microsofts onlinebutiker för den kommersiella marknadsplatsen. Detta inkluderar beskrivningar av din produkt, skärmbilder och dina marknadsföringstillgångar.

Exempel på begärandetext som konfigurerar en lista:

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"
            }
          ]
        }
      }
    }
  ]
}

Konfigurera förhandsversion av målgrupp

Om din containerprodukt säljer via Microsoft Marketplace måste du definiera en förhandsversionspublik, via prenumerations-ID:t, som kan granska produktlistan innan den går live.

Exempel på begärandetext som konfigurerar förhandsversionspublik:

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"
       }
     ]
    }
  ]
}

Konfigurera en plan – teknisk konfiguration

Ange ett klustertilläggstypnamn i formatet "PublisherName.ApplicationName". Namnet ska vara unikt för alla dina erbjudanden och planer. Du kan inte ändra det här värdet när planen har publicerats till Förhandsversion. Mer information finns i Ange teknisk plankonfiguration för ett Kubernetes-programbaserat containererbjudande. Mer information finns i Tekniska tillgångar för Azure-container.

Exempel på begärandetext som konfigurerar en transaktionsbar teknisk konfiguration:

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"
        },
      ]
    },
  ]
}

Konfigurera en plan – pris och tillgänglighet

Exempel på begärandetext som konfigurerar en dold plan:

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"
    }
  ]
}

Containererbjudanden har stöd för olika faktureringsalternativ. Mer information om faktureringsmodeller som stöds finns i Licensieringsalternativ.

API-versioner och -uppdateringar

Uppdatering Vad har ändrats?
1-2024 Alla schemaslutpunkter har uppdaterats från product-ingestion.azureedge.net till schema.mp.microsoft.com

Nästa steg