Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
AWS Marketplace APIContoh katalog menggunakan SDK untuk Java 2.x
Contoh kode berikut menunjukkan cara melakukan tindakan dan menerapkan skenario umum dengan menggunakan AWS Marketplace Katalog AWS SDK for Java 2.x withAPI.
Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.
Topik
AMIproduk
Contoh kode berikut menunjukkan cara menambahkan dimensi ke AMI produk yang ada dan memperbarui ketentuan harga penawaran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menambahkan wilayah tempat AMI produk dikerahkan.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-east-2", "us-west-2" ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat AMI produk publik atau terbatas dan penawaran umum dengan harga tahunan per jam. Contoh ini menciptakan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat AMI produk publik atau terbatas dan penawaran umum dengan harga bulanan per jam. Contoh ini menciptakan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat AMI produk publik atau terbatas dan penawaran umum dengan harga per jam. Contoh ini menciptakan baik dan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat draf AMI produk dengan draf penawaran umum.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membatasi wilayah tempat AMI produk dikerahkan.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-west-2" ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membatasi visibilitas produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateVisibility", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "TargetVisibility": "Restricted" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menentukan apakah AMI aset dikerahkan di wilayah baru yang dibangun oleh AWS untuk mendukung wilayah masa depan.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateFutureRegionSupport", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "FutureRegionSupport": { "SupportedRegions": [ "All" ] } } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Penawaran mitra saluran
Contoh kode berikut menunjukkan cara membuat draf CPPO untuk semua jenis produk sehingga Anda dapat meninjaunya secara internal sebelum dipublikasikan ke pembeli.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ResaleAuthorizationId": "11111111-1111-1111-1111-111111111111", "Name": "Test Offer", "Description": "Test product" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi pengganti otorisasi penjualan kembali dari perjanjian yang ada dengan harga kontrak.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat daftar semua yang CPPOs dibuat oleh mitra saluran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat ListEntitiesdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mencantumkan semua otorisasi penjualan kembali bersama yang tersedia untuk mitra saluran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat ListEntitiesdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan CPPO dan menambahkan pembeliEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali satu kali CPPO menggunakan pada, AMI SaaS, atau produk Container dan memperbarui markup harga.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan draf CPPO dan memperbarui markup harga.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui tanggal kedaluwarsa a CPPO untuk memberi pembeli lebih banyak waktu untuk mengevaluasi dan menerima penawaran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2025-07-31" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Produk kontainer
Contoh kode berikut menunjukkan cara membuat produk kontainer draf dengan draf penawaran umum.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat produk kontainer terbatas dengan penawaran umum, harga kontrak, dan standarEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Entitas
Contoh kode berikut menunjukkan bagaimana mendeskripsikan semua entitas dalam satu panggilan.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. // 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())); } } }
-
Untuk API detailnya, lihat BatchDescribeEntitiesdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat daftar dan menjelaskan semua penawaran yang terkait dengan suatu produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat topik berikut di AWS SDK for Java 2.x APIReferensi.
-
Penawaran
Contoh kode berikut menunjukkan cara membuat dimensi khusus untuk produk SaaS dan membuat penawaran pribadi.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat draf penawaran pribadi untuk produk AMI atau SaaS sehingga Anda dapat memeriksanya secara internal sebelum dipublikasikan ke pembeli.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "Test Private Offer" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan kontrak dan Pay-As-You-Go harga untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga kontrak dan jadwal pembayaran yang fleksibel untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga kontrak untuk produk Container.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga kontrak untuk suatu AMI produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga tahunan per jam dan jadwal pembayaran yang fleksibel untuk suatu AMI produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga tahunan per jam untuk suatu AMI produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga per jam untuk suatu AMI produk.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga berlangganan untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi dengan harga kontrak berjenjang untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran uji coba gratis publik dengan harga berlangganan untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat penawaran pribadi pengganti dari perjanjian yang ada dengan harga kontrak.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan bagaimana menggambarkan penawaran umum.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. // 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; } }
-
Untuk API detailnya, lihat DescribeEntitydi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mengatur tanggal kedaluwarsa penawaran pribadi ke tanggal di masa lalu sehingga pembeli tidak lagi melihat penawaran tersebut.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2023-01-01" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat daftar semua penawaran pribadi.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mencantumkan penawaran publik dan pribadi yang dirilis untuk ID produk tertentu.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui penawaran untuk menerapkan kontrak dengan Pay-As-You-Go harga.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui penawaran untuk menerapkan harga tahunan per jam.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui penawaran untuk menerapkan penargetan ke wilayah geografis tertentu.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PositiveTargeting": { "CountryCodes": [ "US", "ES", "FR", "AU" ] } } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui nama dan deskripsi penawaran umum.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui penawaran. EULA
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Name": "New offer name", "Description": "New offer description" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui tanggal kedaluwarsa penawaran pribadi ke tanggal di masa depan untuk memberi pembeli lebih banyak waktu untuk mengevaluasi dan menerima penawaran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2026-01-01" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui durasi uji coba gratis dari penawaran uji coba gratis publik untuk produk SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui kebijakan pengembalian dana penawaran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Updated refund policy description" } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Produk
Contoh kode berikut menunjukkan cara mendeskripsikan produkAMI, SaaS, atau Kontainer dan periksa apakah itu berisi semua informasi yang ingin Anda ketahui tentang produk tersebut.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. // 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; } }
-
Untuk API detailnya, lihat DescribeEntitydi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat daftar semuaAMI, SaaS, atau produk Kontainer dan penawaran publik terkait.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. 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; } }
-
Untuk API detailnya, lihat topik berikut di AWS SDK for Java 2.x APIReferensi.
-
Otorisasi penjualan kembali
Contoh kode berikut menunjukkan cara membuat draf otorisasi penjualan kembali untuk semua jenis produk sehingga Anda dapat memeriksanya secara internal sebelum memublikasikan ke Mitra Saluran.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan bagaimana menggambarkan otorisasi penjualan kembali.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. // 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; } }
-
Untuk API detailnya, lihat DescribeEntitydi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menerbitkan otorisasi penjualan kembali satu kali dengan penawaran pribadi sehingga Mitra Saluran dapat menggunakannya untuk membuat Penawaran Pribadi Mitra Saluran (). CPPO
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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 } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menerbitkan otorisasi penjualan kembali multi-guna dengan tanggal kedaluwarsa untuk AMI produk dengan harga tahunan per jam sehingga Mitra Saluran dapat menggunakannya untuk membuat. CPPO
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali multi-guna dengan tanggal kedaluwarsa untuk semua jenis produk dan menambahkan kustom EULA untuk dikirim ke pembeli.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menerbitkan otorisasi penjualan kembali multi-guna dengan tanggal kedaluwarsa untuk semua jenis produk dan menambahkan dokumentasi kontrak pengecer antara Mitra Saluran dan Mitra. ISV
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali multi-guna dengan tanggal kedaluwarsa untuk semua jenis produk dan menambahkan akun pembeli tertentu untuk penjualan kembali.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali multi-guna tanpa tanggal kedaluwarsa untuk AMI produk dengan harga tahunan per jam sehingga CP dapat menggunakannya untuk membuat. CPPO
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali multi-guna tanpa tanggal kedaluwarsa untuk jenis produk apa pun dan menambahkan kustom EULA untuk dikirim ke pembeli.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menerbitkan otorisasi penjualan kembali multi-guna tanpa tanggal kedaluwarsa untuk jenis produk apa pun dan menambahkan dokumentasi kontrak pengecer antara Mitra Saluran dan Mitra. ISV
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali multi-guna tanpa tanggal kedaluwarsa untuk jenis produk apa pun dan menambahkan akun pembeli tertentu untuk penjualan kembali.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali satu kali untuk semua jenis produk dan menambahkan jadwal pembayaran Fleksibel.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali satu kali untuk semua jenis produk dan menambahkan kustom EULA untuk dikirim ke pembeli.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali satu kali untuk semua jenis produk dan menambahkan akun pembeli tertentu untuk penjualan kembali.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" ] } } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara menerbitkan otorisasi penjualan kembali satu kali untuk semua jenis produk dan menambahkan dokumentasi kontrak pengecer antara Mitra Saluran dan Mitra. ISV
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan otorisasi penjualan kembali satu kali untuk semua jenis produk dan menambahkan apakah itu pembaruan.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membatasi otorisasi penjualan kembali.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui nama dan deskripsi otorisasi penjualan kembali satu kali atau multi-guna sebelum menerbitkan untuk jenis produk apa pun.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType":"UpdateInformation", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": { "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Produk SaaS
Contoh kode berikut menunjukkan cara membuat draf produk SaaS dengan draf penawaran umum.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat produk SaaS publik atau terbatas dan penawaran publik dengan harga kontrak. Contoh ini menciptakan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat produk SaaS publik atau terbatas dan penawaran publik dengan kontrak dengan Pay-As-You-Go harga. Contoh ini menciptakan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara membuat produk SaaS publik atau terbatas dan penawaran umum dengan harga berlangganan. Contoh ini menciptakan standar atau kustomEULA.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan produk SaaS dan penawaran publik terkait. Produk akan berada dalam keadaan terbatas secara default.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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": {} } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara mempublikasikan produk SaaS dan penawaran publik terkait dari draf yang ada. Produk akan berada dalam keadaan terbatas secara default.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. { "Catalog":"AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateVisibility", "ChangeName": "CreateProductChange", "Entity": { "Type": "SaaSProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "TargetVisibility": "Public" } } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Contoh kode berikut menunjukkan cara memperbarui dimensi pada produk AMI atau SaaS.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Untuk menjalankan contoh ini, teruskan JSON changeset berikut ke
RunChangesets
dalam Utilities untuk memulai changeset dari bagian Utilities.{ "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" } ] } ] }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-
Utilitas
Contoh kode berikut menunjukkan bagaimana mendefinisikan utilitas untuk memulai changeset.
- SDKuntuk Java 2.x
-
catatan
Ada lebih banyak tentang GitHub. Temukan contoh lengkapnya dan pelajari cara mengatur dan menjalankan di repositori Perpustakaan Kode AWS Marketplace API Referensi
. Utilitas untuk memuat changeset dari JSON file dan mulai memprosesnya.
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; } }
-
Untuk API detailnya, lihat StartChangeSetdi AWS SDK for Java 2.x APIReferensi.
-