Use CreateModel with an AWS SDK - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use CreateModel with an AWS SDK

The following code example shows how to use CreateModel.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

SAP ABAP
SDK for SAP ABAP
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

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.
  • For API details, see CreateModel in AWS SDK for SAP ABAP API reference.