你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Registry class

注册表类提供对 IoT 中心设备标识服务的访问权限。 SDK 的用户应使用工厂方法之一实例化此类:fromConnectionStringfromSharedAccessSignature

用于设备标识注册表作的协议是 HTTPS。

方法

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

将配置添加到 IoT 中心。

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

添加设备数组。

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

将给定模块添加到注册表。

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

将给定配置应用于 IoT 中心上的设备

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

取消批量导入/导出作业。

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

在 IoT 中心创建新的设备标识。

createQuery(string, number)

创建可在 IoT 中心实例上运行的查询,以查找有关设备或作业的信息。

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

从 IoT 中心删除现有设备标识。

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

将设备导出到批量作业中的 Blob。

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

使用配置的标识将设备导出到批量作业中的 Blob。

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

从给定的连接字符串构造 Registry 对象。

fromSharedAccessSignature(string)

从给定的共享访问签名构造注册表对象。

fromTokenCredential(string, TokenCredential)

从给定的 Azure TokenCredential 构造注册表对象。

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

请求有关 IoT 中心上现有设备标识的信息。

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

从 IoT 中心获取单个配置

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

获取 IoT 中心的所有配置

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

获取批量导入/导出作业的状态。

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

从 IoT 中心上的设备获取单个模块

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

获取 IoT 中心设备上所有模块的列表

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

获取具有指定模块标识符的模块的模块孪生。

getRegistryStatistics()
getRegistryStatistics(HttpResponseCallback<RegistryStatistics>)

获取有关设备标识注册表中的设备的统计信息。

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

获取具有指定设备标识符的设备的设备孪生。

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

从批量作业中的 Blob 导入设备。

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

使用配置的标识从批量作业中的 Blob 导入设备。

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

请求有关 IoT 中心上前 1000 个设备标识的信息。

listJobs()
listJobs(HttpResponseCallback<any>)

