L'AWS Marketplace API Reference è stato ristrutturato. Per ulteriori informazioni sulle operazioni API supportate, consulta l'AWS Marketplace API Reference.
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Aggiorna il nome e la descrizione di un'offerta pubblica utilizzando unAWSSDK
Gli esempi di codice seguenti mostrano come aggiornare il nome e la descrizione di un’offerta pubblica.
- Java
-
- SDK per Java 2.x
-
Per eseguire questo esempio, passa il seguente set di modifiche JSON a RunChangesets in Utilità per l’avvio di un set di modifiche nella sezione Utilità.
{
"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"
}
]
}
]
}
}
]
}
- Python
-
- SDK per Python (Boto3)
-
{
"Catalog": "AWSMarketplace",
"ChangeSet": [
{
"ChangeType": "UpdateInformation",
"Entity": {
"Type": "Offer@1.0",
"Identifier": "offer-1111111111111"
},
"DetailsDocument": {
"Name": "New offer name",
"Description": "New offer description"
}
}
]
}
Esegui questo script per avviare il set di modifiche. Le funzioni helper sono definite Utilità per l’avvio di un set di modifiche nella sezione Utilità.
# 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()
Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, consulta. Utilizzo di questo servizio con unAWSSDK Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.