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

List device registries

List device registries.

Code sample

Node.js

const iot = require('@google-cloud/iot');
const client = new iot.v1.DeviceManagerClient();

async function quickstart() {
  const projectId = await client.getProjectId();
  const parent = client.locationPath(projectId, 'us-central1');
  const [resources] = await client.listDeviceRegistries({parent});
  console.log(`${resources.length} resource(s) found.`);
  for (const resource of resources) {
    console.log(resource);
  }
}
quickstart();

What's next

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