/AWS1/IF_IOT=>CREATEJOB()¶
About CreateJob¶
Creates a job.
Requires permission to access the CreateJob action.
Method Signature¶
METHODS /AWS1/IF_IOT~CREATEJOB
IMPORTING
!IV_JOBID TYPE /AWS1/IOTJOBID OPTIONAL
!IT_TARGETS TYPE /AWS1/CL_IOTJOBTARGETS_W=>TT_JOBTARGETS OPTIONAL
!IV_DOCUMENTSOURCE TYPE /AWS1/IOTJOBDOCUMENTSOURCE OPTIONAL
!IV_DOCUMENT TYPE /AWS1/IOTJOBDOCUMENT OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/IOTJOBDESCRIPTION OPTIONAL
!IO_PRESIGNEDURLCONFIG TYPE REF TO /AWS1/CL_IOTPRESIGNEDURLCONFIG OPTIONAL
!IV_TARGETSELECTION TYPE /AWS1/IOTTARGETSELECTION OPTIONAL
!IO_JOBEXECSROLLOUTCONFIG TYPE REF TO /AWS1/CL_IOTJOBEXECSRLOUTCFG OPTIONAL
!IO_ABORTCONFIG TYPE REF TO /AWS1/CL_IOTABORTCONFIG OPTIONAL
!IO_TIMEOUTCONFIG TYPE REF TO /AWS1/CL_IOTTIMEOUTCONFIG OPTIONAL
!IT_TAGS TYPE /AWS1/CL_IOTTAG=>TT_TAGLIST OPTIONAL
!IV_NAMESPACEID TYPE /AWS1/IOTNAMESPACEID OPTIONAL
!IV_JOBTEMPLATEARN TYPE /AWS1/IOTJOBTEMPLATEARN OPTIONAL
!IO_JOBEXECUTIONSRETRYCONFIG TYPE REF TO /AWS1/CL_IOTJOBEXECSRETRYCFG OPTIONAL
!IT_DOCUMENTPARAMETERS TYPE /AWS1/CL_IOTPARAMETERMAP_W=>TT_PARAMETERMAP OPTIONAL
!IO_SCHEDULINGCONFIG TYPE REF TO /AWS1/CL_IOTSCHEDULINGCONFIG OPTIONAL
!IT_DSTPACKAGEVERSIONS TYPE /AWS1/CL_IOTDSTPACKAGEVRSS_W=>TT_DESTINATIONPACKAGEVERSIONS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_iotcreatejobresponse
RAISING
/AWS1/CX_IOTINVALIDREQUESTEX
/AWS1/CX_IOTLIMITEXCEEDEDEX
/AWS1/CX_IOTRESRCALRDYEXISTSEX
/AWS1/CX_IOTRESOURCENOTFOUNDEX
/AWS1/CX_IOTSERVICEUNAVAILEX
/AWS1/CX_IOTTHROTTLINGEX
/AWS1/CX_IOTCLIENTEXC
/AWS1/CX_IOTSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_jobid TYPE /AWS1/IOTJOBID /AWS1/IOTJOBID¶
A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use here.
it_targets TYPE /AWS1/CL_IOTJOBTARGETS_W=>TT_JOBTARGETS TT_JOBTARGETS¶
A list of things and thing groups to which the job should be sent.
Optional arguments:¶
iv_documentsource TYPE /AWS1/IOTJOBDOCUMENTSOURCE /AWS1/IOTJOBDOCUMENTSOURCE¶
An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for
document.For example,
--document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0For more information, see Methods for accessing a bucket.
iv_document TYPE /AWS1/IOTJOBDOCUMENT /AWS1/IOTJOBDOCUMENT¶
The job document. Required if you don't specify a value for
documentSource.
iv_description TYPE /AWS1/IOTJOBDESCRIPTION /AWS1/IOTJOBDESCRIPTION¶
A short text description of the job.
io_presignedurlconfig TYPE REF TO /AWS1/CL_IOTPRESIGNEDURLCONFIG /AWS1/CL_IOTPRESIGNEDURLCONFIG¶
Configuration information for pre-signed S3 URLs.
iv_targetselection TYPE /AWS1/IOTTARGETSELECTION /AWS1/IOTTARGETSELECTION¶
Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.
We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the job has been created.
io_jobexecsrolloutconfig TYPE REF TO /AWS1/CL_IOTJOBEXECSRLOUTCFG /AWS1/CL_IOTJOBEXECSRLOUTCFG¶
Allows you to create a staged rollout of the job.
io_abortconfig TYPE REF TO /AWS1/CL_IOTABORTCONFIG /AWS1/CL_IOTABORTCONFIG¶
Allows you to create the criteria to abort a job.
io_timeoutconfig TYPE REF TO /AWS1/CL_IOTTIMEOUTCONFIG /AWS1/CL_IOTTIMEOUTCONFIG¶
Specifies the amount of time each device has to finish its execution of the job. The timer is started when the job execution status is set to
IN_PROGRESS. If the job execution status is not set to another terminal state before the time expires, it will be automatically set toTIMED_OUT.
it_tags TYPE /AWS1/CL_IOTTAG=>TT_TAGLIST TT_TAGLIST¶
Metadata which can be used to manage the job.
iv_namespaceid TYPE /AWS1/IOTNAMESPACEID /AWS1/IOTNAMESPACEID¶
The namespace used to indicate that a job is a customer-managed job.
When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.
$aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/The
namespaceIdfeature is only supported by IoT Greengrass at this time. For more information, see Setting up IoT Greengrass core devices.
iv_jobtemplatearn TYPE /AWS1/IOTJOBTEMPLATEARN /AWS1/IOTJOBTEMPLATEARN¶
The ARN of the job template used to create the job.
io_jobexecutionsretryconfig TYPE REF TO /AWS1/CL_IOTJOBEXECSRETRYCFG /AWS1/CL_IOTJOBEXECSRETRYCFG¶
Allows you to create the criteria to retry a job.
it_documentparameters TYPE /AWS1/CL_IOTPARAMETERMAP_W=>TT_PARAMETERMAP TT_PARAMETERMAP¶
Parameters of an Amazon Web Services managed template that you can specify to create the job document.
documentParameterscan only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them.
io_schedulingconfig TYPE REF TO /AWS1/CL_IOTSCHEDULINGCONFIG /AWS1/CL_IOTSCHEDULINGCONFIG¶
The configuration that allows you to schedule a job for a future date and time in addition to specifying the end behavior for each job execution.
it_dstpackageversions TYPE /AWS1/CL_IOTDSTPACKAGEVRSS_W=>TT_DESTINATIONPACKAGEVERSIONS TT_DESTINATIONPACKAGEVERSIONS¶
The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see Package version lifecycle.
Note:The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_iotcreatejobresponse /AWS1/CL_IOTCREATEJOBRESPONSE¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
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(
io_abortconfig = new /aws1/cl_iotabortconfig(
it_criterialist = VALUE /aws1/cl_iotabortcriteria=>tt_abortcriterialist(
(
new /aws1/cl_iotabortcriteria(
iv_action = |string|
iv_failuretype = |string|
iv_minnumberofexecutedthings = 123
iv_thresholdpercentage = '0.1'
)
)
)
)
io_jobexecsrolloutconfig = new /aws1/cl_iotjobexecsrloutcfg(
io_exponentialrate = new /aws1/cl_iotexprolloutrate(
io_rateincreasecriteria = new /aws1/cl_iotrateincreasecrit(
iv_numberofnotifiedthings = 123
iv_numberofsucceededthings = 123
)
iv_baserateperminute = 123
iv_incrementfactor = '0.1'
)
iv_maximumperminute = 123
)
io_jobexecutionsretryconfig = new /aws1/cl_iotjobexecsretrycfg(
it_criterialist = VALUE /aws1/cl_iotretrycriteria=>tt_retrycriterialist(
(
new /aws1/cl_iotretrycriteria(
iv_failuretype = |string|
iv_numberofretries = 123
)
)
)
)
io_presignedurlconfig = new /aws1/cl_iotpresignedurlconfig(
iv_expiresinsec = 123
iv_rolearn = |string|
)
io_schedulingconfig = new /aws1/cl_iotschedulingconfig(
it_maintenancewindows = VALUE /aws1/cl_iotmaintenancewindow=>tt_maintenancewindows(
(
new /aws1/cl_iotmaintenancewindow(
iv_durationinminutes = 123
iv_starttime = |string|
)
)
)
iv_endbehavior = |string|
iv_endtime = |string|
iv_starttime = |string|
)
io_timeoutconfig = new /aws1/cl_iottimeoutconfig( 123 )
it_documentparameters = VALUE /aws1/cl_iotparametermap_w=>tt_parametermap(
(
VALUE /aws1/cl_iotparametermap_w=>ts_parametermap_maprow(
key = |string|
value = new /aws1/cl_iotparametermap_w( |string| )
)
)
)
it_dstpackageversions = VALUE /aws1/cl_iotdstpackagevrss_w=>tt_destinationpackageversions(
( new /aws1/cl_iotdstpackagevrss_w( |string| ) )
)
it_tags = VALUE /aws1/cl_iottag=>tt_taglist(
(
new /aws1/cl_iottag(
iv_key = |string|
iv_value = |string|
)
)
)
it_targets = VALUE /aws1/cl_iotjobtargets_w=>tt_jobtargets(
( new /aws1/cl_iotjobtargets_w( |string| ) )
)
iv_description = |string|
iv_document = |string|
iv_documentsource = |string|
iv_jobid = |string|
iv_jobtemplatearn = |string|
iv_namespaceid = |string|
iv_targetselection = |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( ).
lv_jobid = lo_result->get_jobid( ).
lv_jobdescription = lo_result->get_description( ).
ENDIF.