發佈任何產品類型的一次性轉售授權,並使用 a AWS SDK 新增經銷商合約文件 - AWS SDK 程式碼範例

文件 AWS SDK AWS 範例 SDK 儲存庫中有更多可用的 GitHub 範例。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

發佈任何產品類型的一次性轉售授權,並使用 a AWS SDK 新增經銷商合約文件

下列程式碼範例示範如何發佈任何產品類型的一次性轉售授權,以及在 ISV 和 Channel Partner 之間新增經銷商合約文件。

Java
Java 2.x 的 SDK
注意

還有更多 on GitHub。尋找完整的範例,並了解如何在 AWS Marketplace API 參考程式碼庫儲存庫中設定和執行。

若要執行此範例,請在公用程式RunChangesets中將下列 JSON 變更集傳遞至 ,從公用程式區段啟動變更集。

{ "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" } ] } ] } } ] }
  • 如需 API 詳細資訊,請參閱 StartChangeSet AWS SDK for Java 2.x 參考中的 API

Python
SDK for Python (Boto3)
注意

還有更多 on 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" } ] } ] } } ] }

執行此指令碼以啟動變更集。公用程式中定義協助程式函數,以從公用程式區段啟動變更集

# 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 SDK for Python (Boto3) Word 參考中的 API