Registry class

The Registry class provides access to the IoT Hub device identity service. Users of the SDK should instantiate this class with one of the factory methods: fromConnectionString or fromSharedAccessSignature.

The protocol used for device identity registry operations is HTTPS.

Methods

addConfiguration(Configuration)
addConfiguration(Configuration, HttpResponseCallback<any>)

Add a configuration to an IoT hub.

addDevices(DeviceDescription[])
addDevices(DeviceDescription[], HttpResponseCallback<BulkRegistryOperationResult>)

Adds an array of devices.

addModule(Module)
addModule(Module, HttpResponseCallback<any>)

Add the given module to the registry.

applyConfigurationContentOnDevice(string, ConfigurationContent)
applyConfigurationContentOnDevice(string, ConfigurationContent, HttpResponseCallback<any>)

Apply the given configuration to a device on an IoT Hub

cancelJob(string)
cancelJob(string, Callback<JobStatus>)

Cancel a bulk import/export job.

create(DeviceDescription)
create(DeviceDescription, HttpResponseCallback<Device>)

Creates a new device identity on an IoT hub.

createQuery(string, number)

Creates a query that can be run on the IoT Hub instance to find information about devices or jobs.

delete(string)
delete(string, HttpResponseCallback<any>)

Removes an existing device identity from an IoT hub.

exportDevicesToBlob(string, boolean)
exportDevicesToBlob(string, boolean, Callback<JobStatus>)

Export devices to a blob in a bulk job.

exportDevicesToBlobByIdentity(string, boolean)
exportDevicesToBlobByIdentity(string, boolean, Callback<JobStatus>)

Export devices to a blob in a bulk job using a configured identity.

exportDevicesToBlobByIdentity(string, boolean, string)
exportDevicesToBlobByIdentity(string, boolean, string, Callback<JobStatus>)
fromConnectionString(string)

Constructs a Registry object from the given connection string.

fromSharedAccessSignature(string)

Constructs a Registry object from the given shared access signature.

fromTokenCredential(string, TokenCredential)

Constructs a Registry object from the given Azure TokenCredential.

get(string)
get(string, HttpResponseCallback<Device>)

Requests information about an existing device identity on an IoT hub.

getConfiguration(string)
getConfiguration(string, HttpResponseCallback<Configuration>)

Get a single configuration from an IoT Hub

getConfigurations()
getConfigurations(HttpResponseCallback<Configuration[]>)

Get all configurations on an IoT Hub

getJob(string)
getJob(string, Callback<JobStatus>)

Get the status of a bulk import/export job.

getModule(string, string)
getModule(string, string, HttpResponseCallback<Module>)

Get a single module from a device on an IoT Hub

getModulesOnDevice(string)
getModulesOnDevice(string, HttpResponseCallback<Module[]>)

Get a list of all modules on an IoT Hub device

getModuleTwin(string, string)
getModuleTwin(string, string, HttpResponseCallback<Twin>)

Gets the Module Twin of the module with the specified module identifier.

getRegistryStatistics()
getRegistryStatistics(HttpResponseCallback<RegistryStatistics>)

Gets statistics about the devices in the device identity registry.

getTwin(string)
getTwin(string, HttpResponseCallback<Twin>)

Gets the Device Twin of the device with the specified device identifier.

importDevicesFromBlob(string, string)
importDevicesFromBlob(string, string, Callback<JobStatus>)

Imports devices from a blob in bulk job.

importDevicesFromBlobByIdentity(string, string)
importDevicesFromBlobByIdentity(string, string, Callback<JobStatus>)

Imports devices from a blob in bulk job using a configured identity.

importDevicesFromBlobByIdentity(string, string, string)
importDevicesFromBlobByIdentity(string, string, string, Callback<JobStatus>)
list()
list(HttpResponseCallback<Device[]>)

Requests information about the first 1000 device identities on an IoT hub.

listJobs()
listJobs(HttpResponseCallback<any>)

List the last import/export jobs (including the active one, if any).

removeConfiguration(string)
removeConfiguration(string, HttpResponseCallback<any>)

Remove a configuration with the given ID from an IoT Hub

removeDevices(DeviceDescription[], boolean)
removeDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)

Updates an array of devices.

removeModule(Module, TripleValueCallback<any, any>)

Remove the given module from the registry

