Google Cloud IoT Core is being retired on August 16, 2023. Contact your Google Cloud account team for more information.

Lookup registry

Lookup a registry.

Code sample

Node.js

For more information, see the Cloud IoT Core Node.js API reference documentation.

To authenticate to Cloud IoT Core, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

// const cloudRegion = 'us-central1';
// const projectId = 'adjective-noun-123';
// const registryId = 'my-registry';
const iot = require('@google-cloud/iot');

const iotClient = new iot.v1.DeviceManagerClient({
  // optional auth parameters.
});

const registryName = iotClient.registryPath(
  projectId,
  cloudRegion,
  registryId
);

async function getDeviceRegistry() {
  // Construct request
  const [response] = await iotClient.getDeviceRegistry({name: registryName});
  console.log(response);
}

getDeviceRegistry();

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.