使用 Node SDK 以编程方式声明 IoT 中心设备之间的父子关系

Programmatically declare a parent-child relationship between the devices in IoT Hub using Node SDK

使用 Node SDK,我在 IoT 中心以编程方式创建了设备。我想知道 Node SDK 是否为我提供了将设备设置为另一设备的子设备的功能。

看文档,没找到方法(使用SDK)。有没有其他方法可以达到同样的效果?

据我所知和您所发现的,SDK 不允许您为设备 (https://docs.microsoft.com/javascript/api/azure-iothub/devicescreateorupdateidentityoptionalparams?view=azure-node-latest) 创建 parent/child 关系。

但是,REST API 使用 deviceScope 参数 (https://docs.microsoft.com/en-us/rest/api/iothub/service/devices/create-or-update-identity) 支持此功能。

您可能会在这里找到更多信息: