AWS Marketplace Catalog API exemples d'utilisation SDK pour Java 2.x - AWS SDK for Java 2.x

Les traductions sont fournies par des outils de traduction automatique. En cas de conflit entre le contenu d'une traduction et celui de la version originale en anglais, la version anglaise prévaudra.

AWS Marketplace Catalog API exemples d'utilisation SDK pour Java 2.x

Les exemples de code suivants vous montrent comment effectuer des actions et implémenter des scénarios courants à l'aide du AWS SDK for Java 2.x with AWS Marketplace Catalog API.

Les actions sont des extraits de code de programmes plus larges et doivent être exécutées dans leur contexte. Alors que les actions vous indiquent comment appeler des fonctions de service individuelles, vous pouvez les voir en contexte dans leurs scénarios associés et dans des exemples interservices.

Les Scénarios sont des exemples de code qui vous montrent comment accomplir une tâche spécifique en appelant plusieurs fonctions au sein d’un même service.

Chaque exemple inclut un lien vers GitHub, où vous pouvez trouver des instructions sur la façon de configurer et d'exécuter le code en contexte.

Produits AMI

L'exemple de code suivant montre comment ajouter une dimension à un AMI produit existant et mettre à jour les conditions tarifaires de l'offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "AddDimensions", "Entity": { "Identifier": "prod-1111111111111", "Type": "AmiProduct@1.0" }, "DetailsDocument": [ { "Key": "m7g.8xlarge", "Description": "m7g.8xlarge", "Name": "m7g.8xlarge", "Types": [ "Metered" ], "Unit": "Hrs" } ] }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "m5.large", "Price": "0.15" }, { "DimensionKey": "m7g.4xlarge", "Price": "0.45" }, { "DimensionKey": "m7g.2xlarge", "Price": "0.45" }, { "DimensionKey": "m7g.8xlarge", "Price": "0.55" } ] } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment ajouter une région dans laquelle un AMI produit est déployé.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-east-2", "us-west-2" ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un AMI produit public ou limité et une offre publique avec une tarification annuelle horaire. Cet exemple crée une norme ou une version personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "AmiProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Operating Systems" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Regions": [ "us-east-1" ] } }, { "ChangeType": "AddInstanceTypes", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "InstanceTypes": [ "t2.micro" ] } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Version": { "VersionTitle": "Test AMI Version1.0", "ReleaseNotes": "Test AMI Version" }, "DeliveryOptions": [ { "Details": { "AmiDeliveryOptionDetails": { "AmiSource": { "AmiId": "ami-11111111111111111", "AccessRoleArn": "arn:aws:iam::111111111111:role/AWSMarketplaceAmiIngestion", "UserName": "ec2-user", "OperatingSystemName": "AMAZONLINUX", "OperatingSystemVersion": "10.0.14393", "ScanningPort": 22 }, "UsageInstructions": "Test AMI Version", "RecommendedInstanceType": "t2.micro", "SecurityGroups": [ { "IpProtocol": "tcp", "IpRanges": [ "0.0.0.0/0" ], "FromPort": 10, "ToPort": 22 } ] } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "t2.micro", "Description": "t2.micro", "Name": "t2.micro", "Types": [ "Metered" ], "Unit": "Hrs" } ] }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with hourly-annual pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.15" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P365D" }, "RateCard": [ { "DimensionKey": "t2.micro", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un AMI produit public ou limité et une offre publique avec une tarification mensuelle horaire. Cet exemple crée une norme ou une version personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "AmiProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Operating Systems" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Regions": [ "us-east-1" ] } }, { "ChangeType": "AddInstanceTypes", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "InstanceTypes": [ "t2.micro" ] } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Version": { "VersionTitle": "Test AMI Version1.0", "ReleaseNotes": "Test AMI Version" }, "DeliveryOptions": [ { "Details": { "AmiDeliveryOptionDetails": { "AmiSource": { "AmiId": "ami-11111111111111111", "AccessRoleArn": "arn:aws:iam::111111111111:role/AWSMarketplaceAmiIngestion", "UserName": "ec2-user", "OperatingSystemName": "AMAZONLINUX", "OperatingSystemVersion": "10.0.14393", "ScanningPort": 22 }, "UsageInstructions": "Test AMI Version", "RecommendedInstanceType": "t2.micro", "SecurityGroups": [ { "IpProtocol": "tcp", "IpRanges": [ "0.0.0.0/0" ], "FromPort": 10, "ToPort": 22 } ] } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "t2.micro", "Description": "t2.micro", "Name": "t2.micro", "Types": [ "Metered" ], "Unit": "Hrs" } ] }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with hourly-monthly pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.15" } ] } ] }, { "Type": "RecurringPaymentTerm", "CurrencyCode": "USD", "BillingPeriod": "Monthly", "Price": "15.0" } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un AMI produit public ou limité et une offre publique avec une tarification horaire. Cet exemple crée une version standard ou personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "AmiProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Operating Systems" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Regions": [ "us-east-1" ] } }, { "ChangeType": "AddInstanceTypes", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "InstanceTypes": [ "t2.micro" ] } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Version": { "VersionTitle": "Test AMI Version1.0", "ReleaseNotes": "Test AMI Version" }, "DeliveryOptions": [ { "Details": { "AmiDeliveryOptionDetails": { "AmiSource": { "AmiId": "ami-11111111111111111", "AccessRoleArn": "arn:aws:iam::111111111111:role/AWSMarketplaceAmiIngestion", "UserName": "ec2-user", "OperatingSystemName": "AMAZONLINUX", "OperatingSystemVersion": "10.0.14393", "ScanningPort": 22 }, "UsageInstructions": "Test AMI Version", "RecommendedInstanceType": "t2.micro", "SecurityGroups": [ { "IpProtocol": "tcp", "IpRanges": [ "0.0.0.0/0" ], "FromPort": 10, "ToPort": 22 } ] } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "t2.micro", "Description": "t2.micro", "Name": "t2.micro", "Types": [ "Metered" ], "Unit": "Hrs" } ] }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with hourly pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.15" } ] } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une ébauche de AMI produit avec une ébauche d'offre publique.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "AmiProduct@1.0" }, "DetailsDocument": { "ProductTitle": "Sample product" } }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment restreindre une région dans laquelle un AMI produit est déployé.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-west-2" ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment limiter la visibilité du produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateVisibility", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "TargetVisibility": "Restricted" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment spécifier si les AMI actifs sont déployés dans de nouvelles régions conçues AWS pour prendre en charge les futures régions.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateFutureRegionSupport", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "FutureRegionSupport": { "SupportedRegions": [ "All" ] } } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Offres des partenaires de distribution

