AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
CreateModel
搭配使用 AWS SDK
以下代码示例演示如何使用 CreateModel
。
操作示例是大型程序的代码摘录,必须在上下文中运行。在以下代码示例中,您可以查看此操作的上下文:
- SAP ABAP
-
- SDK对于 SAP ABAP
-
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.