removeModule(string | Module)
removeModule(string | Module, string)
removeModule(string, string, TripleValueCallback<any, any>)
update(DeviceDescription)
update(DeviceDescription, HttpResponseCallback<Device>)

Updates an existing device identity on an IoT hub with the given device information. The deviceInfo parameter must include all properties that are updatable. For example, if updating the status property from disabled to enabled, the deviceInfo object should also have the statusReason, authentication (and its sub-properties), capabilities, and deviceScope set to the devices current values or those properties will be reset. It is recommended that the get api is called first before doing an update.

updateConfiguration(Configuration)
updateConfiguration(Configuration, boolean)
updateConfiguration(Configuration, boolean, HttpResponseCallback<any>)
updateConfiguration(Configuration, HttpResponseCallback<any>)

Update a configuration in an IoT hub

updateDevices(DeviceDescription[], boolean)
updateDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)

Updates an array of devices. The individual elements of the devices parameter must include all properties that are updatable. For example, if updating the status property from disabled to enabled, the object should also have the statusReason, authentication (and its sub-properties), capabilities, and deviceScope set to the devices current values or those properties will be reset. It is recommended that the get api is called first before doing an update.

updateModule(Module)
updateModule(Module, boolean)
updateModule(Module, boolean, HttpResponseCallback<any>)
updateModule(Module, TripleValueCallback<any, any>)

Update the given module object in the registry

updateModuleTwin(string, string, any, string)
updateModuleTwin(string, string, any, string, HttpResponseCallback<Twin>)

Updates the Twin of a specific module with the given patch.

updateTwin(string, any, string)
updateTwin(string, any, string, HttpResponseCallback<Twin>)

Updates the Device Twin of a specific device with the given patch.

Method Details

addConfiguration(Configuration)

function addConfiguration(configuration: Configuration): Promise<ResultWithHttpResponse<any>>

Parameters

configuration
Configuration

Returns

Promise<ResultWithHttpResponse<any>>

addConfiguration(Configuration, HttpResponseCallback<any>)

Add a configuration to an IoT hub.

function addConfiguration(configuration: Configuration, done?: HttpResponseCallback<any>)

Parameters

configuration
Configuration

An object of type module:azure-iothub.Configuration to add to the hub

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

addDevices(DeviceDescription[])

function addDevices(devices: DeviceDescription[]): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

Parameters

devices

DeviceDescription[]

Returns

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

addDevices(DeviceDescription[], HttpResponseCallback<BulkRegistryOperationResult>)

Adds an array of devices.

function addDevices(devices: DeviceDescription[], done?: HttpResponseCallback<BulkRegistryOperationResult>)

Parameters

devices

DeviceDescription[]

An array of objects which must include a deviceId property whose value is a valid device identifier.

done

HttpResponseCallback<BulkRegistryOperationResult>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a BulkRegistryOperationResult and a transport-specific response object useful for logging or debugging.

addModule(Module)

function addModule(module: Module): Promise<ResultWithHttpResponse<any>>

Parameters

module
Module

Returns

Promise<ResultWithHttpResponse<any>>

addModule(Module, HttpResponseCallback<any>)

Add the given module to the registry.

function addModule(module: Module, done?: HttpResponseCallback<any>)

Parameters

module
Module

Module object to add to the registry.

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

applyConfigurationContentOnDevice(string, ConfigurationContent)

function applyConfigurationContentOnDevice(deviceId: string, content: ConfigurationContent): Promise<ResultWithHttpResponse<any>>

Parameters

deviceId

string

Returns

Promise<ResultWithHttpResponse<any>>

applyConfigurationContentOnDevice(string, ConfigurationContent, HttpResponseCallback<any>)

Apply the given configuration to a device on an IoT Hub

function applyConfigurationContentOnDevice(deviceId: string, content: ConfigurationContent, done?: HttpResponseCallback<any>)

Parameters

deviceId

string

ID of the device to apply the configuration to

content
ConfigurationContent

The Configuration to apply

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

cancelJob(string)

function cancelJob(jobId: string): Promise<JobStatus>

Parameters

jobId

string

Returns

Promise<JobStatus>

cancelJob(string, Callback<JobStatus>)

Cancel a bulk import/export job.

function cancelJob(jobId: string, done?: Callback<JobStatus>)

Parameters

jobId

string

The identifier of the job for which the user wants to get status information.

done

Callback<JobStatus>

