Automated Management

The automated management (also known as Batch Jobs) provides a tool to schedule th execution of device management operations on a predefined set of target devices.

This tool is meant to ease the management of large number of devices with similar purposes.


The automated management feature is composed of the following main pieces:

  • Targets
  • Job steps
  • Scheduling
  • Executions


The targets represent the devices to which the management operations will be submitted. Per each target enlisted, the Jobs view reports information regarding the status of the processing.

A target is unique for each job and belongs to only one Job. You can specify a target which refers the same device in two separate jobs.

Job Steps

A job can be configured to have one or more steps to be executed. Steps can be chained one after the other. During its execution, the job will submit the device management operations defined within the steps following the step sequence.

Job step definitions

There is a list of available Job Step Definitions. Each definitions represent a device management operation that can be chained to compose a job. Each Job Step Definition has a title which resemble the action and a set of input parameters. Input parameters can be simple types or complex objects but they usually match the API of their Device Management Services.


After a set of targets and a set of Job steps have been defined, the Job can be started. Only one execution at a time can run for the same job instance, while you can have multiple execution running different jobs.


An Automated Management operation can either be started by the user on demand or it can be started by a trigger.

A Job trigger will automatically start a job at the defined time according to its schedule. Time can be defined with two methods:

  • Simple: defining a start and stop date, with a retry interval which can be defined in minutes, hours or days.
  • Cron Expression: using a Cron expression that can be bound between a start and end date.

A Job can have multiple schedules but each execution will always be one at a time.

Creating a Job

A job can be created through the Web Admin Console application. The prerequisites are the following:

  • Batch Job resources assigned to the account: the scope must have at least one Batch Job allowed in the account settings. Number of targets, steps, executions and triggers are not limited.
  • One or more device registered into the account: a job needs at least one device to associate a target with it.
  • One or more Job Step Definition: a job needs at least one step to start.
  • A user with job:*:{yourScopeId}:* permissions.

To create a Batch Job first you need to login into an existing account with the prerequisites described above and open the Batch Jobs view.

In here all created Batch Jobs will be listed with some informations on their status.
To create a new Batch Job select the Add button on the toolbar on the top grid.


Job add dialog example

The name of the job must be unique in the scope. It is advisable to use name that can make an entry easily recognizable.

Adding the targets

After the Batch Job has been created it can be selected, which enables the tabs underneath.

The Targets tab list and allow managing of the targets assigned to a single batch job. Like before, to add a new Target click on the Add button on the toolbar on the bottom grid.


Job target add dialog example

In this add dialog you can select all Devices available in the scope or select them one by one. Listed on the grid are the pairs of deviceId and display name of the devices.
Once you selected the desired target devices you can submit the form and the targets will be listed on the Targets grid.

In the grid informations on the processing status are shown, like at what processing step the device is (starting from 0) and what was the result of the processing at that step.

The list of Targets can be changed until the first start of the job. Then it becomes unmodifiable.

Adding the steps

Moving to the tab Steps the ordered list of Step defined for the job. Once again to add a new Step click on the Add button on the toolbar on the bottom grid.


Job Step add dialog example with a Command Management Execution

In this dialog you can give a unique name to the Step and an optional description.

Using the dropdown menu you can select the type of the Step. Listed are the available JobStepdefinitions. Each JobStepDefinition has its own set of property and, by selecting different JobStepDefinitions the dialog adapts to the properties available.

According to the type of the input parameter, an input field or a textarea will be shown.
All primitive types, enums and KapuaIds will have an input fields and can be specifies as their String representation.
All other types of input parameter will be rendered on textareas and they must be specified according to their XML representation.

After submitting the form, a new Job Step will be listed in the grid. Adding one or more step of any kind, will append steps to the list.

Manually execute a job

After Job Targets have been added and Job Steps defined, the job can be started manually by pressing Start button in the Job view toolbar.

Targets will be submitted the operation defined in the job step and the processing status will be updated consistently. If the step succeeds, the Job Target status will be set to:

  • AWAITING PROCESSING if the step was successful and there are more steps to be executed on the target
  • COMPLETED if the step was successful and there are no more steps to be executed on the target
  • FAILED if the step was un-successful. In this case the processing does not continue on the following steps.

Until all the targets have been processed for the current Job Step the processing of the next Job Step will not occur. If the Job has already had an execution, starting again the Job will cause all Job Targets that have failed at some point to be reprocessed from the Job Step which they previously failed.

For each execution, a new Job Execution entry in created with information about the processing.


Jobs run in background. At any time you can connect to the console and check the progress of the processing by looking at both the status of the target and the list of executions.

Schedule a Job execution

If you want the job to be executed at a some point in time and/or apply a specific retry policy, you can set a Scheduled Trigger to run the Job.

Trigger can be added from the tab Schedules. We can define a simple scheduling with a time interval or use a Cron Expression, according to our requirements.


Jobs run in background. At any time you can connect to the console and check the progress of the processing by looking at both the status of the target and the list of executions.