The AWS IoT jobs service can be used to define a set of remote operations that are sent to and executed on one or more devices connected to AWS IoT.

AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#jobs-mqtt-api

Hierarchy

  • IotJobsClient

Constructors

Methods - IotJobs

  • Gets detailed information about a job execution.

    If the device is offline, the PUBLISH packet will be sent once the connection resumes.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution

    Parameters

    Returns Promise<MqttRequest>

    Promise which returns a mqtt.MqttRequest which will contain the packet id of the PUBLISH packet.

    • For QoS 0, completes as soon as the packet is sent.
    • For QoS 1, completes when PUBACK is received.
    • QoS 2 is not supported by AWS IoT.
  • Gets the list of all jobs for a thing that are not in a terminal state.

    If the device is offline, the PUBLISH packet will be sent once the connection resumes.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions

    Parameters

    Returns Promise<MqttRequest>

    Promise which returns a mqtt.MqttRequest which will contain the packet id of the PUBLISH packet.

    • For QoS 0, completes as soon as the packet is sent.
    • For QoS 1, completes when PUBACK is received.
    • QoS 2 is not supported by AWS IoT.
  • Gets and starts the next pending job execution for a thing (status IN_PROGRESS or QUEUED).

    If the device is offline, the PUBLISH packet will be sent once the connection resumes.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution

    Parameters

    Returns Promise<MqttRequest>

    Promise which returns a mqtt.MqttRequest which will contain the packet id of the PUBLISH packet.

    • For QoS 0, completes as soon as the packet is sent.
    • For QoS 1, completes when PUBACK is received.
    • QoS 2 is not supported by AWS IoT.
  • Updates the status of a job execution. You can optionally create a step timer by setting a value for the stepTimeoutInMinutes property. If you don't update the value of this property by running UpdateJobExecution again, the job execution times out when the step timer expires.

    If the device is offline, the PUBLISH packet will be sent once the connection resumes.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution

    Parameters

    • request: UpdateJobExecutionRequest

      Message to be serialized and sent

    • qos: QoS

      Quality of Service for delivering this message

    Returns Promise<MqttRequest>

    Promise which returns a mqtt.MqttRequest which will contain the packet id of the PUBLISH packet.

    • For QoS 0, completes as soon as the packet is sent.
    • For QoS 1, completes when PUBACK is received.
    • QoS 2 is not supported by AWS IoT.
  • Subscribes to the accepted topic for the DescribeJobExecution operation

    subscribeToDescribeJobExecutionAccepted may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution

    Parameters

    • request: DescribeJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the rejected topic for the DescribeJobExecution operation

    subscribeToDescribeJobExecutionRejected may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution

    Parameters

    • request: DescribeJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the accepted topic for the GetPendingJobsExecutions operation

    subscribeToGetPendingJobExecutionsAccepted may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions

    Parameters

    • request: GetPendingJobExecutionsSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the rejected topic for the GetPendingJobsExecutions operation

    subscribeToGetPendingJobExecutionsRejected may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions

    Parameters

    • request: GetPendingJobExecutionsSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to JobExecutionsChanged notifications for a given IoT thing.

    subscribeToJobExecutionsChangedEvents may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-jobexecutionschanged

    Parameters

    • request: JobExecutionsChangedSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • subscribeToNextJobExecutionChangedEvents may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-nextjobexecutionchanged

    Parameters

    • request: NextJobExecutionChangedSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the accepted topic for the StartNextPendingJobExecution operation

    subscribeToStartNextPendingJobExecutionAccepted may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution

    Parameters

    • request: StartNextPendingJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the rejected topic for the StartNextPendingJobExecution operation

    subscribeToStartNextPendingJobExecutionRejected may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution

    Parameters

    • request: StartNextPendingJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the accepted topic for the UpdateJobExecution operation

    subscribeToUpdateJobExecutionAccepted may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution

    Parameters

    • request: UpdateJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

  • Subscribes to the rejected topic for the UpdateJobExecution operation

    subscribeToUpdateJobExecutionRejected may be called while the device is offline, though the async operation cannot complete successfully until the connection resumes.

    Once subscribed, messageHandler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

    AWS documentation: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution

    Parameters

    • request: UpdateJobExecutionSubscriptionRequest

      Subscription request configuration

    • qos: QoS

      Maximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK

    • messageHandler: ((error?, response?) => void)

      Callback invoked when message or error is received from the server.

    Returns Promise<MqttSubscribeRequest>

    Promise which returns a mqtt.MqttSubscribeRequest which will contain the result of the SUBSCRIBE. The Promise resolves when a SUBACK is returned from the server or is rejected when an exception occurs.

Methods - Other

  • Creates a new IotJobsClient that uses the SDK Mqtt5 client internally.

    The pre-existing constructor that is bound to the MQTT311 client makes this awkward since we must support

    new IotJobsClient(mqtt311connection);
    

    for backwards compatibility, but still want to be able to inject an MQTT5 client as well.

    Parameters

    • client: Mqtt5Client

      the MQTT5 client to use with this service client

    Returns IotJobsClient

    a new IotJobsClient instance

Generated using TypeDoc