Service - Get Job

Retrieves details of a scheduled job from an IoT hub.
Retrieves details of a scheduled job from an IoT hub. See https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-jobs for more information.

GET https://fully-qualified-iothubname.azure-devices.net/jobs/v2/{id}?api-version=2018-06-30

URI Parameters

Name In Required Type Description
id
path True
  • string

Job ID.

api-version
query True
  • string

Version of the Api.

Responses

Name Type Description
200 OK

Returns the Job response object

Definitions

CloudToDeviceMethod

Parameters to execute a direct method on the device

DeviceCapabilities

Status of Capabilities enabled on the device

DeviceJobStatistics

The job counts, e.g., number of failed/succeeded devices

JobResponse
Twin

Twin Representation

TwinProperties

Represents Twin properties

X509Thumbprint

CloudToDeviceMethod

Parameters to execute a direct method on the device

Name Type Description
connectTimeoutInSeconds
  • integer
methodName
  • string

Method to run

payload
  • object

Payload

responseTimeoutInSeconds
  • integer

DeviceCapabilities

Status of Capabilities enabled on the device

Name Type Description
iotEdge
  • boolean

DeviceJobStatistics

The job counts, e.g., number of failed/succeeded devices

Name Type Description
deviceCount
  • integer

Number of devices in the job

failedCount
  • integer

The number of failed jobs

pendingCount
  • integer

The number of pending (scheduled) jobs

runningCount
  • integer

The number of running jobs

succeededCount
  • integer

The number of Successed jobs

JobResponse

Name Type Description
cloudToDeviceMethod

Required if jobType is cloudToDeviceMethod. The method type and parameters.

createdTime
  • string

System generated. Ignored at creation.

deviceJobStatistics

Job details

endTime
  • string

System generated. Ignored at creation. Represents the time the job stopped processing.

failureReason
  • string

System generated. Ignored at creation. If status == failure, this represents a string containing the reason.

jobId
  • string

System generated. Ignored at creation.

maxExecutionTimeInSeconds
  • integer

Max execution time in secounds (ttl duration)

queryCondition
  • string

Device query condition.

startTime
  • string

Scheduled job start time in UTC.

status enum:
  • cancelled
  • completed
  • enqueued
  • failed
  • queued
  • running
  • scheduled
  • unknown

System generated. Ignored at creation.

statusMessage
  • string

Status message for the job

type enum:
  • backup
  • export
  • factoryResetDevice
  • failoverDataCopy
  • firmwareUpdate
  • import
  • readDeviceProperties
  • rebootDevice
  • restoreFromBackup
  • scheduleDeviceMethod
  • scheduleUpdateTwin
  • unknown
  • updateDeviceConfiguration
  • writeDeviceProperties

Required. The type of job to execute.

updateTwin

Twin Representation

Twin

Twin Representation

Name Type Description
authenticationType enum:
  • certificateAuthority
  • none
  • sas
  • selfSigned

Corresponding Device's authentication type

capabilities

Status of Capabilities enabled on the device

cloudToDeviceMessageCount
  • integer

Number of messages sent to the corresponding Device from the Cloud

connectionState enum:
  • Connected
  • Disconnected

Corresponding Device's ConnectionState

deviceEtag
  • string

Device's ETag

deviceId
  • string

The deviceId uniquely identifies the device in the IoT hub's identity registry. A case-sensitive string (up to 128 char long) of ASCII 7-bit alphanumeric chars + {'-', ':', '.', '+', '%', '_', '#', '*', '?', '!', '(', ')', ',', '=', '@', ';', '$', '''}.

etag
  • string

Twin's ETag

lastActivityTime
  • string

The last time the device connected, received or sent a message. In ISO8601 datetime format in UTC, for example, 2015-01-28T16:24:48.789Z. This does not update if the device uses the HTTP/1 protocol to perform messaging operations.

moduleId
  • string

Gets and sets the Module Id.

properties

Gets and sets the Twin properties.

status enum:
  • disabled
  • enabled

Gets the corresponding Device's Status.

statusReason
  • string

Reason, if any, for the corresponding Device to be in specified Status

statusUpdateTime
  • string

Time when the corresponding Device's Status was last updated

tags
  • object

A JSON document read and written by the solution back end. Tags are not visible to device apps.

version
  • integer

Version for device twin, including tags and desired properties

x509Thumbprint

Corresponding Device's X509 thumbprint

TwinProperties

Represents Twin properties

Name Type Description
desired
  • object

Used in conjunction with reported properties to synchronize device configuration or condition. Desired properties can only be set by the solution back end and can be read by the device app. The device app can also be notified in real time of changes on the desired properties.

reported
  • object

Used in conjunction with desired properties to synchronize device configuration or condition. Reported properties can only be set by the device app and can be read and queried by the solution back end.

X509Thumbprint

Name Type Description
primaryThumbprint
  • string
secondaryThumbprint
  • string