L'exemple de code suivant montre comment créer un brouillon CPPO pour n'importe quel type de produit afin de pouvoir le réviser en interne avant de le publier pour les acheteurs.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ResaleAuthorizationId": "11111111-1111-1111-1111-111111111111", "Name": "Test Offer", "Description": "Test product" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée de remplacement d'une autorisation de revente à partir d'un accord existant avec une tarification contractuelle.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateReplacementOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateReplacementOfferResaleAuth", "DetailsDocument": { "AgreementId": "agmt-1111111111111111111111111", "ResaleAuthorizationId": "resaleauthz-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "Name": "Test replacement offer for SaaSProduct using AWS Marketplace API Reference Codes", "Description": "Test private resale replacement offer with contract pricing for SaaSProduct" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "FixedUpfrontPricingTerm", "CurrencyCode": "USD", "Price": "0.0", "Duration": "P12M", "Grants": [ { "DimensionKey": "BasicService", "MaxQuantity": 2 } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementEndDate": "2024-01-30" } ] } }, { "ChangeType": "UpdatePaymentScheduleTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "PaymentScheduleTerm", "CurrencyCode": "USD", "Schedule": [ { "ChargeDate": "2024-01-01", "ChargeAmount": "0" } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOfferResaleAuth.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment répertorier tout ce qui CPPOs a été créé par un partenaire de distribution.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.List; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.core.document.Document; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; import software.amazon.awssdk.services.marketplacecatalog.model.EntitySummary; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; public class ListAllCppoOffers { /* * List all CPPOs created by a channel partner */ public static void main(String[] args) { List<String> cppoOfferIds = getAllCppoOfferIds(); ReferenceCodesUtils.formatOutput(cppoOfferIds); } public static List<String> getAllCppoOfferIds() { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); // get all offer entity ids List<String> entityIdList = new ArrayList<String>(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); for (EntitySummary entitySummary : listEntitiesResponse.entitySummaryList()) { entityIdList.add(entitySummary.entityId()); } while (listEntitiesResponse.nextToken() != null) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); for (EntitySummary entitySummary : listEntitiesResponse.entitySummaryList()) { entityIdList.add(entitySummary.entityId()); } } // filter for CPPO offers: ResaleAuthorizationId exists in Details List<String> cppoOfferIds = new ArrayList<String>(); for (String entityId : entityIdList) { DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(entityId) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); Document resaleAuthorizationDocument = describeEntityResponse.detailsDocument().asMap().get(ATTRIBUTE_RESALE_AUTHORIZATION_ID); String resaleAuthorizationId = resaleAuthorizationDocument != null ? resaleAuthorizationDocument.asString() : ""; if (!resaleAuthorizationId.isEmpty()) { cppoOfferIds.add(resaleAuthorizationId); } } return cppoOfferIds; } }
  • Pour API plus de détails, voir ListEntitiesla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment répertorier toutes les autorisations de revente partagées disponibles pour un partenaire de distribution.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.List; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; public class ListAllSharedResaleAuthorizations { /* * list all resale authorizations shared to an account */ public static void main(String[] args) { List<ListEntitiesResponse> responseList = getListEntityResponseList(); ReferenceCodesUtils.formatOutput(responseList); } public static List<ListEntitiesResponse> getListEntityResponseList() { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); List<ListEntitiesResponse> responseList = new ArrayList<ListEntitiesResponse>(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_RESALE_AUTHORIZATION) .maxResults(10) .ownershipType(OWNERSHIP_TYPE_SHARED) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); responseList.add(listEntitiesResponse); while (listEntitiesResponse.nextToken() != null) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_RESALE_AUTHORIZATION) .maxResults(10) .ownershipType(OWNERSHIP_TYPE_SHARED) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); responseList.add(listEntitiesResponse); } return responseList; } }
  • Pour API plus de détails, voir ListEntitiesla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier un acheteur CPPO et y ajouter un acheteurEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateCPPOoffer", "DetailsDocument": { "ResaleAuthorizationId":"resaleauthz-1111111111111", "Name": "Test Offer", "Description":"Test product" } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": ["222222222222"] } } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-07-31" } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P450D" } ] } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une CPPO autorisation de revente unique sur AMI des produits SaaS ou Container et comment mettre à jour la majoration tarifaire.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateCPPOoffer", "DetailsDocument": { "ResaleAuthorizationId":"resaleauthz-1111111111111", "Name": "Test Offer", "Description":"Test product" } }, { "ChangeType": "UpdateMarkup", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Percentage" : "5.0" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": ["222222222222"] } } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-07-31" } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P450D" } ] } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier un brouillon CPPO et mettre à jour la majoration de prix.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateCPPOoffer", "DetailsDocument": { "ResaleAuthorizationId":"resaleauthz-1111111111111", "Name": "Test Offer", "Description":"Test product" } }, { "ChangeType": "UpdateMarkup", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Percentage" : "5.0" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": ["222222222222"] } } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-07-31" } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P450D" } ] } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateCPPOoffer.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour la date d'expiration d'un CPPO afin de donner aux acheteurs plus de temps pour évaluer et accepter l'offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2025-07-31" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Produits de conteneur

