How to use the azure-iothub.Registry function in azure-iothub

To help you get started, we’ve selected a few azure-iothub examples, based on popular ways it is used in public projects.

github Azure / azure-iot-sdks / tools / iothub-explorer / iothub-explorer.js View on Github external
if (command === 'help') {
  usage();
  process.exit(0);
}

if (!connString)
{
  if (!parsed.raw) {
    inputError('Missing connection string');
    usage();
  }
  process.exit(1);
}

var registry = new Registry(connString, new Https());

if (command === 'list') {
  registry.list(function (err, res, list) {
    if (err) serviceError(err);
    else {
      list.forEach(function (device) {
        printDevice(device);
      });
    }
  });
}
else if (command === 'create') {
  if (!arg) inputError('No device information given');
  var info;
  try {
    // 'create' command expects either deviceId or JSON device description