AWS Marketplace 用SDK于 Python 的目录API示例 (Boto3) - AWS SDK代码示例

AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

AWS Marketplace 用SDK于 Python 的目录API示例 (Boto3)

以下代码示例向您展示了如何使用 with Catalo AWS Marketplace g 来执行操作和实现常见场景API。 AWS SDK for Python (Boto3)

每个示例都包含一个指向完整源代码的链接,您可以在其中找到有关如何在上下文中设置和运行代码的说明。

AMI产品

以下代码示例显示了如何为现有AMI产品添加维度并更新优惠定价条款。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to add a dimension to an existing AMI product and update the offer pricing terms. CAPI-23 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Add dimension for AMI product") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何添加部署AMI产品的区域。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "AddRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-east-2", "us-west-2" ] } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to add a region where my AMI product is deployed CAPI-25A """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Add a region where my AMI product is deployed", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何创建按小时按年定价的公开AMI产品或限量产品以及公开发售。此示例创建了标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public or limited AMI product and public offer with hourly-annual pricing and standard or custom EULA CAPI-06 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create limited AMI product and public offer with hourly-annual pricing and standard EULA", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何创建按小时按月定价的公开或限量AMI产品以及公开报价。此示例创建了标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public or limited AMI product and public offer with hourly-monthly pricing and standard or custom EULA CAPI-08 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "create limited AMI product and public offer with hourly-monthly pricing and standard EULA", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何创建按小时定价的公开或限量AMI产品以及公开发售。此示例创建了 and 标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to Create a public or limited AMI product and public offer with hourly pricing and standard or custom EULA CAPI-07 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create limited AMI product and public offer with hourly pricing and standard EULA", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何使用公开报价草稿创建AMI产品草稿。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "AmiProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create an AMI draft product with a draft public offer. CAPI-02 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "AMI draft product with draft public offer", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何限制部署AMI产品的区域。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictRegions", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "Regions": [ "us-west-2" ] } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to restrict a region where my AMI product is deployed CAPI-25B """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Add a region where my AMI product is deployed", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何限制产品的可见性。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateVisibility", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "TargetVisibility": "Restricted" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to change a product visibility to restricted CAPI-17 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Restrict existing AMI") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何指定是否在为支持 future 区域而 AWS 构建的新区域中部署AMI资产。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateFutureRegionSupport", "Entity": { "Type": "AmiProduct@1.0", "Identifier": "prod-1111111111111" }, "DetailsDocument": { "FutureRegionSupport": { "SupportedRegions": [ "All" ] } } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to modify a product to support all future regions CAPI-26 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update future region support") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

渠道合作伙伴优惠

