/AWS1/IF_IOS=>CREATETASK()¶
About CreateTask¶
Creates a new task in the specified workspace. A task defines a reusable containerized compute workload that can be referenced by one or more pipeline compute nodes.
Specify a containerTaskConfiguration for custom container workloads with
configurable ECR image, processing type, processing unit, and environment variables.
Method Signature¶
METHODS /AWS1/IF_IOS~CREATETASK
IMPORTING
!IV_WORKSPACENAME TYPE /AWS1/IOSWORKSPACENAME OPTIONAL
!IV_TASKNAME TYPE /AWS1/IOSRESOURCENAME OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/IOSDESCRIPTION OPTIONAL
!IO_TASKCONFIGURATION TYPE REF TO /AWS1/CL_IOSTASKCONFIGURATION OPTIONAL
!IT_TAGS TYPE /AWS1/CL_IOSTAGMAP_W=>TT_TAGMAP OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/IOSCLIENTTOKEN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_ioscreatetaskresponse
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 workspace.
iv_taskname TYPE /AWS1/IOSRESOURCENAME /AWS1/IOSRESOURCENAME¶
The name of the task to create. Must be unique within the workspace.
io_taskconfiguration TYPE REF TO /AWS1/CL_IOSTASKCONFIGURATION /AWS1/CL_IOSTASKCONFIGURATION¶
The task execution configuration. Specify a containerTaskConfiguration for custom container workloads.
Optional arguments:¶
iv_description TYPE /AWS1/IOSDESCRIPTION /AWS1/IOSDESCRIPTION¶
A description of the task.
it_tags TYPE /AWS1/CL_IOSTAGMAP_W=>TT_TAGMAP TT_TAGMAP¶
A list of key-value pairs that contain metadata for the task. For more information, see Tagging your AWS IoT SiteWise resources in the AWS IoT SiteWise User Guide.
iv_clienttoken TYPE /AWS1/IOSCLIENTTOKEN /AWS1/IOSCLIENTTOKEN¶
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token, the server returns the cached result from the original successful request without performing the operation again.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_ioscreatetaskresponse /AWS1/CL_IOSCREATETASKRESPONSE¶
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->createtask(
io_taskconfiguration = new /aws1/cl_iostaskconfiguration(
io_containertaskconf = new /aws1/cl_ioscontainertaskconf(
it_command = VALUE /aws1/cl_ioscommandlist_w=>tt_commandlist(
( new /aws1/cl_ioscommandlist_w( |string| ) )
)
it_environmentvariables = VALUE /aws1/cl_iosenvvariablesmap_w=>tt_environmentvariablesmap(
(
VALUE /aws1/cl_iosenvvariablesmap_w=>ts_envvariablesmap_maprow(
key = |string|
value = new /aws1/cl_iosenvvariablesmap_w( |string| )
)
)
)
iv_ecruri = |string|
iv_processingtype = |string|
iv_processingunit = |string|
iv_taskexecutionrole = |string|
iv_timeoutseconds = 123
)
)
it_tags = VALUE /aws1/cl_iostagmap_w=>tt_tagmap(
(
VALUE /aws1/cl_iostagmap_w=>ts_tagmap_maprow(
key = |string|
value = new /aws1/cl_iostagmap_w( |string| )
)
)
)
iv_clienttoken = |string|
iv_description = |string|
iv_taskname = |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_resourcename = lo_result->get_taskname( ).
lv_arn = lo_result->get_taskarn( ).
lv_version = lo_result->get_version( ).
lo_resourcestatus = lo_result->get_status( ).
IF lo_resourcestatus IS NOT INITIAL.
lo_resourceerror = lo_resourcestatus->get_error( ).
IF lo_resourceerror IS NOT INITIAL.
lv_resourceerrorcode = lo_resourceerror->get_code( ).
lv_string = lo_resourceerror->get_message( ).
ENDIF.
lv_resourcestate = lo_resourcestatus->get_state( ).
ENDIF.
ENDIF.