列出最后一个导入/导出作业(包括活动作业(如果有)。

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

从 IoT 中心删除具有给定 ID 的配置

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

更新设备数组。

removeModule(Module, TripleValueCallback<any, any>)

从注册表中删除给定模块

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

使用给定的设备信息更新 IoT 中心的现有设备标识。 deviceInfo 参数必须包含所有可更新的属性。 例如,如果将 status 属性从 disabled 更新为 enabled,则 deviceInfo 对象还应具有 statusReason、authentication(及其子属性)、功能和 deviceScope 设置为设备当前值或这些属性将重置。 建议先调用 get api,然后再执行更新。

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

更新 IoT 中心中的配置

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

更新设备数组。 devices 参数的各个元素必须包含可更新的所有属性。 例如,如果将 status 属性从 disabled 更新为 enabled,则对象还应将 statusReason、authentication(及其子属性)、功能和 deviceScope 设置为设备当前值或将重置这些属性。 建议先调用 get api,然后再执行更新。

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

更新注册表中的给定模块对象

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

使用给定修补程序更新特定模块的孪生。

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

使用给定修补程序更新特定设备的设备孪生。

方法详细信息

addConfiguration(Configuration)

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

参数

configuration
Configuration

返回

Promise<ResultWithHttpResponse<any>>

addConfiguration(Configuration, HttpResponseCallback<any>)

将配置添加到 IoT 中心。

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

参数

configuration
Configuration

模块:azure-iothub 类型的对象。要添加到中心的配置

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

addDevices(DeviceDescription[])

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

参数

devices

DeviceDescription[]

返回

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

addDevices(DeviceDescription[], HttpResponseCallback<BulkRegistryOperationResult>)

添加设备数组。

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

参数

devices

DeviceDescription[]

必须包含其值为有效设备标识符的 deviceId 属性的对象数组。

done

HttpResponseCallback<BulkRegistryOperationResult>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、BulkRegistryOperationResult 和用于日志记录或调试的特定于传输的响应对象。

addModule(Module)

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

参数

module
Module

返回

Promise<ResultWithHttpResponse<any>>

addModule(Module, HttpResponseCallback<any>)

将给定模块添加到注册表。

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

参数

module
Module

要添加到注册表的 Module 对象。

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

applyConfigurationContentOnDevice(string, ConfigurationContent)

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

参数

deviceId

string

返回

Promise<ResultWithHttpResponse<any>>

applyConfigurationContentOnDevice(string, ConfigurationContent, HttpResponseCallback<any>)

将给定配置应用于 IoT 中心上的设备

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

参数

deviceId

string

要向其应用配置的设备 ID

content
ConfigurationContent

要应用的配置

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

cancelJob(string)

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

参数

jobId

string

返回

Promise<JobStatus>

cancelJob(string, Callback<JobStatus>)

取消批量导入/导出作业。

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

参数

jobId

string

用户要为其获取状态信息的作业的标识符。

done

Callback<JobStatus>

要用两个参数调用的可选函数:如果发生错误,则为错误对象(否则为 null)和(已取消)状态的作业,其标识符作为参数传递。

create(DeviceDescription)

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

参数

deviceInfo
DeviceDescription

返回

Promise<ResultWithHttpResponse<Device>>

create(DeviceDescription, HttpResponseCallback<Device>)

在 IoT 中心创建新的设备标识。

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

参数

deviceInfo
DeviceDescription

该对象必须包含具有有效设备标识符的 deviceId 属性。

done

HttpResponseCallback<Device>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、表示创建的设备标识的 设备 对象,以及用于日志记录或调试的特定于传输的响应对象。

createQuery(string, number)

创建可在 IoT 中心实例上运行的查询,以查找有关设备或作业的信息。

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

参数

sqlQuery

string

编写为 SQL 字符串的查询。

pageSize

number

每个页面所需的结果数(可选。默认值:1000,最大值:10000)。

返回

Query

delete(string)

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

参数

deviceId

string

返回

Promise<ResultWithHttpResponse<any>>

delete(string, HttpResponseCallback<any>)

从 IoT 中心删除现有设备标识。

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

参数

deviceId

string

现有设备标识的标识符。

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、always-null 参数(与其他方法保持一致性),以及用于日志记录或调试的特定于传输的响应对象。

exportDevicesToBlob(string, boolean)

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

参数

outputBlobContainerUri

string

excludeKeys

boolean

返回

Promise<JobStatus>

exportDevicesToBlob(string, boolean, Callback<JobStatus>)

将设备导出到批量作业中的 Blob。

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

参数

outputBlobContainerUri

string

将创建名为“devices.txt”的 blob 包含设备列表的容器的 URI。

excludeKeys

boolean

指示是否应从导出的数据中排除安全密钥的布尔值。

done

Callback<JobStatus>

创建作业时要调用的可选函数,其中包含两个参数:发生错误时出错对象(否则为 null),以及可用于跟踪设备导出进度的作业状态。

exportDevicesToBlobByIdentity(string, boolean)

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

参数

outputBlobContainerUri

string

excludeKeys

boolean

返回

Promise<JobStatus>

exportDevicesToBlobByIdentity(string, boolean, Callback<JobStatus>)

使用配置的标识将设备导出到批量作业中的 Blob。

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

参数

outputBlobContainerUri

string

将创建名为“devices.txt”的 blob 包含设备列表的容器的 URI。

excludeKeys

boolean

指示是否应从导出的数据中排除安全密钥的布尔值。

done

Callback<JobStatus>

创建作业时要调用的可选函数,其中包含两个参数:发生错误时出错对象(否则为 null),以及可用于跟踪设备导出进度的作业状态。

exportDevicesToBlobByIdentity(string, boolean, string)

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

参数

outputBlobContainerUri

string

excludeKeys

boolean

userAssignedIdentity

string

返回

Promise<JobStatus>

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

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

参数

outputBlobContainerUri

string

excludeKeys

boolean

userAssignedIdentity

string

done

Callback<JobStatus>

fromConnectionString(string)

从给定的连接字符串构造 Registry 对象。

static function fromConnectionString(value: string): Registry

参数

value

string

封装适当(读取和/或写入)注册表权限的连接字符串。

返回

fromSharedAccessSignature(string)

从给定的共享访问签名构造注册表对象。

static function fromSharedAccessSignature(value: string): Registry

参数

value

string

一个共享访问签名,它封装了适当的(读取和/或写入)注册表权限。

返回

fromTokenCredential(string, TokenCredential)

从给定的 Azure TokenCredential 构造注册表对象。

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

参数

hostName

string

Azure 服务的主机名。

tokenCredential
TokenCredential

用于向 Azure 服务进行身份验证的 Azure TokenCredential

返回

get(string)

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

参数

deviceId

string

返回

Promise<ResultWithHttpResponse<Device>>

get(string, HttpResponseCallback<Device>)

请求有关 IoT 中心上现有设备标识的信息。

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

参数

deviceId

string

现有设备标识的标识符。

done

HttpResponseCallback<Device>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、表示创建的设备标识的 设备 对象,以及用于日志记录或调试的特定于传输的响应对象。

getConfiguration(string)

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

参数

configurationId

string

返回

Promise<ResultWithHttpResponse<Configuration>>

getConfiguration(string, HttpResponseCallback<Configuration>)

从 IoT 中心获取单个配置

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

参数

configurationId

string

要检索的配置的 ID

done

HttpResponseCallback<Configuration>

将使用 Error 对象或 module:azure-iothub 调用的可选回调。配置对象,其中包含配置详细信息。

getConfigurations()

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

返回

Promise<ResultWithHttpResponse<Configuration[]>>

getConfigurations(HttpResponseCallback<Configuration[]>)

获取 IoT 中心的所有配置

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

参数

done

HttpResponseCallback<Configuration[]>

将使用 Error 对象或 module:azure-iothub 数组调用的可选回调。所有配置的配置对象。

getJob(string)

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

参数

jobId

string

返回

Promise<JobStatus>

getJob(string, Callback<JobStatus>)

获取批量导入/导出作业的状态。

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

参数

jobId

string

用户要为其获取状态信息的作业的标识符。

done

Callback<JobStatus>

使用两个参数调用的可选函数:如果发生错误,则为错误对象(否则为 null),以及标识符作为参数传递的作业的状态。

getModule(string, string)

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

参数

deviceId

string

moduleId

string

返回

Promise<ResultWithHttpResponse<Module>>

getModule(string, string, HttpResponseCallback<Module>)

从 IoT 中心上的设备获取单个模块

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

参数

deviceId

string

拥有模块的设备 ID。

moduleId

string

要检索的模块 ID

done

HttpResponseCallback<Module>

将使用 Error 对象或 module:azure-iothub 调用的可选回调。所请求模块的 Module 对象

getModulesOnDevice(string)

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

参数

deviceId

string

返回

Promise<ResultWithHttpResponse<Module[]>>

getModulesOnDevice(string, HttpResponseCallback<Module[]>)

获取 IoT 中心设备上所有模块的列表

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

参数

deviceId

string

要为其获取模块的设备 ID

done

HttpResponseCallback<Module[]>

将使用 Error 对象或 module:azure-iothub 数组调用的可选回调。所有模块的模块对象。

getModuleTwin(string, string)

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

参数

deviceId

string

moduleId

string

返回

Promise<ResultWithHttpResponse<Twin>>

getModuleTwin(string, string, HttpResponseCallback<Twin>)

获取具有指定模块标识符的模块的模块孪生。

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

参数

deviceId

string

设备标识符。

moduleId

string

模块标识符。

done

HttpResponseCallback<Twin>

将使用 Error 对象或模块孪生实例调用的可选回调。

getRegistryStatistics()

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

返回

Promise<ResultWithHttpResponse<RegistryStatistics>>

getRegistryStatistics(HttpResponseCallback<RegistryStatistics>)

获取有关设备标识注册表中的设备的统计信息。

function getRegistryStatistics(done?: HttpResponseCallback<RegistryStatistics>)

参数

done

HttpResponseCallback<RegistryStatistics>

将使用 Error 对象或设备注册表统计信息调用的可选回调。

getTwin(string)

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

参数

deviceId

string

返回

Promise<ResultWithHttpResponse<Twin>>

getTwin(string, HttpResponseCallback<Twin>)

获取具有指定设备标识符的设备的设备孪生。

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

参数

deviceId

string

设备标识符。

done

HttpResponseCallback<Twin>

将使用 Error 对象或设备孪生实例调用的可选回调。

importDevicesFromBlob(string, string)

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

参数

inputBlobContainerUri

string

outputBlobContainerUri

string

返回

Promise<JobStatus>

importDevicesFromBlob(string, string, Callback<JobStatus>)

从批量作业中的 Blob 导入设备。

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

参数

inputBlobContainerUri

string

包含要导入的设备列表的 blob 名为“devices.txt”的容器的 URI。

outputBlobContainerUri

string

将使用导入过程的日志创建 Blob 的容器的 URI。

done

Callback<JobStatus>

创建作业时要调用的可选函数,其中包含两个参数:如果发生错误,则为错误对象(否则为 null),以及可用于跟踪设备导入进度的作业状态。

importDevicesFromBlobByIdentity(string, string)

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

参数

inputBlobContainerUri

string

outputBlobContainerUri

string

返回

Promise<JobStatus>

importDevicesFromBlobByIdentity(string, string, Callback<JobStatus>)

使用配置的标识从批量作业中的 Blob 导入设备。

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

参数

inputBlobContainerUri

string

包含要导入的设备列表的 blob 名为“devices.txt”的容器的 URI。

outputBlobContainerUri

string

将使用导入过程的日志创建 Blob 的容器的 URI。

done

Callback<JobStatus>

创建作业时要调用的可选函数,其中包含两个参数:如果发生错误,则为错误对象(否则为 null),以及可用于跟踪设备导入进度的作业状态。

importDevicesFromBlobByIdentity(string, string, string)

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

参数

inputBlobContainerUri

string

outputBlobContainerUri

string

userAssignedIdentity

string

返回

Promise<JobStatus>

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

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

参数

inputBlobContainerUri

string

outputBlobContainerUri

string

userAssignedIdentity

string

done

Callback<JobStatus>

list()

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

返回

Promise<ResultWithHttpResponse<Device[]>>

list(HttpResponseCallback<Device[]>)

请求有关 IoT 中心上前 1000 个设备标识的信息。

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

参数

done

HttpResponseCallback<Device[]>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、设备 对象数组,这些对象表示列出的设备标识,以及用于日志记录或调试的特定于传输的响应对象。

listJobs()

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

返回

Promise<ResultWithHttpResponse<any>>

listJobs(HttpResponseCallback<any>)

列出最后一个导入/导出作业(包括活动作业(如果有)。

function listJobs(done?: HttpResponseCallback<any>)

参数

done

HttpResponseCallback<any>

要用两个参数调用的可选函数:如果发生错误,则为错误对象(否则为 null),并将过去的作业列表作为参数。

removeConfiguration(string)

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

参数

configurationId

string

返回

Promise<ResultWithHttpResponse<any>>

removeConfiguration(string, HttpResponseCallback<any>)

从 IoT 中心删除具有给定 ID 的配置

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

参数

configurationId

string

要删除的配置的 ID

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

removeDevices(DeviceDescription[], boolean)

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

参数

devices

DeviceDescription[]

forceRemove

boolean

返回

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

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

更新设备数组。

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

参数

devices

DeviceDescription[]

必须包含其值为有效设备标识符的 deviceId 属性的对象数组。

forceRemove

boolean

如果 forceRemove 为 true,则无论 etag 如何,都将删除设备。 否则,etag 必须匹配。

done

HttpResponseCallback<BulkRegistryOperationResult>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、BulkRegistryOperationResult 和用于日志记录或调试的特定于传输的响应对象。

removeModule(Module, TripleValueCallback<any, any>)

从注册表中删除给定模块

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

参数

module
Module
done

TripleValueCallback<any, any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

removeModule(string | Module)

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

参数

moduleOrDeviceId

string | Module

返回

Promise<ResultWithHttpResponse<any>>

removeModule(string | Module, string)

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

参数

moduleOrDeviceId

string | Module

moduleId

string

返回

Promise<ResultWithHttpResponse<any>>

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

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

参数

deviceId

string

moduleId

string

done

TripleValueCallback<any, any>

update(DeviceDescription)

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

参数

deviceInfo
DeviceDescription

返回

Promise<ResultWithHttpResponse<Device>>

update(DeviceDescription, HttpResponseCallback<Device>)

使用给定的设备信息更新 IoT 中心的现有设备标识。 deviceInfo 参数必须包含所有可更新的属性。 例如,如果将 status 属性从 disabled 更新为 enabled,则 deviceInfo 对象还应具有 statusReason、authentication(及其子属性)、功能和 deviceScope 设置为设备当前值或这些属性将重置。 建议先调用 get api,然后再执行更新。

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

参数

deviceInfo
DeviceDescription

必须包含其值为有效设备标识符的 deviceId 属性的对象。

done

HttpResponseCallback<Device>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、表示更新的设备标识的 Device 对象,以及用于日志记录或调试的特定于传输的响应对象。

updateConfiguration(Configuration)

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

参数

configuration
Configuration

返回

Promise<ResultWithHttpResponse<any>>

updateConfiguration(Configuration, boolean)

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

参数

configuration
Configuration
forceUpdate

boolean

返回

Promise<ResultWithHttpResponse<any>>

updateConfiguration(Configuration, boolean, HttpResponseCallback<any>)

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

参数

configuration
Configuration
forceUpdate

boolean

done

HttpResponseCallback<any>

updateConfiguration(Configuration, HttpResponseCallback<any>)

更新 IoT 中心中的配置

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

参数

configuration
Configuration

模块:azure-iothub 类型的对象。要添加到中心的配置

done

HttpResponseCallback<any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

updateDevices(DeviceDescription[], boolean)

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

参数

devices

DeviceDescription[]

forceUpdate

boolean

返回

Promise<ResultWithHttpResponse<BulkRegistryOperationResult>>

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

更新设备数组。 devices 参数的各个元素必须包含可更新的所有属性。 例如,如果将 status 属性从 disabled 更新为 enabled,则对象还应将 statusReason、authentication(及其子属性)、功能和 deviceScope 设置为设备当前值或将重置这些属性。 建议先调用 get api,然后再执行更新。

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

参数

devices

DeviceDescription[]

必须包含其值为有效设备标识符的 deviceId 属性的对象数组。

forceUpdate

boolean

如果 forceUpdate 为 true,则无论 etag 如何,设备都将更新。 否则,etag 必须匹配。

done

HttpResponseCallback<BulkRegistryOperationResult>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、BulkRegistryOperationResult 和用于日志记录或调试的特定于传输的响应对象。

updateModule(Module)

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

参数

module
Module

返回

Promise<ResultWithHttpResponse<any>>

updateModule(Module, boolean)

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

参数

module
Module
forceUpdate

boolean

返回

Promise<ResultWithHttpResponse<any>>

updateModule(Module, boolean, HttpResponseCallback<any>)

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

参数

module
Module
forceUpdate

boolean

done

HttpResponseCallback<any>

updateModule(Module, TripleValueCallback<any, any>)

更新注册表中的给定模块对象

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

参数

module
Module

要更新的模块对象。

done

TripleValueCallback<any, any>

作完成后要调用的可选函数。 将使用三个参数调用 done:Error 对象(可以为 null)、响应正文,以及用于日志记录或调试的特定于传输的响应对象。

updateModuleTwin(string, string, any, string)

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

参数

deviceId

string

moduleId

string

patch

any

etag

string

返回

Promise<ResultWithHttpResponse<Twin>>

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

使用给定修补程序更新特定模块的孪生。

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

参数

deviceId

string

设备标识符。

moduleId

string

模块标识符

patch

any

用于修补模块孪生的所需属性和标记。

etag

string

即使自获取 etag 以来模块孪生已更新,此模块孪生的最新 etag 或“*”也会强制更新。

done

HttpResponseCallback<Twin>

将使用 Error 对象或模块孪生实例调用的可选回调。

updateTwin(string, any, string)

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

参数

deviceId

string

patch

any

etag

string

返回

Promise<ResultWithHttpResponse<Twin>>

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

使用给定修补程序更新特定设备的设备孪生。

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

参数

deviceId

string

设备标识符。

patch

any

用于修补设备孪生的所需属性和标记。

etag

string

此设备孪生或“*”的最新 etag,即使设备孪生自获取 etag 以来已更新,也会强制更新。

done

HttpResponseCallback<Twin>

将使用 Error 对象或设备孪生实例调用的可选回调。