搭CreateModel配 AWS SDK或使用 CLI - AWS SDK 程式碼範例

AWS 文檔 AWS SDK示例 GitHub 回購中有更多SDK示例

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

CreateModel配 AWS SDK或使用 CLI

下列程式碼範例會示範如何使用CreateModel

動作範例是大型程式的程式碼摘錄,必須在內容中執行。您可以在下列程式碼範例的內容中看到此動作:

SAP ABAP
SDK對於 SAP ABAP
注意

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

DATA lo_primarycontainer TYPE REF TO /aws1/cl_sgmcontainerdefn. "Create an ABAP object for the container image based on input variables." CREATE OBJECT lo_primarycontainer EXPORTING iv_image = iv_container_image iv_modeldataurl = iv_model_data_url. "Create an Amazon SageMaker model." TRY. oo_result = lo_sgm->createmodel( " oo_result is returned for testing purposes. " iv_executionrolearn = iv_execution_role_arn iv_modelname = iv_model_name io_primarycontainer = lo_primarycontainer ). MESSAGE 'Model created.' TYPE 'I'. CATCH /aws1/cx_sgmresourcelimitexcd. MESSAGE 'You have reached the limit on the number of resources.' TYPE 'E'. ENDTRY.
  • 如需詳API細資訊,請參閱CreateModelAWS SDK的以供SAPABAPAPI參考