将 CreateModel 和 AWS SDK 结合使用 - AWS SDK 代码示例

AWS 文档 SDK 示例 GitHub 存储库中还有更多 AWS SDK 示例。

CreateModel 和 AWS SDK 结合使用

以下代码示例演示了如何使用 CreateModel

操作示例是大型程序的代码摘录,必须在上下文中运行。在以下代码示例中,您可以查看此操作的上下文:

SAP ABAP
适用于 SAP ABAP 的 SDK
注意

查看 GitHub,了解更多信息。在 AWS 代码示例存储库中查找完整示例,了解如何进行设置和运行。

DATA lo_primarycontainer TYPE REF TO /aws1/cl_sgmcontainerdefn. "Create an ABAP object for the container image based on input variables." lo_primarycontainer = NEW #( 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 详细信息,请参阅《AWS SDK for SAP ABAP API Reference》中的 CreateModel