L'exemple de code suivant montre comment créer un projet de produit conteneur avec un projet d'offre publique.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog":"AWSMarketplace", "changeSet":[ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "ContainerProduct@1.0" }, "DetailsDocument": { "ProductTitle": "Sample product" } }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un produit contenant limité avec une offre publique, une tarification contractuelle et une normeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "Entity": { "Type": "ContainerProduct@1.0" }, "DetailsDocument": {}, "ChangeName": "CreateProductChange" }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "ContainerProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "Categories": [ "Streaming solutions" ], "ProductTitle": "ContainerProduct", "AdditionalResources": [], "LongDescription": "Long description goes here", "SearchKeywords": [ "container streaming" ], "ShortDescription": "Description1", "Highlights": [ "Highlight 1", "Highlight 2" ], "SupportDescription": "No support available", "VideoUrls": [] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "ContainerProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "Cores", "Description": "Cores per cluster", "Name": "Cores", "Types": [ "Entitled" ], "Unit": "Units" } ] }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "ContainerProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } }, { "ChangeType": "AddRepositories", "Entity": { "Type": "ContainerProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "Repositories": [ { "RepositoryName": "uniquerepositoryname", "RepositoryType": "ECR" } ] } }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "ContainerProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" }, "ChangeName": "CreateOfferChange" }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "Constraints": { "MultipleDimensionSelection": "Disallowed", "QuantityConfiguration": "Disallowed" }, "RateCard": [ { "DimensionKey": "Cores", "Price": "0.25" } ] } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "No refunds" } ] } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Some container offer Name", "Description": "Some interesting container offer description" } }, { "ChangeType": "UpdateRenewalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "RenewalTerm" } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Entités

L'exemple de code suivant montre comment décrire toutes les entités en un seul appel.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.BatchDescribeEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.EntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.BatchDescribeEntitiesResponse; import software.amazon.awssdk.services.marketplacecatalog.model.EntityDetail; import software.amazon.awssdk.services.marketplacecatalog.model.BatchDescribeErrorDetail; import java.util.Arrays; import java.util.Map; public class BatchDescribeEntities { /* * BatchDescribe my entities in a single call and * check if it contains all the information I need to know about the entities. */ public static void main(String[] args) { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); BatchDescribeEntitiesRequest batchDescribeEntitiesRequest = BatchDescribeEntitiesRequest.builder() .entityRequestList(Arrays.asList( EntityRequest.builder() .catalog(AWS_MP_CATALOG).entityId(OFFER_ID) .build(), EntityRequest.builder() .catalog(AWS_MP_CATALOG).entityId(PRODUCT_ID) .build())) .build(); BatchDescribeEntitiesResponse batchDescribeEntitiesResponse = marketplaceCatalogClient.batchDescribeEntities(batchDescribeEntitiesRequest); // Reading the successful entities response Map<String, EntityDetail> entityDetailsMap = batchDescribeEntitiesResponse.entityDetails(); for (Map.Entry<String, EntityDetail> entry : entityDetailsMap.entrySet()) { System.out.println("EntityId: " + entry.getKey()); ReferenceCodesUtils.formatOutput(entry.getValue()); } // Logging the failed entities error details Map<String, BatchDescribeErrorDetail> entityErrorsMap = batchDescribeEntitiesResponse.errors(); for (Map.Entry<String, BatchDescribeErrorDetail> entry : entityErrorsMap.entrySet()) { System.out.println(String.format("EntityId: %s, ErrorCode: %s, ErrorMessage: %s", entry.getKey(), entry.getValue().errorCode(), entry.getValue().errorMessage())); } } }

L'exemple de code suivant montre comment répertorier et décrire toutes les offres associées à un produit.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.List; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; import software.amazon.awssdk.services.marketplacecatalog.model.EntitySummary; import software.amazon.awssdk.services.marketplacecatalog.model.EntityTypeFilters; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; import software.amazon.awssdk.services.marketplacecatalog.model.OfferFilters; import software.amazon.awssdk.services.marketplacecatalog.model.OfferProductIdFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferTargetingFilter; public class ListProductPrivateOffers { private static MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); /* * retrieve all private offer information related to a single product */ public static void main(String[] args) { List<EntitySummary> entitySummaryList = getEntitySummaryList(); // for each offer id, output the offer detail using DescribeEntity API for (EntitySummary entitySummary : entitySummaryList) { DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(entitySummary.entityId()) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); ReferenceCodesUtils.formatOutput(describeEntityResponse); } } public static List<EntitySummary> getEntitySummaryList() { // define list entities filters EntityTypeFilters entityTypeFilters = EntityTypeFilters.builder() .offerFilters(OfferFilters.builder() .targeting(OfferTargetingFilter.builder() .valueListWithStrings(OFFER_TARGETING_BUYERACCOUNTS) .build()) .productId(OfferProductIdFilter.builder() .valueList(PRODUCT_ID) .build()) .build()) .build(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER).maxResults(50) .entityTypeFilters(entityTypeFilters) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); // save all entitySummary of the results into entitySummaryList List<EntitySummary> entitySummaryList = new ArrayList<EntitySummary>(); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); while ( listEntitiesResponse.nextToken() != null && listEntitiesResponse.nextToken().length() > 0) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER).maxResults(50) .entityTypeFilters(entityTypeFilters) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); } return entitySummaryList; } }
  • Pour API plus de détails, consultez les rubriques suivantes dans AWS SDK for Java 2.x APIRéférence.

Offers

L'exemple de code suivant montre comment créer une dimension personnalisée pour un produit SaaS et créer une offre privée.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "AddDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": [ { "Types": [ "Entitled" ], "Description": "Custom Pricing 4 w/ terms and coverage to be defined in Private Offer", "Unit": "Units", "Key": "Custom4", "Name": "Custom Pricing 4" } ] }, { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111" }, "ChangeName": "CreateOfferChange" }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Private Test Offer - SaaS Contract Product", "Description": "Private Test Offer - SaaS Contract Product" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" }, "RateCard": [ { "DimensionKey": "Custom4", "Price": "300.0" } ], "Selector": { "Type": "Duration", "Value": "P36M" } } ] } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ], "ChangeSetName": "PrivateOfferWithCustomDimension" }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un projet d'offre privée pour un produit AMI ou un produit SaaS afin que vous puissiez le consulter en interne avant de le publier aux acheteurs.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "Test Private Offer" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec contrat et tarification au fur et à mesure pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with subscription pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "WorkloadSmall", "Price": "0.15" }, { "DimensionKey": "WorkloadMedium", "Price": "0.25" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "150" }, { "DimensionKey": "PremiumService", "Price": "300" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec une tarification contractuelle et un calendrier de paiement flexible pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with subscription pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "FixedUpfrontPricingTerm", "CurrencyCode": "USD", "Price": "0.0", "Grants": [ { "DimensionKey": "BasicService", "MaxQuantity": 1 }, { "DimensionKey": "PremiumService", "MaxQuantity": 1 } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P12M" } ] } }, { "ChangeType": "UpdatePaymentScheduleTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "PaymentScheduleTerm", "CurrencyCode": "USD", "Schedule": [ { "ChargeDate": "2024-01-01", "ChargeAmount": "200.00" }, { "ChargeDate": "2024-02-01", "ChargeAmount": "170.00" } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec des prix contractuels pour un produit Container.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for Container product using AWS Marketplace API Reference Code", "Description": "Test private offer for Container product with contract pricing using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "Constraints": { "MultipleDimensionSelection": "Disallowed", "QuantityConfiguration": "Disallowed" }, "RateCard": [ { "DimensionKey": "ReqPerHour", "Price": "0.25" } ] } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec des prix contractuels pour un AMI produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with hourly annual pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "ReadOnlyUsers", "Price": "220.00" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec une tarification annuelle horaire et un calendrier de paiement flexible pour un AMI produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with hourly annual pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.17" } ] } ] }, { "Type": "FixedUpfrontPricingTerm", "CurrencyCode": "USD", "Price": "0.0", "Duration": "P365D", "Grants": [ { "DimensionKey": "t2.micro", "MaxQuantity": 1 } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P650D" } ] } }, { "ChangeType": "UpdatePaymentScheduleTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "PaymentScheduleTerm", "CurrencyCode": "USD", "Schedule": [ { "ChargeDate": "2024-01-01", "ChargeAmount": "200.00" }, { "ChargeDate": "2024-02-01", "ChargeAmount": "170.00" } ] } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec une tarification annuelle horaire pour un AMI produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with hourly annual pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.17" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P365D" }, "RateCard": [ { "DimensionKey": "t2.micro", "Price": "220.00" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P650D" } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec une tarification horaire pour un AMI produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for AmiProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with hourly pricing for AmiProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2025-01-01" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "0.15" } ] } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P30D" } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec des tarifs d'abonnement pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with subscription pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "WorkloadSmall", "Price": "0.13" }, { "DimensionKey": "WorkloadMedium", "Price": "0.22" } ] } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P30D" } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée avec une tarification contractuelle échelonnée pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test private offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test private offer with subscription pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "120.00" }, { "DimensionKey": "PremiumService", "Price": "200.00" } ], "Constraints": { "MultipleDimensionSelection": "Disallowed", "QuantityConfiguration": "Disallowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre d'essai gratuite publique avec un tarif d'abonnement pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "prod-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public free trial offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test public free trial offer with subscription pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Free", "Terms": [ { "Type": "FreeTrialPricingTerm", "Duration": "P20D", "Grants": [ { "DimensionKey": "WorkloadSmall" }, { "DimensionKey": "WorkloadMedium" } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer une offre privée de remplacement à partir d'un accord existant avec une tarification contractuelle.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateReplacementOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateReplacementOffer", "DetailsDocument": { "AgreementId": "agmt-1111111111111111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "Name": "Test replacement offer for SaaSProduct using AWS Marketplace API Reference Codes", "Description": "Test private replacement offer with contract pricing for SaaSProduct" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "FixedUpfrontPricingTerm", "CurrencyCode": "USD", "Price": "0.0", "Grants": [ { "DimensionKey": "BasicService", "MaxQuantity": 2 } ] } ] } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementEndDate": "2024-01-30" } ] } }, { "ChangeType": "UpdatePaymentScheduleTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "PaymentScheduleTerm", "CurrencyCode": "USD", "Schedule": [ { "ChargeDate": "2024-01-01", "ChargeAmount": "0" } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateReplacementOffer.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment décrire une offre publique.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; public class DescribeEntity { /* * Describe my AMI or SaaS or Container product and check if it contains all the information I need to know about the product */ public static void main(String[] args) { String offerId = args.length > 0 ? args[0] : OFFER_ID; DescribeEntityResponse describeEntityResponse = getDescribeEntityResponse(offerId); ReferenceCodesUtils.formatOutput(describeEntityResponse); } public static DescribeEntityResponse getDescribeEntityResponse(String offerId) { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(offerId) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); return describeEntityResponse; } }
  • Pour API plus de détails, voir DescribeEntityla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment définir la date d'expiration d'une offre privée à une date antérieure afin que les acheteurs ne puissent plus voir l'offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2023-01-01" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment répertorier toutes les offres privées.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.List; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; import software.amazon.awssdk.services.marketplacecatalog.model.EntitySummary; import software.amazon.awssdk.services.marketplacecatalog.model.EntityTypeFilters; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; import software.amazon.awssdk.services.marketplacecatalog.model.OfferAvailabilityEndDateFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferAvailabilityEndDateFilterDateRange; import software.amazon.awssdk.services.marketplacecatalog.model.OfferBuyerAccountsFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferFilters; import software.amazon.awssdk.services.marketplacecatalog.model.OfferReleaseDateFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferReleaseDateFilterDateRange; import software.amazon.awssdk.services.marketplacecatalog.model.OfferTargetingFilter; public class ListAllPrivateOffers { /* * List all my private offers and sort or filter them by Offer Publish Date, Offer Expiry Date and Buyer IDs * * OfferTargetingFilter = BuyerAccounts (private offer); * OfferBuyerAccountsFilter: Buyer IDs filter * OfferAvailabilityEndDateFilter : Offer Expiry Date filter * OfferReleaseDateFilter : Offer Publish Date filter */ private static MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); public static void main(String[] args) { String offerReleaseDateAfterValue = "2023-01-01T23:59:59Z"; String offerAvailableEndDateAfterValue = "2040-12-24T23:59:59Z"; List<EntitySummary> entitySummaryList = getEntitySummaryList(offerReleaseDateAfterValue, offerAvailableEndDateAfterValue); // for each offer id, output the offer detail using DescribeEntity API for (EntitySummary entitySummary : entitySummaryList) { DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(entitySummary.entityId()) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); ReferenceCodesUtils.formatOutput(describeEntityResponse); } } public static List<EntitySummary> getEntitySummaryList (String offerReleaseDateAfterValue, String offerAvailableEndDateAfterValue) { EntityTypeFilters entityTypeFilters = EntityTypeFilters.builder() .offerFilters(OfferFilters.builder() .targeting(OfferTargetingFilter.builder() .valueListWithStrings(OFFER_TARGETING_BUYERACCOUNTS) .build()) .buyerAccounts(OfferBuyerAccountsFilter.builder() .wildCardValue(BUYER_ACCOUNT_ID) .build()) .availabilityEndDate(OfferAvailabilityEndDateFilter.builder() .dateRange(OfferAvailabilityEndDateFilterDateRange.builder() .afterValue(offerAvailableEndDateAfterValue).build()) .build()) .releaseDate(OfferReleaseDateFilter.builder() .dateRange(OfferReleaseDateFilterDateRange.builder() .afterValue(offerReleaseDateAfterValue) .build()) .build()) .build()) .build(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER).maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); List<EntitySummary> entitySummaryList = new ArrayList<EntitySummary>(); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); while ( listEntitiesResponse.nextToken() != null && listEntitiesResponse.nextToken().length() > 0) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); } return entitySummaryList; } }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment répertorier les offres publiques et privées publiées pour un identifiant de produit spécifique.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.List; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.EntitySummary; import software.amazon.awssdk.services.marketplacecatalog.model.EntityTypeFilters; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; import software.amazon.awssdk.services.marketplacecatalog.model.OfferFilters; import software.amazon.awssdk.services.marketplacecatalog.model.OfferProductIdFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferStateFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferTargetingFilter; public class ListProductPublicOrPrivateReleasedOffers { /* * List released Public/Private offers for a specific product id. * Example below is to list released public offers. * To change to released private offers, change OFFER_TARGETING_NONE (None) to OFFER_TARGETING_BUYERACCOUNTS(BuyerAccounts) */ public static void main(String[] args) { List<EntitySummary> entitySummaryList = getEntitySummaryLIst(); ReferenceCodesUtils.formatOutput(entitySummaryList); } public static List<EntitySummary> getEntitySummaryLIst() { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); // define list entities filters EntityTypeFilters entityTypeFilters = EntityTypeFilters.builder() .offerFilters(OfferFilters.builder() .targeting(OfferTargetingFilter.builder() .valueListWithStrings(OFFER_TARGETING_NONE) .build()) .state(OfferStateFilter.builder() .valueListWithStrings(OFFER_STATE_RELEASED) .build()) .productId(OfferProductIdFilter.builder() .valueList(PRODUCT_ID) .build()) .build()) .build(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); // save all entitySummary of the results into entitySummaryList List<EntitySummary> entitySummaryList = new ArrayList<EntitySummary>(); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); while ( listEntitiesResponse.nextToken() != null && listEntitiesResponse.nextToken().length() > 0) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); entitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); } return entitySummaryList; } }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour une offre afin d'appliquer un contrat avec une tarification au fur et à mesure.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "WorkloadSmall", "Price": "0.15" }, { "DimensionKey": "WorkloadMedium", "Price": "0.25" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "150" }, { "DimensionKey": "PremiumService", "Price": "300" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour une offre afin d'appliquer une tarification annuelle horaire.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "m5.large", "Price": "0.13" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P365D" }, "RateCard": [ { "DimensionKey": "m5.large", "Price": "20.03" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour une offre pour appliquer le ciblage à des régions géographiques spécifiques.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PositiveTargeting": { "CountryCodes": [ "US", "ES", "FR", "AU" ] } } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour le nom et la description d'une offre publique.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à EULA jour une offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Name": "New offer name", "Description": "New offer description" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour la date d'expiration d'une offre privée à une date future afin de donner aux acheteurs plus de temps pour évaluer et accepter l'offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2026-01-01" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour la durée d'essai gratuit d'une offre d'essai gratuite publique pour un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "FreeTrialPricingTerm", "Duration": "P21D", "Grants": [ { "DimensionKey": "WorkloadSmall" }, { "DimensionKey": "WorkloadMedium" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour la politique de remboursement d'une offre.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Updated refund policy description" } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Produits

L'exemple de code suivant montre comment décrire un produitAMI, SaaS ou Container et vérifier s'il contient toutes les informations que vous souhaitez connaître sur le produit.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; public class DescribeEntity { /* * Describe my AMI or SaaS or Container product and check if it contains all the information I need to know about the product */ public static void main(String[] args) { String offerId = args.length > 0 ? args[0] : OFFER_ID; DescribeEntityResponse describeEntityResponse = getDescribeEntityResponse(offerId); ReferenceCodesUtils.formatOutput(describeEntityResponse); } public static DescribeEntityResponse getDescribeEntityResponse(String offerId) { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(offerId) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); return describeEntityResponse; } }
  • Pour API plus de détails, voir DescribeEntityla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment répertorier tous les produitsAMI, qu'ils soient SaaS ou Container, ainsi que les offres publiques associées.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.EntitySummary; import software.amazon.awssdk.services.marketplacecatalog.model.EntityTypeFilters; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesRequest; import software.amazon.awssdk.services.marketplacecatalog.model.ListEntitiesResponse; import software.amazon.awssdk.services.marketplacecatalog.model.OfferFilters; import software.amazon.awssdk.services.marketplacecatalog.model.OfferProductIdFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferStateFilter; import software.amazon.awssdk.services.marketplacecatalog.model.OfferTargetingFilter; public class ListEntities { /* * List all my AMI or SaaS or Container products and associated public offers */ public static void main(String[] args) { Map<String, List<EntitySummary>> allProductsWithOffers = getAllProductsWithOffers(); ReferenceCodesUtils.formatOutput(allProductsWithOffers); } public static Map<String, List<EntitySummary>> getAllProductsWithOffers() { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); Map<String, List<EntitySummary>> allProductsWithOffers = new HashMap<String, List<EntitySummary>> (); // get all product entities List<EntitySummary> productEntityList = new ArrayList<EntitySummary>(); ListEntitiesRequest listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(PRODUCT_TYPE_AMI) .maxResults(10) .nextToken(null) .build(); ListEntitiesResponse listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); productEntityList.addAll(listEntitiesResponse.entitySummaryList()); while (listEntitiesResponse.nextToken() != null) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(PRODUCT_TYPE_AMI) .maxResults(10) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); productEntityList.addAll(listEntitiesResponse.entitySummaryList()); } // loop through each product entity and get the public released offers associated using product id filter for ( EntitySummary productEntitySummary : productEntityList) { EntityTypeFilters entityTypeFilters = EntityTypeFilters.builder() .offerFilters(OfferFilters.builder() .targeting(OfferTargetingFilter.builder() .valueListWithStrings(OFFER_TARGETING_NONE) .build()) .state(OfferStateFilter.builder() .valueListWithStrings(OFFER_STATE_RELEASED) .build()) .productId(OfferProductIdFilter.builder() .valueList(productEntitySummary.entityId()) .build()) .build()) .build(); listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(null) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); // save all entitySummary of the results into entitySummaryList List<EntitySummary> offerEntitySummaryList = new ArrayList<EntitySummary>(); offerEntitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); while ( listEntitiesResponse.nextToken() != null && listEntitiesResponse.nextToken().length() > 0) { listEntitiesRequest = ListEntitiesRequest.builder() .catalog(AWS_MP_CATALOG) .entityType(ENTITY_TYPE_OFFER) .maxResults(10) .entityTypeFilters(entityTypeFilters) .nextToken(listEntitiesResponse.nextToken()) .build(); listEntitiesResponse = marketplaceCatalogClient.listEntities(listEntitiesRequest); offerEntitySummaryList.addAll(listEntitiesResponse.entitySummaryList()); } // save final results into map; key = product id; value = offer entity summary list allProductsWithOffers.put(productEntitySummary.entityId(), offerEntitySummaryList); } return allProductsWithOffers; } }
  • Pour API plus de détails, consultez les rubriques suivantes dans AWS SDK for Java 2.x APIRéférence.

