The AWS Marketplace API Reference was restructured. For more information about the supported API operations, see the AWS Marketplace API Reference.
Create a draft CPPO for any product type using an AWS SDK
The following code examples show how to create a draft CPPO for any product type so you can review them internally before publishing to buyers.
- Java
-
- SDK for Java 2.x
-
To run this example, pass the following JSON changeset to RunChangesets in Utilities to start a changeset from the Utilities section.
{
"Catalog": "AWSMarketplace",
"ChangeSet": [
{
"ChangeType": "CreateOfferUsingResaleAuthorization",
"Entity": {
"Type": "Offer@1.0"
},
"DetailsDocument": {
"ResaleAuthorizationId": "11111111-1111-1111-1111-111111111111",
"Name": "Test Offer",
"Description": "Test product"
}
}
]
}
- Python
-
- SDK for Python (Boto3)
-
{
"Catalog": "AWSMarketplace",
"ChangeSet": [
{
"ChangeType": "CreateOfferUsingResaleAuthorization",
"Entity": {
"Type": "Offer@1.0"
},
"DetailsDocument": {
"ResaleAuthorizationId": "11111111-1111-1111-1111-111111111111",
"Name": "Test Offer name"
}
}
]
}
Run this script to start the changeset. Helper functions are defined in Utilities to start a changeset from the Utilities section.
# 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()
For a complete list of AWS SDK developer guides and code examples, see
Using this service with an AWS SDK.
This topic also includes information about getting started and details about previous SDK versions.