以下代码示例展示了如何CPPO为任何产品类型创建草稿,这样您就可以在向买家发布产品之前在内部对其进行审核。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ResaleAuthorizationId": "11111111-1111-1111-1111-111111111111", "Name": "Test Offer name" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create “draft” CPPO for any product type (AMI/SaaS/Container) that can be reviewed internally before publishing to buyers CAPI-60 """ import os import utils.start_changeset as sc # noqa: E402 import utils.stringify_details as sd # noqa: E402 fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Create a draft CPPO offer for a product") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何根据合同定价的现有协议创建转售授权替代私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a resale authorization replacement private offer from an existing agreement with contract pricing CAPI-96 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create resale authorization replacement private offer with contract pricing", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何列出渠道合作伙伴CPPOs创建的所有内容。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to list all Channel Partner Offers in an account Program executed with no arguments: ie. python3 list_all_cppo_offers.py CAPI-93 """ import json import logging import boto3 from botocore.exceptions import ClientError mp_client = boto3.client("marketplace-catalog") def get_offer_entities(): """ Returns a list of all offers in the account """ next_token = "" # nosec: B105 response_list = [] try: response = mp_client.list_entities(Catalog="AWSMarketplace", EntityType="Offer") except ClientError as e: logging.exception(f"Couldn't list entities. {e}") raise response_list.append(response) # Results are paginated depending on number of entities returned while "NextToken" in response: next_token = response["NextToken"] try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType="Offer", NextToken=next_token, ) except ClientError as e: logging.exception(f"Couldn't list entities. {e}") raise if "NextToken" in response: response_list.append(response) return response_list def build_offer_list(response_list): """ Cleans up list_entities response list with just list of offer IDs """ offer_list = [] for response in response_list: for entity in response["EntitySummaryList"]: offer_list.append(entity["EntityId"]) return offer_list def check_offer_resaleauth(offer_id): """ Checks to see if an offer is based on a resale authorization """ offer_response = describe_entity(offer_id) offer_details = json.loads(offer_response["Details"]) if offer_details is None: offer_details = offer_response["DetailsDocument"] if "ResaleAuthorizationId" in offer_details and offer_details["ResaleAuthorizationId"] is not None: return offer_id else: return None def describe_entity(entity_id): """ General purpose describe entity call """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id, ) except ClientError as e: logging.exception(f"Couldn't describe entity. {e}") raise return response def get_resaleauth_offers(): """ Returns a list of all offers in the account that are based on a resale authorization """ resale_offer_list = [] response_list = get_offer_entities() offer_list = build_offer_list(response_list) for offer in offer_list: print ("offer id " + offer) offer_info = check_offer_resaleauth(offer) if offer_info is not None: resale_offer_list.append(offer_info) return resale_offer_list if __name__ == "__main__": print(get_resaleauth_offers())
  • 有关API详细信息,请参阅ListEntities中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何列出渠道合作伙伴可用的所有共享转售授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to list all resale authorizations shared to an account Program executed with no arguments: ie. python3 list_all_resale_authorizations.py CAPI-94 """ import logging import boto3 import utils.helpers as hlp # noqa: E402 from botocore.exceptions import ClientError mp_client = boto3.client("marketplace-catalog") def get_shared_entities(): next_token = "" # nosec: B105 response_list = [] try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType="ResaleAuthorization", OwnershipType="SHARED", ) except ClientError as e: logging.exception(f"Couldn't list entities. {e}") raise response_list.append(response) # Results can be paginated depending on number of entities returned while "NextToken" in response: next_token = response["NextToken"] try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType="ResaleAuthorization", OwnershipType="SHARED", NextToken=next_token, ) except ClientError as e: logging.exception(f"Couldn't list entities. {e}") raise if "NextToken" in response: response_list.append(response) return response_list if __name__ == "__main__": response_list = get_shared_entities() hlp.pretty_print_datetime(response_list)
  • 有关API详细信息,请参阅ListEntities中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布CPPO和追加买家EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to publish CPPO for any product type (AMI/SaaS/Container) and append buyer EULA """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Publish CPPO for any product type and append buyer EULA", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何在 SaaS 或容器产品上AMI发布一次性转售授权以及如何更新价格加价。CPPO

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateCPPO", "DetailsDocument": { "ResaleAuthorizationId":"resaleauthz-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "Name": "Test Offer name", "Description":"Test Offer description" } }, { "ChangeType": "UpdateMarkup", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "Percentage" : "5.0" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": ["111111111111"] } } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-12-31" } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": {} } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to Create CPPO using one-time resale authorization on AMI, SaaS or Container products and update price markup CAPI-63 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create CPPO using one-time resale authorization and update price markup" ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布草稿CPPO和更新价格加价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType" : "CreateOfferUsingResaleAuthorization", "Entity": { "Type": "Offer@1.0" }, "ChangeName": "CreateCPPO", "DetailsDocument": { "ResaleAuthorizationId":"resaleauthz-1111111111111" } }, { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "Name": "Test Offer name", "Description":"Test Offer description" } }, { "ChangeType": "UpdateMarkup", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "Percentage" : "5.0" } }, { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "PositiveTargeting": { "BuyerAccounts": ["111111111111"] } } }, { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "AvailabilityEndDate": "2023-05-31" } }, { "ChangeType": "UpdateValidityTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "ValidityTerm", "AgreementDuration": "P450D" } ] } }, { "ChangeType":"ReleaseOffer", "Entity":{ "Type": "Offer@1.0", "Identifier": "$CreateCPPO.Entity.Identifier" }, "DetailsDocument": {} } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to publish “draft” CPPO for any product type (AMI/SaaS/Container) and update price markup CAPI-72 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Publish draft CPPO for any product type adn update price markup" ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何更新到期日期,让买家有CPPO更多时间评估和接受报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2025-07-31" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update the expiry date of a CPPO offer """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Update the expiry date of a CPPO offer" ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

容器产品

以下代码示例展示了如何使用公开报价草稿创建集装箱产品草稿。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog":"AWSMarketplace", "ChangeSet":[ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "ContainerProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create an container draft product with a draft public offer. CAPI-03 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create a draft container product with a draft public offer", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何创建具有公开报价、合同定价和标准的限量容器产品EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create limited container product with public offer, contract pricing and standard EULA CAPI-15 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create limited container product with public offer contract pricing and standard EULA", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

实体

以下代码示例显示了如何在单个调用中描述所有实体。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

""" Purpose Shows how to use the AWS SDK for Python (Boto3) to describe for multiple entities information in the AWS Marketplace Catalog CAPI-98 """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) PRODUCT_ID = "prod-1111111111111" OFFER_ID = "offer-1111111111111" MARKETPLACE_CATALOG = "AWSMarketplace" def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def get_entities_information(mp_client): """ Returns information about a given product Args: entity_id str: Entity to return Returns: dict: Dictionary of product information """ entity_request_list_param = [ {'EntityId': PRODUCT_ID, 'Catalog': MARKETPLACE_CATALOG}, {'EntityId': OFFER_ID, 'Catalog': MARKETPLACE_CATALOG} ] try: response = mp_client.batch_describe_entities( EntityRequestList=entity_request_list_param ) return response except ClientError as e: logger.exception("Unexpected error: %s", e) raise def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Looking for entities in the AWS Marketplace Catalog.") print("-" * 88) mp_client = boto3.client("marketplace-catalog") response = get_entities_information(mp_client) print("Successful entities response -") pretty_print(response["EntityDetails"]) print("Failed entities response -") pretty_print(response["Errors"]) if __name__ == "__main__": usage_demo()

以下代码示例说明如何列出和描述与产品相关的所有报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

""" Purpose Shows how to use the AWS SDK for Python (Boto3) to retrieve all offer information related to a single product CAPI-97 """ import argparse import logging import boto3 from botocore.exceptions import ClientError from utils import helpers logger = logging.getLogger(__name__) mp_client = boto3.client("marketplace-catalog") def get_entity_information(entity_id): """ Returns information about a given entity Args: entity_id str: Entity to return Returns: dict: Dictionary of entity information """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id, ) return response except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Entity with ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) def list_entity_details(entity_type, entity_id): """ Returns details about a given entity and entity type """ entity_summary_list = [] # filter will return details for given entity_id with BuyerAccounts targeting filter_list_param = { 'OfferFilters':{ 'ProductId':{ 'ValueList':[entity_id] }, 'Targeting': { 'ValueList': ["BuyerAccounts"] } } } try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType=entity_type, EntityTypeFilters = filter_list_param, MaxResults=10 ) except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Entity ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) # add results to entity_summary_list entity_summary_list.extend(response["EntitySummaryList"]) # if there are more than 10 offers, paginate through the results while "NextToken" in response and response["NextToken"] is not None: try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType=entity_type, EntityTypeFilters = filter_list_param, NextToken=response["NextToken"], MaxResults=10 ) except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Entity ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) # add results to entity_summary_list entity_summary_list.extend(response["EntitySummaryList"]) return entity_summary_list if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--entity-id", "-eid", help="Provide Entity ID corresponding to a product to filter offers on", required=True, ) args = parser.parse_args() # Gets a offers associated with the entity_id response = list_entity_details( "Offer", entity_id=args.entity_id ) if response: # if response is not empty # list_entity_details returns a list of offers for offer in response: print("-"*128) print(f"Terms for Offer ID: {offer['EntityId']}") print("-"*128) #retrieve offer information for each offer entity_information = get_entity_information(offer["EntityId"]) helpers.pretty_print_datetime(entity_information) else: print(f"No information found for Entity ID: {args.entity_id}")

Offers

以下代码示例说明如何为 SaaS 产品创建自定义维度并创建私有报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a SaaS product custom dimension and private offer CAPI-91 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create a SaaS product custom dimension and private offer" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为AMI或 SaaS 产品创建私募报价草稿,这样您就可以在向买家发布之前在内部对其进行审核。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "Test Private Offer" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create “draft” Private Offer for any AMI or SAAS product type that can be reviewed internally before publishing to buyers CAPI-30 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Private offer for AMI product") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何为 SaaS 产品创建包含合同和 Pay-As-You-Go定价的私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with contract with PAYG pricing for my SaaS product CAPI-34 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create private offer with contract with PAYG pricing for my SaaS product", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为 SaaS 产品创建具有合同定价和灵活付款计划的私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "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" ] } } }, { "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 } ] } ] } }, { "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": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Some kind of refund policy description" } ] } }, { "ChangeType": "ReleaseOffer", "Entity": { "Type": "Offer@1.0", "Identifier": "$CreateOfferChange.Entity.Identifier" }, "DetailsDocument": {} } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with contract pricing and flexible payment schedule for my SaaS product CAPI-39 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create private offer with contract pricing and flexible payment schedule for my SaaS product", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为容器产品创建具有合同定价的私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer (target buyers) for my Container product with contract pricing CAPI-36 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "publish a private offer for my Container product with contract pricing", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为AMI产品创建具有合同定价的私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with contract pricing for my AMI product CAPI-35 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "create private offer with contract pricing for my AMI product" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为AMI产品创建具有按小时按年定价和灵活付款时间表的私人报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with hourly annual pricing and flexible payment schedule for my AMI product CAPI-XX """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create private offer with hourly annual pricing and flexible payment schedule for my AMI product", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为AMI产品创建按小时按年定价的私有报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with hourly annual pricing for my AMI product CAPI-31 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "create private offer with hourly annual pricing for my AMI product" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为AMI产品创建按小时定价的私有报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with hourly pricing for my AMI product CAPI-32 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "create private offer with hourly pricing for my AMI product" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何为 SaaS 产品创建具有订阅定价的私有报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with subscription pricing for my SaaS product CAPI-33 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create private offer with subscription pricing for my SaaS product" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何为 SaaS 产品创建具有分级合同定价的私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a private offer with tiered contract pricing for my SaaS product CAPI-XX """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create private offer with tiered contract pricing for my SaaS product", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例演示如何为 SaaS 产品创建具有订阅定价的公共免费试用优惠。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public free trial offer with subscription pricing for SaaS product CAPI-13 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create public free trial offer with subscription pricing for SaaS product", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何根据合同定价的现有协议创建替代私募报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a replacement private offer from an existing agreement with contract pricing CAPI-95 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create replacement private offer with contract pricing..", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何描述公开发行。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) search for offer information in the AWS Marketplace Catalog CAPI-29 """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) OFFER_ID = "offer-1111111111111" def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def get_offer_information(mp_client, entity_id): """ Returns information about a given offer Args: entity_id str: Entity to return Returns: dict: Dictionary of offer information """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id, ) return response except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Offer with ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Looking for an offer in the AWS Marketplace Catalog.") print("-" * 88) mp_client = boto3.client("marketplace-catalog") pretty_print(get_offer_information(mp_client, OFFER_ID)) if __name__ == "__main__": usage_demo()
  • 有关API详细信息,请参阅DescribeEntity中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何将私募报价的到期日期设置为过去的某个日期,这样买家就不会再看到该报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "CreateOffer", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "prod-1111111111111", "Name": "Test Private Offer" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create “draft” Private Offer for any AMI or SAAS product type that can be reviewed internally before publishing to buyers CAPI-30 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Private offer for AMI product") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何列出所有私密优惠。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) for listing offers in the AWS Marketplace Catalog CAPI-40 """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) # Constants MAX_RESULTS = 10 CATALOG = "AWSMarketplace" ENTITY_TYPE = "Offer" def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def list_private_offers(mp_client, return_all_private_offers): """ This method retrieves list of all Private Offers for this account. """ entity_summary_list = [] filter_list_param = { 'OfferFilters': { 'Targeting': { 'ValueList': ["BuyerAccounts"] } } } try: response = mp_client.list_entities( Catalog=CATALOG, EntityType=ENTITY_TYPE, EntityTypeFilters=filter_list_param, MaxResults=MAX_RESULTS ) except ClientError as e: logger.error("Could not complete list_entities request: %s", e) raise entity_summary_list.extend(response["EntitySummaryList"]) logger.info("Number of results in first iteration: %d " % len(entity_summary_list)) # Get subsequent pages of results if previous response contained a NextToken while "NextToken" in response and return_all_private_offers: try: logger.info("Getting Next Token results: %s " % response["NextToken"]) response = mp_client.list_entities( Catalog=CATALOG, EntityType=ENTITY_TYPE, EntityTypeFilters=filter_list_param, MaxResults=MAX_RESULTS, NextToken=response["NextToken"] ) except ClientError as e: logger.error("Could not complete list_entities request: %s", e) raise entity_summary_list.extend(response["EntitySummaryList"]) logger.info( "Number of results in the current iteration: %d " % len(response["EntitySummaryList"]) ) return entity_summary_list def get_offer_details(mp_client, offer): """ Describe the details of the Offer. """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=offer["EntityId"] ) return response except ClientError: logger.exception("Error: Couldn't get details of the Offer.") raise def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Demo - List Private offers.") print("-" * 88) mp_client = boto3.client("marketplace-catalog") # Get list of all Offers. private_offers = list_private_offers(mp_client, False) count = len(private_offers) logger.info("Number of Offers: %d " % count) offer_counter = 0 # Display details of each Offer. for offer in private_offers: print("-" * 88) offer_counter += 1 print("Displaying Offer details for Offer# %d" % offer_counter) entity = get_offer_details(mp_client, offer) pretty_print(entity) print("-" * 88) if __name__ == "__main__": usage_demo()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何更新报价以应用带 Pay-As-You-Go定价的合同。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update an offer to apply contract with PAYG pricing CAPI-21 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update offer to apply contract with PAYG pricing") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何更新报价以应用按小时计费的年度定价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update an offer to apply hourly annual pricing CAPI-20 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update offer with hourly annual pricing") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何更新选件以将定位应用于特定地理区域。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PositiveTargeting": { "CountryCodes": [ "US", "ES", "FR", "AU" ] } } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update an offer to apply targeting to certain geographic regions. CAPI-19 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update offer targeting") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何更新公开发售的名称和描述。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateInformation", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Name": "New offer name", "Description": "New offer description" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update name and description of my offer CAPI-18 """ import os import utils.start_changeset as sc # type: ignore import utils.stringify_details as sd # type: ignore fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update name and description of my offer") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何更新EULA报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update EULA of my offer CAPI-18 """ import os import utils.start_changeset as sc # type: ignore import utils.stringify_details as sd # type: ignore fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update EULA of my offer") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何将私募报价的到期日期更新为未来的某个日期,让买家有更多时间评估和接受报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateAvailability", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "AvailabilityEndDate": "2026-01-01" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to set expiry date of a private offer to a date in the future so that my buyers get more time to evaluate and accept the offer. CAPI-37 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update offer expiration date") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示如何更新 SaaS 产品的公开免费试用优惠的免费试用时长。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to change free trial duration for my SaaS product by modifying my free trial public offer CAPI-14 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Change free trial duration for SaaS product") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何更新报价的退款政策。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateSupportTerms", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "Terms": [ { "Type": "SupportTerm", "RefundPolicy": "Updated refund policy description" } ] } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update refund policy of my offer CAPI-18 """ import os import utils.start_changeset as sc # type: ignore import utils.stringify_details as sd # type: ignore fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Update refund policy of my public offer") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