Autorisation de revente

L'exemple de code suivant montre comment créer un projet d'autorisation de revente pour n'importe quel type de produit afin que vous puissiez le consulter en interne avant de le publier auprès d'un partenaire de distribution.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment décrire une autorisation de revente.

SDKpour Java 2.x
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import static com.example.awsmarketplace.utils.ReferenceCodesConstants.*; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityRequest; import software.amazon.awssdk.services.marketplacecatalog.model.DescribeEntityResponse; public class DescribeEntity { /* * Describe my AMI or SaaS or Container product and check if it contains all the information I need to know about the product */ public static void main(String[] args) { String offerId = args.length > 0 ? args[0] : OFFER_ID; DescribeEntityResponse describeEntityResponse = getDescribeEntityResponse(offerId); ReferenceCodesUtils.formatOutput(describeEntityResponse); } public static DescribeEntityResponse getDescribeEntityResponse(String offerId) { MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); DescribeEntityRequest describeEntityRequest = DescribeEntityRequest.builder() .catalog(AWS_MP_CATALOG) .entityId(offerId) .build(); DescribeEntityResponse describeEntityResponse = marketplaceCatalogClient.describeEntity(describeEntityRequest); return describeEntityResponse; } }
  • Pour API plus de détails, voir DescribeEntityla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique avec une offre privée afin qu'un partenaire de distribution puisse l'utiliser pour créer une offre privée de partenaire de distribution (CPPO).

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "OffersMaxQuantity": 1 } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple avec une date d'expiration pour un AMI produit soumis à un prix annuel horaire afin qu'un partenaire de distribution puisse l'utiliser pour créer un. CPPO

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-05-31" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple avec une date d'expiration pour n'importe quel type de produit et comment ajouter une autorisation personnalisée EULA à envoyer à l'acheteur.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-05-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple avec une date d'expiration pour n'importe quel type de produit et comment ajouter la documentation du contrat de revendeur entre le ISV et le partenaire de distribution.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-05-31" } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] }, { "Type": "ResaleLegalTerm", "Documents": [ { "Type": "CustomResellerContract", "Url": "https://s3.amazonaws.com/aws-mp-standard-contracts/Standard-Contact-for-AWS-Marketplace-2022-07-14.pdf"} ] } ] } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple avec une date d'expiration pour n'importe quel type de produit et comment ajouter un compte acheteur spécifique pour la revente.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-05-31" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateBuyerTargetingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerTargetingTerm", "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente multi-usage sans date d'expiration pour un AMI produit avec un prix annuel horaire afin qu'un CP puisse l'utiliser pour créer un. CPPO

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple sans date d'expiration pour n'importe quel type de produit et comment ajouter une autorisation personnalisée EULA à envoyer à l'acheteur.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple sans date d'expiration pour n'importe quel type de produit et comment ajouter la documentation du contrat de revendeur entre le ISV et le partenaire de distribution.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] }, { "Type": "ResaleLegalTerm", "Documents": [ { "Type": "CustomResellerContract", "Url": "https://s3.amazonaws.com/aws-mp-standard-contracts/Standard-Contact-for-AWS-Marketplace-2022-07-14.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente à usage multiple sans date d'expiration pour n'importe quel type de produit et comment ajouter un compte acheteur spécifique pour la revente.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateBuyerTargetingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerTargetingTerm", "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique pour tout type de produit et ajouter un calendrier de paiement flexible.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleFixedUpfrontPricingTerm", "CurrencyCode": "USD", "Price": "0.00", "Duration": "P12M", "Grants": [ { "DimensionKey": "Users", "MaxQuantity": 10 } ] } ] } }, { "ChangeType": "UpdatePaymentScheduleTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ResalePaymentScheduleTerm", "CurrencyCode": "USD", "Schedule": [ { "ChargeDate": "2023-09-01", "ChargeAmount": "200.00" }, { "ChargeDate": "2023-12-01", "ChargeAmount": "250.00" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-06-30", "OffersMaxQuantity": 1 } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique pour tout type de produit et ajouter une autorisation personnalisée EULA à envoyer à l'acheteur.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "OffersMaxQuantity": 1 } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique pour n'importe quel type de produit et comment ajouter un compte acheteur spécifique pour la revente.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "OffersMaxQuantity": "1" } }, { "ChangeType": "UpdateBuyerTargetingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerTargetingTerm", "PositiveTargeting": { "BuyerAccounts": [ "111111111111" ] } } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique pour tout type de produit et ajouter de la documentation contractuelle entre le revendeur ISV et le partenaire de distribution.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "ReleaseResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "OffersMaxQuantity": 1 } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ResaleConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "t2.small", "Price": "150" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerLegalTerm", "Documents": [ { "Type": "CustomEula", "Url": "https://s3.amazonaws.com/sample-bucket/custom-eula.pdf" } ] } ] } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier une autorisation de revente unique pour tout type de produit et indiquer s'il s'agit d'un renouvellement.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateResaleAuthorization", "ChangeName": "ResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "ResellerAccountId": "111111111111" } }, { "ChangeType": "UpdateBuyerTargetingTerms", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "BuyerTargetingTerm", "PositiveTargeting": { "BuyerAccounts": [ "222222222222" ] } } ] } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "OffersMaxQuantity": 1 } }, { "ChangeType":"UpdateInformation", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "$ResaleAuthorization.Entity.Identifier" }, "DetailsDocument": { "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product", "PreExistingBuyerAgreement": { "AcquisitionChannel": "AwsMarketplace", "PricingModel": "Contract" } } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment restreindre l'autorisation de revente.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour le nom et la description d'une autorisation de revente à usage unique ou à usage multiple avant de publier, quel que soit le type de produit.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType":"UpdateInformation", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": { "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Produits SaaS

L'exemple de code suivant montre comment créer un brouillon de produit SaaS avec un brouillon d'offre publique.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog":"AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "SaaSProduct@1.0" }, "DetailsDocument": { "ProductTitle": "Sample product" } }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un produit SaaS public ou limité et une offre publique avec une tarification contractuelle. Cet exemple crée une norme ou une version personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "Entity": { "Type": "SaaSProduct@1.0" }, "ChangeName": "CreateProductChange", "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Data Catalogs" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "DeliveryOptions": [ { "Details": { "SaaSUrlDeliveryOptionDetails": { "FulfillmentUrl":"https://sample.amazonaws.com/sample-saas-fulfillment-url" } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "BasicService", "Description": "Basic Service", "Name": "Basic Service", "Types": [ "Entitled" ], "Unit": "Units" }, { "Key": "PremiumService", "Description": "Premium Service", "Name": "Premium Service", "Types": [ "Entitled" ], "Unit": "Units" } ] }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with contract pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P1M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "20" }, { "DimensionKey": "PremiumService", "Price": "25" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } }, { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "150" }, { "DimensionKey": "PremiumService", "Price": "300" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un produit SaaS public ou limité et une offre publique avec un contrat avec une tarification au fur et à mesure. Cet exemple crée une norme ou une version personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "Entity": { "Type": "SaaSProduct@1.0" }, "ChangeName": "CreateProductChange", "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Data Catalogs" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "DeliveryOptions": [ { "Details": { "SaaSUrlDeliveryOptionDetails": { "FulfillmentUrl":"https://sample.amazonaws.com/sample-saas-fulfillment-url" } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "BasicService", "Description": "Basic Service", "Name": "Basic Service", "Types": [ "Entitled" ], "Unit": "Units" }, { "Key": "PremiumService", "Description": "Premium Service", "Name": "Premium Service", "Types": [ "Entitled" ], "Unit": "Units" }, { "Key": "WorkloadSmall", "Description": "Workload: Per medium instance", "Name": "Workload: Per medium instance", "Types": [ "ExternallyMetered" ], "Unit": "Units" }, { "Key": "WorkloadMedium", "Description": "Workload: Per large instance", "Name": "Workload: Per large instance", "Types": [ "ExternallyMetered" ], "Unit": "Units" } ] }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with contract pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "WorkloadSmall", "Price": "0.15" }, { "DimensionKey": "WorkloadMedium", "Price": "0.25" } ] } ] }, { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "150" }, { "DimensionKey": "PremiumService", "Price": "300" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment créer un produit SaaS public ou limité et une offre publique avec des tarifs d'abonnement. Cet exemple crée une norme ou une version personnaliséeEULA.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "Entity": { "Type": "SaaSProduct@1.0" }, "ChangeName": "CreateProductChange", "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Data Catalogs" ], "LogoUrl": "https://s3.amazonaws.com/logos/sample.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": [ "111111111111", "222222222222" ] } } }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "DeliveryOptions": [ { "Details": { "SaaSUrlDeliveryOptionDetails": { "FulfillmentUrl":"https://sample.amazonaws.com/sample-saas-fulfillment-url" } } } ] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "WorkloadSmall", "Description": "Workload: Per medium instance", "Name": "Workload: Per medium instance", "Types": [ "ExternallyMetered" ], "Unit": "Units" }, { "Key": "WorkloadMedium", "Description": "Workload: Per large instance", "Name": "Workload: Per large instance", "Types": [ "ExternallyMetered" ], "Unit": "Units" } ] }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateOfferChange", "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "Test public offer for SaaSProduct using AWS Marketplace API Reference Code", "Description": "Test public offer with contract pricing for SaaSProduct using AWS Marketplace API Reference Code" } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Usage", "Terms": [ { "Type": "UsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "WorkloadSmall", "Price": "0.15" }, { "DimensionKey": "WorkloadMedium", "Price": "0.25" } ] } ] } ] } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Absolutely no refund, period." } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier un produit SaaS et l'offre publique associée. Le produit sera dans un état limité par défaut.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog":"AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "SaaSProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "ProductTitle": "Sample product", "ShortDescription": "Brief description", "LongDescription": "Detailed description", "Highlights": [ "Sample highlight" ], "SearchKeywords": [ "Sample keyword" ], "Categories": [ "Data Catalogs" ], "LogoUrl": "https://bucketname.s3.amazonaws.com/logo.png", "VideoUrls": [ "https://sample.amazonaws.com/awsmp-video-1" ], "AdditionalResources": [] } }, { "ChangeType": "AddDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": [ { "Key": "BasicService", "Description": "Basic Service", "Name": "Basic Service", "Types": [ "Entitled" ], "Unit": "Units" }, { "Key": "PremiumService", "Description": "Premium Service", "Name": "Premium Service", "Types": [ "Entitled" ], "Unit": "Units" } ] }, { "ChangeType": "AddDeliveryOptions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": { "DeliveryOptions": [ { "Details": { "SaaSUrlDeliveryOptionDetails": { "FulfillmentUrl": "https://www.aws.amazon.com/marketplace/management" } } } ] } }, { "ChangeType": "ReleaseProduct", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "$CreateProductChange.Entity.Identifier" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Name": "New Test Offer", "Description": "New offer description" } }, { "ChangeType": "UpdateLegalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "LegalTerm", "Documents": [ { "Type": "StandardEula", "Version": "2022-07-14" } ] } ] } }, { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Updated refund policy description" } ] } }, { "ChangeType": "UpdatePricingTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "PricingModel": "Contract", "Terms": [ { "Type": "ConfigurableUpfrontPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "Selector": { "Type": "Duration", "Value": "P1M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "20" }, { "DimensionKey": "PremiumService", "Price": "25" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } }, { "Selector": { "Type": "Duration", "Value": "P12M" }, "RateCard": [ { "DimensionKey": "BasicService", "Price": "150" }, { "DimensionKey": "PremiumService", "Price": "300" } ], "Constraints": { "MultipleDimensionSelection": "Allowed", "QuantityConfiguration": "Allowed" } } ] } ] } }, { "ChangeType": "UpdateRenewalTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "RenewalTerm" } ] } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment publier un produit SaaS et une offre publique associée à partir d'un brouillon existant. Le produit sera dans un état limité par défaut.

SDKpour Java 2.x
{ "Catalog":"AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateVisibility", "ChangeName": "CreateProductChange", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "TargetVisibility": "Public" } } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