The optional function to call with two arguments: an error object if an error happened, (null otherwise) and the (cancelled) status of the job whose identifier was passed as an argument.

create(DeviceDescription)

function create(deviceInfo: DeviceDescription): Promise<ResultWithHttpResponse<Device>>

Parameters

deviceInfo
DeviceDescription

Returns

Promise<ResultWithHttpResponse<Device>>

create(DeviceDescription, HttpResponseCallback<Device>)

Creates a new device identity on an IoT hub.

function create(deviceInfo: DeviceDescription, done?: HttpResponseCallback<Device>)

Parameters

deviceInfo
DeviceDescription

The object must include a deviceId property with a valid device identifier.

done

HttpResponseCallback<Device>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a Device object representing the created device identity, and a transport-specific response object useful for logging or debugging.

createQuery(string, number)

Creates a query that can be run on the IoT Hub instance to find information about devices or jobs.

function createQuery(sqlQuery: string, pageSize?: number): Query

Parameters

sqlQuery

string

The query written as an SQL string.

pageSize

number

The desired number of results per page (optional. default: 1000, max: 10000).

Returns

Query

delete(string)

function delete(deviceId: string): Promise<ResultWithHttpResponse<any>>

Parameters

deviceId

string

Returns

Promise<ResultWithHttpResponse<any>>

delete(string, HttpResponseCallback<any>)

Removes an existing device identity from an IoT hub.

function delete(deviceId: string, done?: HttpResponseCallback<any>)

Parameters

deviceId

string

The identifier of an existing device identity.

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), an always-null argument (for consistency with the other methods), and a transport-specific response object useful for logging or debugging.

exportDevicesToBlob(string, boolean)

function exportDevicesToBlob(outputBlobContainerUri: string, excludeKeys: boolean): Promise<JobStatus>

Parameters

outputBlobContainerUri

string

excludeKeys

boolean

Returns

Promise<JobStatus>

exportDevicesToBlob(string, boolean, Callback<JobStatus>)

Export devices to a blob in a bulk job.

function exportDevicesToBlob(outputBlobContainerUri: string, excludeKeys: boolean, done?: Callback<JobStatus>)

Parameters

outputBlobContainerUri

string

The URI to a container where a blob named 'devices.txt' will be created containing the list of devices.

excludeKeys

boolean

Boolean indicating whether security keys should be excluded from the exported data.

done

Callback<JobStatus>

The optional function to call when the job has been created, with two arguments: an error object if an an error happened, (null otherwise) and the job status that can be used to track progress of the devices export.

exportDevicesToBlobByIdentity(string, boolean)

function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean): Promise<JobStatus>

Parameters

outputBlobContainerUri

string

excludeKeys

boolean

Returns

Promise<JobStatus>

exportDevicesToBlobByIdentity(string, boolean, Callback<JobStatus>)

Export devices to a blob in a bulk job using a configured identity.

function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, done?: Callback<JobStatus>)

Parameters

outputBlobContainerUri

string

The URI to a container where a blob named 'devices.txt' will be created containing the list of devices.

excludeKeys

boolean

Boolean indicating whether security keys should be excluded from the exported data.

done

Callback<JobStatus>

The optional function to call when the job has been created, with two arguments: an error object if an an error happened, (null otherwise) and the job status that can be used to track progress of the devices export.

exportDevicesToBlobByIdentity(string, boolean, string)

function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, userAssignedIdentity: string): Promise<JobStatus>

Parameters

outputBlobContainerUri

string

excludeKeys

boolean

userAssignedIdentity

string

Returns

Promise<JobStatus>

exportDevicesToBlobByIdentity(string, boolean, string, Callback<JobStatus>)

function exportDevicesToBlobByIdentity(outputBlobContainerUri: string, excludeKeys: boolean, userAssignedIdentity: string, done: Callback<JobStatus>)

Parameters

outputBlobContainerUri

string

excludeKeys

boolean

userAssignedIdentity

string

done

Callback<JobStatus>

fromConnectionString(string)

Constructs a Registry object from the given connection string.

static function fromConnectionString(value: string): Registry

Parameters

value

string

A connection string which encapsulates the appropriate (read and/or write) Registry permissions.

Returns

fromSharedAccessSignature(string)

Constructs a Registry object from the given shared access signature.

static function fromSharedAccessSignature(value: string): Registry