产品

以下代码示例说明如何描述AMI、SaaS 或容器产品,并检查它是否包含您想了解的有关该产品的所有信息。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

""" Purpose Shows how to use the AWS SDK for Python (Boto3) search for product information in the AWS Marketplace Catalog CAPI-28 """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) PRODUCT_ID = "prod-1111111111111" def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def get_product_information(mp_client, entity_id): """ Returns information about a given product Args: entity_id str: Entity to return Returns: dict: Dictionary of product information """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id, ) return response except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Product with ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Looking for a product in the AWS Marketplace Catalog.") print("-" * 88) mp_client = boto3.client("marketplace-catalog") pretty_print(get_product_information(mp_client, PRODUCT_ID)) if __name__ == "__main__": usage_demo()
  • 有关API详细信息,请参阅DescribeEntity中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何列出所有 AMI SaaS 或容器产品以及相关的公开报价。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

""" Purpose Shows how to use the AWS SDK for Python (Boto3) to display information about AMI products and their associated offers in the AWS Marketplace Catalog CAPI-27 """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) MAX_PAGE_RESULTS = 10 try: mp_client = boto3.client("marketplace-catalog") except ClientError as e: logger.error("Could not create boto3 client.") raise def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def describe_entity(entity_id): """ Returns entity details Args: entity_id str: The entity ID of the product or offer Returns: dict: The entity details """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id ) except ClientError as e: logger.error("Could not complete describe_entity request.") raise # De-stringify the details response["Details"] = json.loads(response["Details"]) return response def get_entities(entity_type, visibility=None): """ Returns list of entities for provided entity_type Args: entity_type str: Type of entity list to return, in our case AmiProduct or Offer Returns: list: Abbreviated list of entity information """ EntitySummaryList = [] # Get the first page of results try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType=entity_type, MaxResults=MAX_PAGE_RESULTS, ) except ClientError as e: logger.error("Could not complete list_entities request.") raise EntitySummaryList.extend(response["EntitySummaryList"]) # Get subsequent pages of results if previous response contained a NextToken while "NextToken" in response: try: response = mp_client.list_entities( Catalog="AWSMarketplace", EntityType=entity_type, MaxResults=MAX_PAGE_RESULTS, NextToken=response["NextToken"], ) except ClientError as e: logger.error("Could not complete list_entities request.") raise EntitySummaryList.extend(response["EntitySummaryList"]) # if visibility is provided, filter the list to only include entities with that visibility if visibility is not None: EntitySummaryList = [ entity for entity in EntitySummaryList if entity["Visibility"] == visibility ] return EntitySummaryList def get_enhanced_product_list(entity_type): """ Returns an enhanced list of products with product details and offer details Args: entity_type str: Type of entity list to return, in our case AmiProduct Returns: list: Enhanced list of dictionary objects containing product and offer details """ product_list = get_entities(entity_type) # Loop through product list and append product details to each product for product in product_list: # appends product details to product dictionary product["ProductDetails"] = describe_entity(product["EntityId"])["Details"] # creating an empty list for offer details product["OfferDetailsList"] = [] return product_list def attach_offer_details(product_list): """ Loops through offer information and appends offer details to product list Args: product_list list: List of product dictionaries Returns: list: Enhanced list of dictionary objects containing product and offer details """ offer_list = get_entities("Offer", "Public") # Loop through offer list and append offer details to each product for offer in offer_list: offer["OfferDetails"] = describe_entity(offer["EntityId"])["Details"] # Extracts product-id from offer product_id = offer["OfferDetails"]["ProductId"] # Determines if product-id referenced in offer matches product-id in product list product_dict = next( filter(lambda product: product["EntityId"] == product_id, product_list), None, ) # If product-id matches, appends offer details to product dictionary if product_dict is not None: # logger.info(f"Offer product Id {offer['OfferDetails']['ProductId']} found in product dictionary. Updating product dictionary with offer details") product_dict["OfferDetailsList"].append(offer["OfferDetails"]) else: # logger.info("Offer product Id {offer['OfferDetails']['ProductId']} not found. Skipping offer details update") pass return product_list def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Retrieving products and public offer information....") print("-" * 88) # Builds a list of products and their details product_list = get_enhanced_product_list("AmiProduct") # Queries offer information and attaches it to the product list product_offer_list = attach_offer_details(product_list) pretty_print(product_offer_list) return product_offer_list if __name__ == "__main__": usage_demo()

