Skip to content

/AWS1/IF_SGM=>CREATEJOB()

About CreateJob

Creates a model customization job in Amazon SageMaker. A job runs a workload based on the job category and configuration you provide. You specify the job category, a schema-versioned configuration document, and an IAM role that grants Amazon SageMaker permission to access resources on your behalf.

Use the AgentRFT category to fine-tune a model using multi-turn reinforcement learning with reward signals. Use the AgentRFTEvaluation category to evaluate a fine-tuned or base model by running multi-turn rollouts against a held-out prompt dataset and computing metrics such as pass@k and mean reward.

Before creating a job, call ListJobSchemaVersions and DescribeJobSchemaVersion to retrieve the configuration schema for your job category. The JobConfigDocument must conform to the schema specified by JobConfigSchemaVersion.

The following operations are related to CreateJob:

  • DescribeJob

  • ListJobs

  • StopJob

  • DeleteJob

  • ListJobSchemaVersions

  • DescribeJobSchemaVersion

Method Signature

METHODS /AWS1/IF_SGM~CREATEJOB
  IMPORTING
    !IV_JOBNAME TYPE /AWS1/SGMJOBNAME OPTIONAL
    !IV_ROLEARN TYPE /AWS1/SGMROLEARN OPTIONAL
    !IV_JOBCATEGORY TYPE /AWS1/SGMJOBCATEGORY OPTIONAL
    !IV_JOBCONFIGSCHEMAVERSION TYPE /AWS1/SGMJOBSCHEMAVERSION OPTIONAL
    !IV_JOBCONFIGDOCUMENT TYPE /AWS1/SGMJOBCONFIGDOCUMENT OPTIONAL
    !IT_TAGS TYPE /AWS1/CL_SGMTAG=>TT_TAGLIST OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sgmcreatejobresponse
  RAISING
    /AWS1/CX_SGMRESOURCEINUSE
    /AWS1/CX_SGMRESOURCELIMITEXCD
    /AWS1/CX_SGMRESOURCENOTFOUND
    /AWS1/CX_SGMCLIENTEXC
    /AWS1/CX_SGMSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_jobname TYPE /AWS1/SGMJOBNAME /AWS1/SGMJOBNAME

The name of the job. The name must be unique within your account and Amazon Web Services Region.

iv_rolearn TYPE /AWS1/SGMROLEARN /AWS1/SGMROLEARN

The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.

iv_jobcategory TYPE /AWS1/SGMJOBCATEGORY /AWS1/SGMJOBCATEGORY

The category of the job. The category determines the type of workload that the job runs.

iv_jobconfigschemaversion TYPE /AWS1/SGMJOBSCHEMAVERSION /AWS1/SGMJOBSCHEMAVERSION

The version of the configuration schema to use for the job configuration document. Use ListJobSchemaVersions to get available schema versions for a job category.

iv_jobconfigdocument TYPE /AWS1/SGMJOBCONFIGDOCUMENT /AWS1/SGMJOBCONFIGDOCUMENT

The JSON configuration document for the job. The document must conform to the schema specified by JobConfigSchemaVersion. Use DescribeJobSchemaVersion to retrieve the schema for validation.

Optional arguments:

it_tags TYPE /AWS1/CL_SGMTAG=>TT_TAGLIST TT_TAGLIST

An array of key-value pairs to apply to the job as tags. For more information, see Tagging Amazon Web Services Resources.

RETURNING

oo_output TYPE REF TO /aws1/cl_sgmcreatejobresponse /AWS1/CL_SGMCREATEJOBRESPONSE

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->createjob(
  it_tags = VALUE /aws1/cl_sgmtag=>tt_taglist(
    (
      new /aws1/cl_sgmtag(
        iv_key = |string|
        iv_value = |string|
      )
    )
  )
  iv_jobcategory = |string|
  iv_jobconfigdocument = |string|
  iv_jobconfigschemaversion = |string|
  iv_jobname = |string|
  iv_rolearn = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_jobarn = lo_result->get_jobarn( ).
ENDIF.