AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
发布没有到期日期的多用途转售授权,并使用添加自定义EULA授权 AWS SDK
以下代码示例展示了如何发布任何产品类型的多用途转售授权,而无需过期日期,以及如何添加EULA要发送给买家的自定义授权。
- Java
-
- SDK适用于 Java 2.x
-
注意
还有更多相关信息 GitHub。查找完整的示例,学习如何在AWS Marketplace API参考代码库存储库
中设置和运行。 要运行此示例,请将以下JSON变更集传递到 Utilities
RunChangesets
中,以从 “实用工具” 部分启动变更集。{ "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" } ] } ] } } ] }
-
有关API详细信息,请参阅 “AWS SDK for Java 2.x API参考 StartChangeSet” 中的。
-
- Python
-
- 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 参考。
-
发布没有到期日期的多用途转售授权
发布没有到期日期的多用途转售授权和经销商合同文档