转售授权

以下代码示例展示了如何为任何产品类型创建转售授权草稿,这样您就可以在发布给渠道合作伙伴之前在内部对其进行审查。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a one-time resale authorization on my SaaS/AMI/Container product so my CP can use that to create Channel Partner Private Offer (CPPO) CAPI-41 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "draft resale auth") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何描述转售授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) search for product information in the AWS Marketplace Catalog """ import json import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) resaleAuthorizationId = "resaleauthz-1111111111111" def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) def get_product_information(mp_client, entity_id): """ Returns information about a given product Args: entity_id str: Entity to return Returns: dict: Dictionary of product information """ try: response = mp_client.describe_entity( Catalog="AWSMarketplace", EntityId=entity_id, ) return response except ClientError as e: if e.response["Error"]["Code"] == "ResourceNotFoundException": logger.error("Product with ID %s not found.", entity_id) else: logger.error("Unexpected error: %s", e) def usage_demo(): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Looking for a product in the AWS Marketplace Catalog.") print("-" * 88) mp_client = boto3.client("marketplace-catalog") pretty_print(get_product_information(mp_client, resaleAuthorizationId)) if __name__ == "__main__": usage_demo()
  • 有关API详细信息,请参阅DescribeEntity中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布包含私人报价的一次性转售授权,以便渠道合作伙伴可以使用它来创建渠道合作伙伴私有报价 (CPPO)。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a one-time resale authorization on my SaaS/AMI/Container product so my CP can use that to create Channel Partner Private Offer (CPPO) CAPI-42 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "onetime resale auth with private offer" ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何为按小时按年定价AMI的产品发布带有有效期的多用途转售授权,以便渠道合作伙伴可以使用它来创建. CPPO

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with expiry date on my SaaS/AMI product so my CP can use that to create Channel Partner Private Offer (CPPO) CAPI-48 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "multi-use resale auth with expiry date") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布包含任何产品类型的过期日期的多用途转售授权,以及如何添加EULA要发送给买家的自定义授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with expiry date on my SaaS/AMI/Container product and add custom EULA to be sent to the buyer CAPI-56 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "multiuse resale auth with expiry date and custom EULA") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的多用途转售授权,以及如何为任何产品类型发布具有到期日期的多用途转售授权,以及如何在和渠道合作伙伴之间添加经销商合同文档。ISV

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "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-12-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": "ResaleUsageBasedPricingTerm", "CurrencyCode": "USD", "RateCards": [ { "RateCard": [ { "DimensionKey": "t2.micro", "Price": "150" } ] } ] } ] } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with expiry date on my SaaS/AMI/Container product and add reseller contract documentation between the ISV and channel partner CAPI-57 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "multi use resale auth with contract doc", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布包含任何产品类型的过期日期的多用途转售授权,以及如何为转售添加特定的买家账户。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish multi-use resale authorization with expiry date for any product type (AMI/SaaS/Container) and add specific buyer account for the resale CAPI-82 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Publish multi-use resale authorization with expiry date and add specific buyer account", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何为按小时按年定价AMI的产品发布没有到期日期的多用途转售授权,以便CP可以使用该授权来创建. CPPO

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with no expiry date on my SaaS/AMI product so my CP can use that to create Channel Partner Private Offer (CPPO) CAPI-52 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "multi use resale auth with no expiry date") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的多用途转售授权,而无需过期日期,以及如何添加EULA要发送给买家的自定义授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with no expiry date on my SaaS/AMI/Container product and add custom EULA to be sent to the buyer CAPI-58 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "multi use resale auth with no expiry date and custom EULA" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的多用途转售授权(不设到期日期),以及如何添加与渠道合作伙伴之间的经销商合同文档。ISV

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a multi-use resale authorization with no expiry date on my SaaS/AMI/Container product and add reseller contract documentation between the ISV and channel partner CAPI-59 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "multi use resale auth with no expiry date and contract doc" ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的多用途转售授权,而无需过期日期,以及如何为转售添加特定的买家账户。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish multi-use resale authorization without expiry date for any product type (AMI/SaaS/Container) and add specific buyer account for the resale CAPI-83 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "publish multi-use resale authorization without expiry date and add specific buyer account", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的一次性转售授权以及如何添加灵活的付款计划。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish one-time resale authorization for any product type (AMI/SaaS/Container) and add Flexible payment schedule CAPI-78 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "onetime resale auth with flexible payment schedule") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例演示如何发布任何产品类型的一次性转售授权,以及如何添加EULA要发送给买家的自定义授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a one-time resale authorization on my SaaS/AMI/Container product and add custom EULA to be sent to the buyer """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "onetime resale auth with custom EULA") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的一次性转售授权,以及如何为转售添加特定的买家账户。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish one-time resale authorization for any product type (AMI/SaaS/Container) and add specific buyer account for the resale CAPI-81 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "onetime resale authorization for specific buyer account") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布任何产品类型的一次性转售授权,以及如何添加与渠道合作伙伴之间的经销商合同文档。ISV

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "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" } ] }, { "Type": "ResaleLegalTerm", "Documents": [ { "Type": "CustomResellerContract", "Url": "https://s3.amazonaws.com/aws-mp-standard-contracts/Standard-Contact-for-AWS-Marketplace-2022-07-14.pdf" } ] } ] } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish a one-time resale authorization on my SaaS/AMI/Container product and add reseller contract documentation between the ISV and channel partner CAPI-47 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "onetime resale auth with reseller contract doc") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何发布任何产品类型的一次性转售授权以及如何添加是否续订。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish one-time resale authorization for any product type (AMI/SaaS/Container) and add whether it is renewal or not CAPI-90 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo(stringified_change_set, "onetime resale auth renewal") return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何限制转售授权。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "RestrictResaleAuthorization", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": {} } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Restrict a authorization for any product type (AMI/SaaS/Container) CAPI-84 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "Restrict resale authorization") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例说明如何在发布任何产品类型之前更新一次性或多用途转售授权的名称和描述。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType":"UpdateInformation", "Entity": { "Type": "ResaleAuthorization@1.0", "Identifier": "resaleauthz-1111111111111" }, "DetailsDocument": { "Name": "TestResaleAuthorization", "Description": "Worldwide ResaleAuthorization for Test Product" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Update name/description of one-time or multi-use resale authorization before publishing for any product type (AMI/SaaS/Container) CAPI-77 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "update name and description of one-time or multi-use resale authorization before publishing", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

SaaS 产品

以下代码示例展示了如何使用公开报价草稿创建 SaaS 产品草稿。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

{ "Catalog":"AWSMarketplace", "ChangeSet":[ { "ChangeType": "CreateProduct", "ChangeName": "CreateProductChange", "Entity": { "Type": "SaaSProduct@1.0" }, "DetailsDocument": {} }, { "ChangeType": "CreateOffer", "ChangeName": "CreateOfferChange", "Entity": { "Type": "Offer@1.0" }, "DetailsDocument": { "ProductId": "$CreateProductChange.Entity.Identifier", "Name": "Test Offer" } } ] }

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create an SaaS draft product with a draft public offer. CAPI-04 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Create a draft saas product with a draft public offer", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何使用合同定价创建公开或有限的 SaaS 产品和公开报价。此示例创建了标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public or limited SaaS product and public offer with contract pricing and standard EULA CAPI-11 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create a limited saas product with a public offer with contract pricing", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例演示如何使用定价合同创建公开或有限的 SaaS 产品和公开报 Pay-As-You-Go价。此示例创建了标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public or limited SaaS product and public offer with contract with PAYG pricing and standard EULA CAPI-10 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo( change_set, "Create limited SaaS product with public offer with contract with payg pricing", ) if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何使用订阅定价创建公开或有限的 SaaS 产品和公开报价。此示例创建了标准或自定义EULA。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to create a public or limited SaaS product and public offer with subscription(usage) pricing and standard EULA CAPI-09 """ import os import utils.start_changeset as sc import utils.stringify_details as sd fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) change_set = sd.stringify_changeset(change_set_file) def main(): sc.usage_demo(change_set, "public saas public offer with subscription pricing") if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例展示了如何发布 SaaS 产品和相关的公开报价。默认情况下,产品将处于受限状态。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Publish my SaaS product and associated public offer (product will be in limited state by default) CAPI-05A """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset1.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "publish saas product and associated public offer", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

以下代码示例显示了如何更新AMI或 SaaS 产品的维度。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

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

运行此脚本以启动变更集。在 Utilities 中定义了辅助函数,用于从 “实用工具” 部分启动变更集

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to use the AWS SDK for Python (Boto3) to update (e.g name) dimensions on my AMI or SaaS product CAPI-24 """ import os import utils.start_changeset as sc import utils.stringify_details as sd def main(change_set=None): if change_set is None: fname = "changeset.json" change_set_file = os.path.join(os.path.dirname(__file__), fname) stringified_change_set = sd.stringify_changeset(change_set_file) else: stringified_change_set = change_set response = sc.usage_demo( stringified_change_set, "Update name dimensions on my AMI or SaaS product", ) return response if __name__ == "__main__": main()
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。

实用程序

以下代码示例显示了如何定义用于启动变更集的实用程序。

SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库中设置和运行。

启动变更集的实用程序。

""" Purpose: Generic function to start a changeset """ import logging import boto3 from botocore.exceptions import ClientError logger = logging.getLogger(__name__) def generate_changeset(mp_client, change_set, change_set_name): """ Start changeset """ try: response = mp_client.start_change_set( Catalog="AWSMarketplace", ChangeSet=change_set, ChangeSetName=change_set_name, ) logger.info("Changeset created!") logger.info("ChangeSet ID: %s", response["ChangeSetId"]) logger.info("ChangeSet ARN: %s", response["ChangeSetArn"]) return response except ClientError as e: logger.exception("Unexpected error: %s", e) raise def usage_demo(change_set, change_set_name): logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") print("-" * 88) print("Executing changeset: " + change_set_name) print("-" * 88) mp_client = boto3.client("marketplace-catalog") response = generate_changeset(mp_client, change_set, change_set_name) return response print("-" * 88)

用于从文件加载变更集的实用程序。JSON

""" Purpose: This module will stringify the details sections of a changeset file. """ import json def pretty_print(response): json_object = json.dumps(response, indent=4) print(json_object) # open json file from path def open_json_file(filename): with open(filename, "r") as f: return json.load(f) def stringify_details_sections(json_object): """ Loops through every change type in the changeset to look for non-empty details section and stringifies them """ for change_type in json_object["ChangeSet"]: # Only stringify details section if it is not empty if "Details" in change_type and change_type["Details"] != "{}": string_details = json.dumps(change_type["Details"]) change_type["Details"] = string_details else: pass return json_object["ChangeSet"] def stringify_changeset(file_path): changeset_file = open_json_file(file_path) changeset_stringified = stringify_details_sections(changeset_file) return changeset_stringified
  • 有关API详细信息,请参阅StartChangeSet中的 AWS SDKPython (Boto3) API 参考。