Parameters

value

string

A shared access signature which encapsulates the appropriate (read and/or write) Registry permissions.

Returns

fromTokenCredential(string, TokenCredential)

Constructs a Registry object from the given Azure TokenCredential.

static function fromTokenCredential(hostName: string, tokenCredential: TokenCredential): Registry

Parameters

hostName

string

Host name of the Azure service.

tokenCredential
TokenCredential

An Azure TokenCredential used to authenticate with the Azure service

Returns

get(string)

function get(deviceId: string): Promise<ResultWithHttpResponse<Device>>

Parameters

deviceId

string

Returns

Promise<ResultWithHttpResponse<Device>>

get(string, HttpResponseCallback<Device>)

Requests information about an existing device identity on an IoT hub.

function get(deviceId: string, done?: HttpResponseCallback<Device>)

Parameters

deviceId

string

The identifier of an existing device identity.

done

HttpResponseCallback<Device>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a Device object representing the created device identity, and a transport-specific response object useful for logging or debugging.

getConfiguration(string)

function getConfiguration(configurationId: string): Promise<ResultWithHttpResponse<Configuration>>

Parameters

configurationId

string

Returns

Promise<ResultWithHttpResponse<Configuration>>

getConfiguration(string, HttpResponseCallback<Configuration>)

Get a single configuration from an IoT Hub

function getConfiguration(configurationId: string, done?: HttpResponseCallback<Configuration>)

Parameters

configurationId

string

The ID of the configuration you with to retrieve

done

HttpResponseCallback<Configuration>

The optional callback which will be called with either an Error object or a module:azure-iothub.Configuration object with the configuration details.

getConfigurations()

function getConfigurations(): Promise<ResultWithHttpResponse<Configuration[]>>

Returns

Promise<ResultWithHttpResponse<Configuration[]>>

getConfigurations(HttpResponseCallback<Configuration[]>)

Get all configurations on an IoT Hub

function getConfigurations(done?: HttpResponseCallback<Configuration[]>)

Parameters

done

HttpResponseCallback<Configuration[]>

The optional callback which will be called with either an Error object or an array of module:azure-iothub.Configuration objects for all the configurations.

getJob(string)

function getJob(jobId: string): Promise<JobStatus>

Parameters

jobId

string

Returns

Promise<JobStatus>

getJob(string, Callback<JobStatus>)

Get the status of a bulk import/export job.

function getJob(jobId: string, done?: Callback<JobStatus>)

Parameters

jobId

string

The identifier of the job for which the user wants to get status information.

done

Callback<JobStatus>

The optional function to call with two arguments: an error object if an error happened, (null otherwise) and the status of the job whose identifier was passed as an argument.

getModule(string, string)

function getModule(deviceId: string, moduleId: string): Promise<ResultWithHttpResponse<Module>>

Parameters

deviceId

string

moduleId

string

Returns

Promise<ResultWithHttpResponse<Module>>

getModule(string, string, HttpResponseCallback<Module>)

Get a single module from a device on an IoT Hub

function getModule(deviceId: string, moduleId: string, done?: HttpResponseCallback<Module>)

Parameters

deviceId

string

Device ID that owns the module.

moduleId

string

Module ID to retrieve

done

HttpResponseCallback<Module>

The optional callback which will be called with either an Error object or the module:azure-iothub.Module object for the requested module

getModulesOnDevice(string)

function getModulesOnDevice(deviceId: string): Promise<ResultWithHttpResponse<Module[]>>

Parameters

deviceId

string

Returns

Promise<ResultWithHttpResponse<Module[]>>

getModulesOnDevice(string, HttpResponseCallback<Module[]>)

Get a list of all modules on an IoT Hub device

function getModulesOnDevice(deviceId: string, done?: HttpResponseCallback<Module[]>)

Parameters

deviceId

string

ID of the device we're getting modules for

done

HttpResponseCallback<Module[]>

The optional callback which will be called with either an Error object or an array of module:azure-iothub.Module objects for all the modules.

getModuleTwin(string, string)

function getModuleTwin(deviceId: string, moduleId: string): Promise<ResultWithHttpResponse<Twin>>

Parameters

deviceId

string

moduleId

string

Returns

Promise<ResultWithHttpResponse<Twin>>

getModuleTwin(string, string, HttpResponseCallback<Twin>)

