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

Registry class

Registry 类提供对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 必须包含可更新的所有属性。 例如,如果将 属性从 disabled 更新statusenabled,则deviceInfo对象还应将 statusReason、身份验证 (及其子属性) 、功能和 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 元素必须包含可更新的所有属性。 例如,如果将 属性从 disabled 更新statusenabled,则 对象还应具有 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

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

done

HttpResponseCallback<any>

操作完成时要调用的可选函数。 done 将使用三个参数调用:错误对象 (可为 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 将使用三个参数调用:错误对象 (可为 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

要添加到注册表的模块对象。

done

HttpResponseCallback<any>

操作完成时要调用的可选函数。 done 将使用三个参数调用:错误对象 (可为 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 将使用三个参数调用:错误对象 (可为 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) 、表示创建的设备标识的 Device 对象以及可用于日志记录或调试的特定于传输的响应对象。

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

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

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

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

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) 、表示创建的设备标识的 Device 对象以及可用于日志记录或调试的特定于传输的响应对象。

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 调用的可选回调。所请求模块的模块对象

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

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

outputBlobContainerUri

string

容器的 URI,其中将创建包含导入过程的日志的 Blob。

done

Callback<JobStatus>

创建作业时要调用的可选函数,具有两个参数:如果发生错误,则为 error 对象,否则 (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

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

outputBlobContainerUri

string

容器的 URI,其中将创建包含导入过程的日志的 Blob。

done

Callback<JobStatus>

创建作业时要调用的可选函数,具有两个参数:如果发生错误,则为 error 对象,否则 (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) 、表示列出的设备标识的 Device 对象数组以及用于日志记录或调试的特定于传输的响应对象。

listJobs()

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

返回

Promise<ResultWithHttpResponse<any>>

listJobs(HttpResponseCallback<any>)

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

function listJobs(done?: HttpResponseCallback<any>)

参数

done

HttpResponseCallback<any>

使用两个参数调用的可选函数:如果发生错误,则为 error 对象;否则 (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 将使用三个参数调用:错误对象 (可为 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 将使用三个参数调用:错误对象 (可为 null) 、BulkRegistryOperationResult 和用于日志记录或调试的特定于传输的响应对象。

removeModule(Module, TripleValueCallback<any, any>)

从注册表中删除给定的模块

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

参数

module
Module
done

TripleValueCallback<any, any>

操作完成时要调用的可选函数。 done 将使用三个参数调用:错误对象 (可为 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 必须包含可更新的所有属性。 例如,如果将 属性从 disabled 更新statusenabled,则deviceInfo对象还应将 statusReason、身份验证 (及其子属性) 、功能和 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

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

done

HttpResponseCallback<any>

操作完成时要调用的可选函数。 done 将使用三个参数调用:错误对象 (可为 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 元素必须包含可更新的所有属性。 例如,如果将 属性从 disabled 更新statusenabled,则 对象还应具有 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 对象或设备孪生实例调用的可选回调。