Returns the list of all Device Job of the current account with pagination.
name | type | description | default | constraints |
---|---|---|---|---|
displayName | query | If specified result are filtered by display name. Display name is not unique so more than one result can be obtained. | ||
limit | query | Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 50 | required |
offset | query | Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 0 | required |
useLike | query | If false the method matches the whole display name. If true the method matches all display names that starts with the specified display name. | false | required |
media type | data type | description |
---|---|---|
application/json | DeviceJobsResult (JSON) | The list of all Device Job of the current account |
application/xml | deviceJobsResult (XML) |
GET /deviceJobs
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"deviceJob" : [ {
"status" : "WAITING_FOR_DEVICES",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_config_update",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
}, {
"status" : "RUNNING",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_certificate_update",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
} ],
"limitExceeded" : true
}
Creates and schedule a Device Job based on the information in the DeviceJobCreator.
This Job is used to change the configuration of one ore more components on all target ClientIDs.
The configuration file must be specified on the JobAttachment field, while anything wrote in the jobPropertiesMap field is ignored.
Please refer to JobAttachmentCreator documentation.
This Job is used to install or update a package on all target ClientIDs that support DEPLOY-V1 application.
The package to be installed via:
Name | Type | Mandatory | Default Value |
---|---|---|---|
deployUrl | String | Yes |
This Job is used to install or update a package on all target ClientIDs that support DEPLOY-V2 application.
Properties needs to be added to jobPropertiesMap field. Available properties for this type of job are listed below.
Name | Type | Mandatory | Default Value | Description |
---|---|---|---|---|
dp.uri | String | Yes | The deployment package (or .sh script) URI where to download the file. | |
dp.name | String | yes | The deployment package name to install. This is used on the device to search for already installed version of this package. |
|
dp.version | String | Yes | The deployment package version to install. This is used on the device to manage the updates of the packages. |
|
dp.download.protocol | String | No | HTTP | The protocol used to download the file from the URI Available protocols:
|
dp.download.block.size | Integer | No | null | The size in Byte of the blocks used to download the DP via HTTP. |
dp.download.block.delay | Integer | No | 0 | Delay in ms between block transfers. |
dp.download.notify.block.size | Integer | No | null | The interval of Bytes between notification messages. |
dp.download.timeout | Integer | No | 60000 | The timeout in ms to be used to download the DP via HTTP. |
dp.download.resume | Boolean | No | true | Resume HTTP transfer if supported by the server. |
dp.download.force | Boolean | No | true | Force the download of the file, even if it has been already downloaded and saved to the file system of the device. |
dp.download.username | String | No | null | Username for password protected http download. No authentication will be tried if username is not present. |
dp.download.password | String | No | null | Password for password protected http download. No authentication will be tried if password is not present. |
dp.download.hash | String | No | null | The algorithm and value of the hash of the file used to verify the integrity of the download. The format is of this property is: {algorithm}:{hashValue} Available algorithm:
|
dp.install | Boolean | No | true | Whether the package should be immediately installed after being downloaded. |
dp.install.system.update | Boolean | No | false | Mark this install as a system install. The device needs to know if this is a system update rather than a bundle/package update. |
dp.install.verifier.uri | String | No | null | The verifier script URI to run after the installation of the system update. If not given the device will consider the operation successfully completed if is able to run the system update. |
dp.reboot | Boolean | No | false | Whether the system should be rebooted as part of the package installation process. |
dp.reboot.delay | Integer | No | 0 | Delay in ms after which the device will be rebooted. Only meaningful if dp.reboot==true. |
This Job is used to uninstall a package on all target Client IDs.
The package name must match the package name installed on the target client IDs that support DEPLOY-V1 application.
The package name must be declared in the JobProperties field. Anything set in JobAttachment field will be ignored.
Properties needs to be added to jobPropertiesMap field. Available properties for this type of job are listed below.
Name | Type | Mandatory | Default Value |
---|---|---|---|
packageName | String | Yes |
This Job is used to uninstall a package on all target ClientIDs that support DEPLOY-V2 application.
Properties needs to be added to jobPropertiesMap field. Available properties for this type of job are listed below.
Name | Type | Mandatory | Default Value | Description |
---|---|---|---|---|
dp.name | String | Yes | The deployment package symbolic name to uninstall. This is used on the device to select which package will be uninstalled. |
|
dp.reboot | Boolean | No | false | Whether the system should be rebooted as part of the package uninstall process. |
dp.reboot.delay | Integer | No | 0 | Delay in ms after which the device will be rebooted. Only meaningful if dp.reboot==true. |
This Job is used to execute a remote command on the target device.
The command must be a recognized command by the OS installed on your device. The working directory of the execution will be /tmp/ of the device.
It is possible to attach a file to this job that will be uploaded to the target device into /tmp/ directory. The file attached must be in a valid .zip compressed format, and it will be
automatically decompressed by the device on receiving.
The command must be declared in the JobProperties field. The optional file attached must be specified on the JobAttachment field. Please refer to JobAttachmentCreator documentation.
Is not possible to concatenate more command using | (pipe) or > (close angular parenthesis).
For example the command "cat text.txt | grep test" does not work as concatenation of both commands, but all string except the first will be passed as parameters of the first string, that
represent the command, with the result of executing cat of four files.
To achieve concatenation of parameters or more complicated executions please create a script and add it as attachment of the job and then use the command to run the script.
Properties needs to be added to jobPropertiesMap field. Available properties for this type of job are listed below.
Name | Type | Mandatory | Default Value |
---|---|---|---|
command | String | Yes |
This scheduling needs:
This scheduling needs:
media type | data type |
---|---|
application/json | DeviceJobCreator (JSON) |
application/xml | deviceJobCreator (XML) |
media type | data type | description |
---|---|---|
application/json | DeviceJob (JSON) | |
application/xml | deviceJob (XML) |
POST /deviceJobs
Content-Type: application/json
Accept: application/json
{
"accountId" : 12345,
"jobType" : "device_software_install",
"jobDisplayName" : "...",
"jobAttachment" : {
"name" : "...",
"contentType" : "BUNDLE",
"body" : "..."
},
"targetClientIds" : [ "...", "..." ],
"targetDeviceTag" : [ 12345, 12345 ],
"startOn" : 12345,
"endOn" : 12345,
"timezoneInMins" : 12345,
"cronRetryExpression" : "...",
"retryEvery" : 12345,
"retryMaxAttempts" : 12345,
"selectAllClientIds" : true,
"jobPropertiesMap" : {
"parameter" : [ {
"name" : "...",
"value" : "..."
}, {
"name" : "...",
"value" : "..."
} ]
},
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345
}
HTTP/1.1 201 Created
Content-Type: application/json
{
"status" : "COMPLETED",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_software_install",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
}
Deletes the device job specified in the path parameter and related data of executions and target clientIDs.
name | type | description | constraints |
---|---|---|---|
deviceJobId | path | required |
DELETE /deviceJobs/{deviceJobId}
Content-Type: */*
...
HTTP/1.1 204 No Content
Return the device job specified in the path parameter
name | type | description | constraints |
---|---|---|---|
deviceJobId | path | required |
media type | data type | description |
---|---|---|
application/json | DeviceJob (JSON) | The requested device job |
application/xml | deviceJob (XML) |
GET /deviceJobs/{deviceJobId}
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"status" : "STARTED",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_certificate_revoke",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
}
Updates the max number of retries for the specified device job.
The number set must greater of the current retries.
name | type | description | constraints |
---|---|---|---|
deviceJobId | path | required |
media type | data type |
---|---|
application/json | DeviceJob (JSON) |
application/xml | deviceJob (XML) |
media type | data type | description |
---|---|---|
application/json | DeviceJob (JSON) | |
application/xml | deviceJob (XML) |
PUT /deviceJobs/{deviceJobId}
Content-Type: application/json
Accept: application/json
{
"status" : "STOPPED",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_certificate_update",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
}
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "STARTED",
"cronRetryExpression" : "...",
"endOn" : 12345,
"cronNextRetryOn" : 12345,
"retryEvery" : 12345,
"resumed" : true,
"requestTimeout" : 12345,
"processOnConnect" : true,
"sendWakeupSMS" : true,
"wakeupTimeout" : 12345,
"deviceInactivityTimeout" : 12345,
"id" : 12345,
"accountId" : 12345,
"jobType" : "device_command",
"displayName" : "...",
"jobProperties" : "...",
"createdOn" : 12345,
"createdBy" : 12345,
"startOn" : 12345,
"retryMaxAttempts" : 12345,
"retryCount" : 12345,
"optlock" : 12345
}
Return the list of the executions for the specified Device Job supporting pagination. The device job executions contains the log of the execution.
name | type | description | default | constraints |
---|---|---|---|---|
deviceJobId | path | required | ||
fetchLogs | query | true | required | |
limit | query | Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 50 | required |
offset | query | Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 0 | required |
media type | data type | description |
---|---|---|
application/json | DeviceJobExecutionsResult (JSON) | |
application/xml | deviceJobExecutionsResult (XML) |
GET /deviceJobs/{deviceJobId}/executions
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"deviceJobExecution" : [ {
"status" : "STOPPED",
"accountId" : 12345,
"jobId" : 12345,
"executionId" : 12345,
"startedOn" : 12345,
"endedOn" : 12345,
"log" : "...",
"optlock" : 12345
}, {
"status" : "STOPPED",
"accountId" : 12345,
"jobId" : 12345,
"executionId" : 12345,
"startedOn" : 12345,
"endedOn" : 12345,
"log" : "...",
"optlock" : 12345
} ],
"limitExceeded" : true
}
Return the list of the target of the specified device job supporting pagination. It also supports filtering by DeviceJobTargetStatus. If not specified all DevicesJobTargetStatus are selected.
name | type | description | default | constraints | multivalued |
---|---|---|---|---|---|
deviceJobId | path | required | no | ||
deviceStatuses | query | "CERIFICATE_UPDATED" or "CREATED" or "REQUEST_CANCELLED" or "REQUEST_CANCELLING" or "REQUEST_COMPLETED" or "REQUEST_FAILED" or "REQUEST_FAILED_CERTIFICATE_REVOKE" or "REQUEST_FAILED_CERTIFICATE_UPDATE" or "REQUEST_IN_PROGRESS" or "REQUEST_RECEIVED" or "REQUEST_SENT" or "REQUEST_TIMEOUT" or "VERIFICATION_COMPLETED" or "VERIFICATION_STARTED" or "WAITING_CONN" or "WAITING_WAKEUP" or "WAKEUP_COMPLETED" or "WAKEUP_FAILED" | yes | ||
limit | query | Maximum number of entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 50 | required | no |
offset | query | Starting offset for the entries to be returned. Note that an error will be returned if the maximum allowed value is exceeded. | 0 | required | no |
media type | data type | description |
---|---|---|
application/json | DeviceJobTargetsResult (JSON) | |
application/xml | deviceJobTargetsResult (XML) |
GET /deviceJobs/{deviceJobId}/targets
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"deviceJobTargets" : [ {
"accountId" : 12345,
"jobId" : 12345,
"clientId" : "...",
"createdOn" : 12345,
"modifiedOn" : 12345,
"status" : "CREATED",
"statusMessage" : "...",
"lastUpdateOn" : 12345,
"progressPercentage" : 12345
}, {
"accountId" : 12345,
"jobId" : 12345,
"clientId" : "...",
"createdOn" : 12345,
"modifiedOn" : 12345,
"status" : "CREATED",
"statusMessage" : "...",
"lastUpdateOn" : 12345,
"progressPercentage" : 12345
} ],
"limitExceeded" : true
}
Get the information for the specified Target Client ID in the specified Device Job
name | type | description | constraints |
---|---|---|---|
deviceJobId | path | required | |
targetClientId | path |
media type | data type | description |
---|---|---|
application/json | DeviceJobTarget (JSON) | |
application/xml | deviceJobTarget (XML) |
GET /deviceJobs/{deviceJobId}/targets/{targetClientId}
Content-Type: */*
Accept: application/json
...
HTTP/1.1 200 OK
Content-Type: application/json
{
"accountId" : 12345,
"jobId" : 12345,
"clientId" : "...",
"createdOn" : 12345,
"modifiedOn" : 12345,
"status" : "REQUEST_FAILED_CERTIFICATE_UPDATE",
"statusMessage" : "...",
"lastUpdateOn" : 12345,
"progressPercentage" : 12345
}
Send a stop signal to the device job execution.
The stop signal will be captured only at next target, so is not possible to stop the device job during the current item processed.
Be careful that stopping a device job can be harmful for the target devices
name | type | description | constraints |
---|---|---|---|
deviceJobExecutionId | path | required | |
deviceJobId | path | the device job id to stop | required |
POST /deviceJobs/{deviceJobId}/executions/{deviceJobExecutionId}/sendStopSignal
Content-Type: */*
...
HTTP/1.1 201 Created