Gets the Module Twin of the module with the specified module identifier.

function getModuleTwin(deviceId: string, moduleId: string, done?: HttpResponseCallback<Twin>)

Parameters

deviceId

string

The device identifier.

moduleId

string

The module identifier.

done

HttpResponseCallback<Twin>

The optional callback that will be called with either an Error object or the module twin instance.

getRegistryStatistics()

function getRegistryStatistics(): Promise<ResultWithHttpResponse<RegistryStatistics>>

Returns

Promise<ResultWithHttpResponse<RegistryStatistics>>

getRegistryStatistics(HttpResponseCallback<RegistryStatistics>)

Gets statistics about the devices in the device identity registry.

function getRegistryStatistics(done?: HttpResponseCallback<RegistryStatistics>)

Parameters

done

HttpResponseCallback<RegistryStatistics>

The optional callback that will be called with either an Error object or the device registry statistics.

getTwin(string)

function getTwin(deviceId: string): Promise<ResultWithHttpResponse<Twin>>

Parameters

deviceId

string

Returns

Promise<ResultWithHttpResponse<Twin>>

getTwin(string, HttpResponseCallback<Twin>)

Gets the Device Twin of the device with the specified device identifier.

function getTwin(deviceId: string, done?: HttpResponseCallback<Twin>)

Parameters

deviceId

string

The device identifier.

done

HttpResponseCallback<Twin>

The optional callback that will be called with either an Error object or the device twin instance.

importDevicesFromBlob(string, string)

function importDevicesFromBlob(inputBlobContainerUri: string, outputBlobContainerUri: string): Promise<JobStatus>

Parameters

inputBlobContainerUri

string

outputBlobContainerUri

string

Returns

Promise<JobStatus>

importDevicesFromBlob(string, string, Callback<JobStatus>)

Imports devices from a blob in bulk job.

function importDevicesFromBlob(inputBlobContainerUri: string, outputBlobContainerUri: string, done?: Callback<JobStatus>)

Parameters

inputBlobContainerUri

string

The URI to a container with a blob named 'devices.txt' containing a list of devices to import.

outputBlobContainerUri

string

The URI to a container where a blob will be created with logs of the import process.

done

Callback<JobStatus>

The optional function to call when the job has been created, with two arguments: an error object if an an error happened, (null otherwise) and the job status that can be used to track progress of the devices import.

importDevicesFromBlobByIdentity(string, string)

function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string): Promise<JobStatus>

Parameters

inputBlobContainerUri

string

outputBlobContainerUri

string

Returns

Promise<JobStatus>

importDevicesFromBlobByIdentity(string, string, Callback<JobStatus>)

Imports devices from a blob in bulk job using a configured identity.

function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, done?: Callback<JobStatus>)

Parameters

inputBlobContainerUri

string

The URI to a container with a blob named 'devices.txt' containing a list of devices to import.

outputBlobContainerUri

string

The URI to a container where a blob will be created with logs of the import process.

done

Callback<JobStatus>

The optional function to call when the job has been created, with two arguments: an error object if an an error happened, (null otherwise) and the job status that can be used to track progress of the devices import.

importDevicesFromBlobByIdentity(string, string, string)

function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, userAssignedIdentity: string): Promise<JobStatus>

Parameters

inputBlobContainerUri

string

outputBlobContainerUri

string

userAssignedIdentity

string

Returns

Promise<JobStatus>

importDevicesFromBlobByIdentity(string, string, string, Callback<JobStatus>)

function importDevicesFromBlobByIdentity(inputBlobContainerUri: string, outputBlobContainerUri: string, userAssignedIdentity: string, done: Callback<JobStatus>)

Parameters

inputBlobContainerUri

string

outputBlobContainerUri

string

userAssignedIdentity

string

done

Callback<JobStatus>

list()

function list(): Promise<ResultWithHttpResponse<Device[]>>

Returns

Promise<ResultWithHttpResponse<Device[]>>

list(HttpResponseCallback<Device[]>)

Requests information about the first 1000 device identities on an IoT hub.

function list(done?: HttpResponseCallback<Device[]>)

Parameters

done

HttpResponseCallback<Device[]>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), an array of Device objects representing the listed device identities, and a transport-specific response object useful for logging or debugging.

listJobs()

function listJobs(): Promise<ResultWithHttpResponse<any>>

Returns