L'exemple de code suivant montre comment mettre à jour les dimensions d'un produit AMI ou d'un produit SaaS.

SDKpour Java 2.x

Pour exécuter cet exemple, transmettez l'JSONensemble de modifications suivant RunChangesets dans Utilitaires pour démarrer un ensemble de modifications depuis la section Utilitaires.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateDimensions", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "prod-111111111111" }, "DetailsDocument": [ { "Key": "BasicService", "Types": [ "Entitled" ], "Name": "Some new name", "Description": "Some new description" } ] } ] }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.

Utilitaires

L'exemple de code suivant montre comment définir des utilitaires pour démarrer un ensemble de AWS Marketplace Catalog API modifications.

SDKpour Java 2.x

Utilitaire pour charger un ensemble de modifications à partir d'un JSON fichier et commencer à le traiter.

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package com.example.awsmarketplace.catalogapi; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; import software.amazon.awssdk.core.document.Document; import software.amazon.awssdk.http.apache.ApacheHttpClient; import software.amazon.awssdk.protocols.json.internal.unmarshall.document.DocumentUnmarshaller; import software.amazon.awssdk.protocols.jsoncore.JsonNodeParser; import software.amazon.awssdk.services.marketplacecatalog.MarketplaceCatalogClient; import software.amazon.awssdk.services.marketplacecatalog.model.Change; import software.amazon.awssdk.services.marketplacecatalog.model.Entity; import software.amazon.awssdk.services.marketplacecatalog.model.StartChangeSetRequest; import software.amazon.awssdk.services.marketplacecatalog.model.StartChangeSetResponse; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.ToNumberPolicy; import com.example.awsmarketplace.catalogapi.Entity.ChangeSet; import com.example.awsmarketplace.catalogapi.Entity.ChangeSetEntity; import com.example.awsmarketplace.catalogapi.Entity.Root; import com.example.awsmarketplace.utils.ReferenceCodesUtils; import com.example.awsmarketplace.utils.StringSerializer; /** * Before running this Java V2 code example, convert all Details attribute to DetailsDocument if any */ public class RunChangesets { private static final Gson GSON = new GsonBuilder() .setObjectToNumberStrategy(ToNumberPolicy.LAZILY_PARSED_NUMBER) .registerTypeAdapter(String.class, new StringSerializer()) .create(); public static void main(String[] args) { // input json can be specified here or passed from input parameter String inputChangeSetFile = "changeSets/offers/CreateReplacementOfferFromAGWithContractPricingDetailDocument.json"; if (args.length > 0) inputChangeSetFile = args[0]; // parse the input changeset file to string for process String changeSetsInput = readChangeSetToString(inputChangeSetFile); // process the changeset request try { StartChangeSetResponse result = getChangeSetRequestResult(changeSetsInput); ReferenceCodesUtils.formatOutput(result); } catch (Exception e) { e.printStackTrace(); } } public static StartChangeSetResponse getChangeSetRequestResult(String changeSetsInput) throws IOException { //set up AWS credentials MarketplaceCatalogClient marketplaceCatalogClient = MarketplaceCatalogClient.builder() .httpClient(ApacheHttpClient.builder().build()) .credentialsProvider(ProfileCredentialsProvider.create()) .build(); //changeset list to save all the changesets in the changesets file List<Change> changeSetLists = new ArrayList<Change>(); // read all changesets into object Root root = GSON.fromJson(changeSetsInput, Root.class); // process each changeset and add each changeset request to changesets list for (ChangeSet cs : root.changeSet) { ChangeSetEntity entity = cs.Entity; String entityType = entity.Type; String entityIdentifier = StringUtils.defaultIfBlank(entity.Identifier, null); Document detailsDocument = getDocumentFromObject(cs.DetailsDocument); Entity awsEntity = Entity.builder() .type(entityType) .identifier(entityIdentifier) .build(); Change inputChangeRequest = Change.builder() .changeType(cs.ChangeType) .changeName(cs.ChangeName) .entity(awsEntity) .detailsDocument(detailsDocument) .build(); changeSetLists.add(inputChangeRequest); } // process all changeset requests StartChangeSetRequest startChangeSetRequest = StartChangeSetRequest.builder() .catalog(root.catalog) .changeSet(changeSetLists) .build(); StartChangeSetResponse result = marketplaceCatalogClient.startChangeSet(startChangeSetRequest); return result; } public static Document getDocumentFromObject(Object detailsObject) { String detailsString = "{}"; try { detailsString = IOUtils.toString(new ByteArrayInputStream(GSON.toJson(detailsObject).getBytes()), "UTF-8"); } catch (IOException e) { e.printStackTrace(); } JsonNodeParser jsonNodeParser = JsonNodeParser.create(); Document doc = jsonNodeParser.parse(detailsString).visit(new DocumentUnmarshaller()); return doc; } public static String readChangeSetToString (String inputChangeSetFile) { InputStream changesetInputStream = RunChangesets.class.getClassLoader().getResourceAsStream(inputChangeSetFile); String changeSetsInput = null; try { changeSetsInput = IOUtils.toString(changesetInputStream, "UTF-8"); } catch (IOException e) { e.printStackTrace(); } return changeSetsInput; } }
  • Pour API plus de détails, voir StartChangeSetla section AWS SDK for Java 2.x APIRéférence.