IoTHubJobManager Class

A class to provide convenience APIs for IoTHub Job Manager operations, based on top of the auto generated IotHub REST APIs

Inheritance
builtins.object
IoTHubJobManager

Constructor

IoTHubJobManager(connection_string=None, host=None, auth=None)

Parameters

connection_string
default value: None
host
default value: None
auth
default value: None

Methods

cancel_import_export_job

Cancels an import/export job on an IoT hub.

cancel_scheduled_job

Cancels a scheduled job on an IoT hub.

create_import_export_job

Creates a new import/export job on an IoT hub.

create_scheduled_job

Creates a new job to schedule update twins or device direct methods on an IoT hub.

from_connection_string

Classmethod initializer for a IoTHubJobManager Service client. Creates IoTHubJobManager class from connection string.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_token_credential

Classmethod initializer for a IoTHubJobManager Service client. Creates IoTHubJobManager class from host name url and Azure token credential.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

get_import_export_job

Retrieves the status of an import/export job on an IoTHub.

get_import_export_jobs

Retrieves the status of all import/export jobs on an IoTHub.

get_scheduled_job

Retrieves the details of a scheduled job on an IoTHub.

query_scheduled_jobs

Query an IoT hub to retrieve information regarding jobs using the IoT Hub query language.

cancel_import_export_job

Cancels an import/export job on an IoT hub.

cancel_import_export_job(job_id)

Parameters

job_id
str
Required

The ID of the job.

Returns

Object.

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

cancel_scheduled_job

Cancels a scheduled job on an IoT hub.

cancel_scheduled_job(job_id)

Parameters

job_id
str
Required

The ID of the job.

Returns

JobResponse object containing the cancelled job.

Return type

<xref:azure.iot.hub.models.JobResponse>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

create_import_export_job

Creates a new import/export job on an IoT hub.

create_import_export_job(job_properties)

Parameters

job_properties
<xref:azure.iot.hub.models.JobProperties>
Required

Specifies the job specification.

Returns

JobProperties object containing the created job.

Return type

<xref:azure.iot.hub.models.JobProperties>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

create_scheduled_job

Creates a new job to schedule update twins or device direct methods on an IoT hub.

create_scheduled_job(job_id, job_request)

Parameters

job_id
str
Required

The ID of the job.

job_request
<xref:azure.iot.hub.models.JobRequest>
Required

Specifies the job.

Returns

JobResponse object containing the created job.

Return type

<xref:azure.iot.hub.models.JobResponse>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

from_connection_string

Classmethod initializer for a IoTHubJobManager Service client. Creates IoTHubJobManager class from connection string.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_connection_string(connection_string)

Parameters

connection_string
str
Required

The IoTHub connection string used to authenticate connection with IoTHub.

connection_string
Required

Return type

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

from_token_credential

Classmethod initializer for a IoTHubJobManager Service client. Creates IoTHubJobManager class from host name url and Azure token credential.

After a successful creation the class has been authenticated with IoTHub and it is ready to call the member APIs to communicate with IoTHub.

from_token_credential(url, token_credential)

Parameters

url
str
Required

The Azure service url (host name).

token_credential
str
Required

The Azure token credential object.

token_credential
Required

Return type

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

get_import_export_job

Retrieves the status of an import/export job on an IoTHub.

get_import_export_job(job_id)

Parameters

job_id
str
Required

The ID of the job.

Returns

The JobProperties object containing the requested job.

Return type

<xref:azure.iot.hub.models.JobProperties>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

get_import_export_jobs

Retrieves the status of all import/export jobs on an IoTHub.

get_import_export_jobs()

Returns

The list[job_properties] object.

Return type

list[<xref:azure.iot.hub.models.JobProperties>]

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

get_scheduled_job

Retrieves the details of a scheduled job on an IoTHub.

get_scheduled_job(job_id)

Parameters

job_id
str
Required

The ID of the job.

Returns

The JobResponse object containing the requested details.

Return type

<xref:azure.iot.hub.models.JobResponse>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

query_scheduled_jobs

Query an IoT hub to retrieve information regarding jobs using the IoT Hub query language.

query_scheduled_jobs(job_type, job_status)

Parameters

job_type
str
Required

The type of the jobs.

job_status
str
Required

The status of the jobs.

Returns

QueryResult object containing the jobs.

Return type

<xref:azure.iot.hub.models.QueryResult>

Exceptions

<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>