Promise<ResultWithHttpResponse<any>>

listJobs(HttpResponseCallback<any>)

List the last import/export jobs (including the active one, if any).

function listJobs(done?: HttpResponseCallback<any>)

Parameters

done

HttpResponseCallback<any>

The optional function to call with two arguments: an error object if an error happened, (null otherwise) and the list of past jobs as an argument.

removeConfiguration(string)

function removeConfiguration(configurationId: string): Promise<ResultWithHttpResponse<any>>

Parameters

configurationId

string

Returns

Promise<ResultWithHttpResponse<any>>

removeConfiguration(string, HttpResponseCallback<any>)

Remove a configuration with the given ID from an IoT Hub

function removeConfiguration(configurationId: string, done?: HttpResponseCallback<any>)

Parameters

configurationId

string

ID of the configuration to remove

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

removeDevices(DeviceDescription[], boolean)

function removeDevices(devices: DeviceDescription[], forceRemove: boolean): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

Parameters

devices

DeviceDescription[]

forceRemove

boolean

Returns

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

removeDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)

Updates an array of devices.

function removeDevices(devices: DeviceDescription[], forceRemove: boolean, done?: HttpResponseCallback<BulkRegistryOperationResult>)

Parameters

devices

DeviceDescription[]

An array of objects which must include a deviceId property whose value is a valid device identifier.

forceRemove

boolean

if forceRemove is true then the device will be removed regardless of an etag. Otherwise the etags must match.

done

HttpResponseCallback<BulkRegistryOperationResult>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a BulkRegistryOperationResult and a transport-specific response object useful for logging or debugging.

removeModule(Module, TripleValueCallback<any, any>)

Remove the given module from the registry

function removeModule(module: Module, done?: TripleValueCallback<any, any>)

Parameters

module
Module
done

TripleValueCallback<any, any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

removeModule(string | Module)

function removeModule(moduleOrDeviceId: string | Module): Promise<ResultWithHttpResponse<any>>

Parameters

moduleOrDeviceId

string | Module

Returns

Promise<ResultWithHttpResponse<any>>

removeModule(string | Module, string)

function removeModule(moduleOrDeviceId: string | Module, moduleId: string): Promise<ResultWithHttpResponse<any>>

Parameters

moduleOrDeviceId

string | Module

moduleId

string

Returns

Promise<ResultWithHttpResponse<any>>

removeModule(string, string, TripleValueCallback<any, any>)

function removeModule(deviceId: string, moduleId: string, done: TripleValueCallback<any, any>)

Parameters

deviceId

string

moduleId

string

done

TripleValueCallback<any, any>

update(DeviceDescription)

function update(deviceInfo: DeviceDescription): Promise<ResultWithHttpResponse<Device>>

Parameters

deviceInfo
DeviceDescription

Returns

Promise<ResultWithHttpResponse<Device>>

update(DeviceDescription, HttpResponseCallback<Device>)

Updates an existing device identity on an IoT hub with the given device information. The deviceInfo parameter must include all properties that are updatable. For example, if updating the status property from disabled to enabled, the deviceInfo object should also have the statusReason, authentication (and its sub-properties), capabilities, and deviceScope set to the devices current values or those properties will be reset. It is recommended that the get api is called first before doing an update.

function update(deviceInfo: DeviceDescription, done?: HttpResponseCallback<Device>)

Parameters

deviceInfo
DeviceDescription

An object which must include a deviceId property whose value is a valid device identifier.

done

HttpResponseCallback<Device>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a Device object representing the updated device identity, and a transport-specific response object useful for logging or debugging.

updateConfiguration(Configuration)

function updateConfiguration(configuration: Configuration): Promise<ResultWithHttpResponse<any>>

Parameters

configuration
Configuration

Returns

Promise<ResultWithHttpResponse<any>>

updateConfiguration(Configuration, boolean)

function updateConfiguration(configuration: Configuration, forceUpdate: boolean): Promise<ResultWithHttpResponse<any>>

Parameters

configuration
Configuration
forceUpdate

boolean

Returns

Promise<ResultWithHttpResponse<any>>

updateConfiguration(Configuration, boolean, HttpResponseCallback<any>)

function updateConfiguration(configuration: Configuration, forceUpdate: boolean, done: HttpResponseCallback<any>)

Parameters

configuration
Configuration
forceUpdate

boolean

done

