Skip to content

/AWS1/IF_IOS=>CREATEENRICHMENTJOB()

About CreateEnrichmentJob

Creates an asynchronous enrichment job to analyze time-series sensor data. The operation returns immediately with job details while processing continues in the background.

Idempotency

Include a clientToken to make the operation idempotent. If you submit the same request with the same token within the idempotency window, you receive the original job details without creating a duplicate.

Prerequisites

Before creating a job, ensure:

  • The workspace is in ACTIVE state (not being deleted)
  • You have IAM permissions for the workspace, dataset, and time-series resources
  • You have KMS Decrypt permission on the workspace's customer-managed encryption key
  • No duplicate job (same workspace, dataset, property, and job type) is currently running

Workflow

  1. Submit the job with configuration specifying which video data to analyze and the time range
  2. Capture the jobId from the response
  3. Use DescribeEnrichmentJob to monitor progress and check job status
  4. When status reaches a terminal state (COMPLETED, FAILED, TIMED_OUT, CANCELLED), check results
  5. For COMPLETED jobs, query IoT SiteWise for semantic search on video events

Error Handling

  • ConflictingOperationException: A duplicate job is already running for the same configuration
  • InvalidRequestException: Invalid parameters (e.g., both timeSeriesId and propertyAlias specified)
  • AccessDeniedException: Insufficient IAM or KMS permissions
  • LimitExceededException: Too many concurrent jobs or requests

Method Signature

METHODS /AWS1/IF_IOS~CREATEENRICHMENTJOB
  IMPORTING
    !IV_WORKSPACENAME TYPE /AWS1/IOSWORKSPACENAME OPTIONAL
    !IO_JOBCONFIGURATION TYPE REF TO /AWS1/CL_IOSENRICHMENTJOBCONF OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/IOSCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ioscreenrchmntjobrsp
  RAISING
    /AWS1/CX_IOSACCESSDENIEDEX
    /AWS1/CX_IOSCNFLCTOPERATIONEX
    /AWS1/CX_IOSINTERNALFAILUREEX
    /AWS1/CX_IOSINVALIDREQUESTEX
    /AWS1/CX_IOSLIMITEXCEEDEDEX
    /AWS1/CX_IOSRESOURCENOTFOUNDEX
    /AWS1/CX_IOSTHROTTLINGEX
    /AWS1/CX_IOSCLIENTEXC
    /AWS1/CX_IOSSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_workspacename TYPE /AWS1/IOSWORKSPACENAME /AWS1/IOSWORKSPACENAME

The name of the IoT SiteWise workspace containing the video data to analyze.

io_jobconfiguration TYPE REF TO /AWS1/CL_IOSENRICHMENTJOBCONF /AWS1/CL_IOSENRICHMENTJOBCONF

Configuration defining the type of enrichment analysis to perform and which video data to analyze. Currently supports eventDetection for generating embeddings from video data for semantic search.

Optional arguments:

iv_clienttoken TYPE /AWS1/IOSCLIENTTOKEN /AWS1/IOSCLIENTTOKEN

Optional unique token that makes the operation idempotent. If you submit the same request with the same token within the idempotency window, the service returns the original job without creating a duplicate. Use a UUID or timestamp-based token for each unique request.

RETURNING

oo_output TYPE REF TO /aws1/cl_ioscreenrchmntjobrsp /AWS1/CL_IOSCREENRCHMNTJOBRSP

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->createenrichmentjob(
  io_jobconfiguration = new /aws1/cl_iosenrichmentjobconf(
    io_eventdetection = new /aws1/cl_ioseventdetection(
      io_trimsettings = new /aws1/cl_iosenrchmnttrimstgs(
        io_endtime = new /aws1/cl_iostimeinnanos(
          iv_offsetinnanos = 123
          iv_timeinseconds = 123
        )
        io_starttime = new /aws1/cl_iostimeinnanos(
          iv_offsetinnanos = 123
          iv_timeinseconds = 123
        )
      )
      iv_datasetid = |string|
      iv_propertyalias = |string|
      iv_timeseriesid = |string|
    )
  )
  iv_clienttoken = |string|
  iv_workspacename = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_id = lo_result->get_jobid( ).
  lv_enrichmentjobstatus = lo_result->get_status( ).
  lv_timestamp = lo_result->get_createdat( ).
ENDIF.