HttpResponseCallback<any>

updateConfiguration(Configuration, HttpResponseCallback<any>)

Update a configuration in an IoT hub

function updateConfiguration(configuration: Configuration, done?: HttpResponseCallback<any>)

Parameters

configuration
Configuration

An object of type module:azure-iothub.Configuration to add to the hub

done

HttpResponseCallback<any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

updateDevices(DeviceDescription[], boolean)

function updateDevices(devices: DeviceDescription[], forceUpdate: boolean): Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

Parameters

devices

DeviceDescription[]

forceUpdate

boolean

Returns

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

updateDevices(DeviceDescription[], boolean, HttpResponseCallback<BulkRegistryOperationResult>)

Updates an array of devices. The individual elements of the devices parameter must include all properties that are updatable. For example, if updating the status property from disabled to enabled, the object should also have the statusReason, authentication (and its sub-properties), capabilities, and deviceScope set to the devices current values or those properties will be reset. It is recommended that the get api is called first before doing an update.

function updateDevices(devices: DeviceDescription[], forceUpdate: boolean, done?: HttpResponseCallback<BulkRegistryOperationResult>)

Parameters

devices

DeviceDescription[]

An array of objects which must include a deviceId property whose value is a valid device identifier.

forceUpdate

boolean

if forceUpdate is true then the device will be updated regardless of an etag. Otherwise the etags must match.

done

HttpResponseCallback<BulkRegistryOperationResult>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), a BulkRegistryOperationResult and a transport-specific response object useful for logging or debugging.

updateModule(Module)

function updateModule(module: Module): Promise<ResultWithHttpResponse<any>>

Parameters

module
Module

Returns

Promise<ResultWithHttpResponse<any>>

updateModule(Module, boolean)

function updateModule(module: Module, forceUpdate: boolean): Promise<ResultWithHttpResponse<any>>

Parameters

module
Module
forceUpdate

boolean

Returns

Promise<ResultWithHttpResponse<any>>

updateModule(Module, boolean, HttpResponseCallback<any>)

function updateModule(module: Module, forceUpdate: boolean, done: HttpResponseCallback<any>)

Parameters

module
Module
forceUpdate

boolean

done

HttpResponseCallback<any>

updateModule(Module, TripleValueCallback<any, any>)

Update the given module object in the registry

function updateModule(module: Module, done?: TripleValueCallback<any, any>)

Parameters

module
Module

Module object to update.

done

TripleValueCallback<any, any>

The optional function to call when the operation is complete. done will be called with three arguments: an Error object (can be null), the body of the response, and a transport-specific response object useful for logging or debugging.

updateModuleTwin(string, string, any, string)

function updateModuleTwin(deviceId: string, moduleId: string, patch: any, etag: string): Promise<ResultWithHttpResponse<Twin>>

Parameters

deviceId

string

moduleId

string

patch

any

etag

string

Returns

Promise<ResultWithHttpResponse<Twin>>

updateModuleTwin(string, string, any, string, HttpResponseCallback<Twin>)

Updates the Twin of a specific module with the given patch.

function updateModuleTwin(deviceId: string, moduleId: string, patch: any, etag: string, done?: HttpResponseCallback<Twin>)

Parameters

deviceId

string

The device identifier.

moduleId

string

The module identifier

patch

any

The desired properties and tags to patch the module twin with.

etag

string

The latest etag for this module twin or '*' to force an update even if the module twin has been updated since the etag was obtained.

done

HttpResponseCallback<Twin>

The optional callback that will be called with either an Error object or the module twin instance.

updateTwin(string, any, string)

function updateTwin(deviceId: string, patch: any, etag: string): Promise<ResultWithHttpResponse<Twin>>

Parameters

deviceId

string

patch

any

etag

string

Returns

Promise<ResultWithHttpResponse<Twin>>

updateTwin(string, any, string, HttpResponseCallback<Twin>)

Updates the Device Twin of a specific device with the given patch.

function updateTwin(deviceId: string, patch: any, etag: string, done?: HttpResponseCallback<Twin>)

Parameters

deviceId

string

The device identifier.

patch

any

The desired properties and tags to patch the device twin with.

etag

string

The latest etag for this device twin or '*' to force an update even if the device twin has been updated since the etag was obtained.

done

HttpResponseCallback<Twin>

The optional callback that will be called with either an Error object or the device twin instance.