Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions iot/manager/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
'use strict';

const fs = require('fs');

// [START iot_get_client]
const {google} = require('googleapis');
const iot = require('@google-cloud/iot');

const API_VERSION = 'v1';
const DISCOVERY_API = 'https://cloudiot.googleapis.com/$discovery/rest';

const client = new iot.v1.DeviceManagerClient();
// [END iot_get_client]


// Configures the topic for Cloud IoT Core.
const setupIotTopic = async topicName => {
Expand Down Expand Up @@ -815,6 +819,7 @@ const getRegistry = async (client, registryId, projectId, cloudRegion) => {
// [END iot_get_registry]
};

// [START iot_get_client]
// Returns an authorized API client by discovering the Cloud IoT Core API with
// the provided API key.
const getClient = async serviceAccountJson => {
Expand All @@ -837,6 +842,7 @@ const getClient = async serviceAccountJson => {
console.log('Error during API discovery.', err);
}
};
// [END iot_get_client]

// Retrieves the IAM policy for a given registry.
const getIamPolicy = async (client, registryId, projectId, cloudRegion) => {
Expand Down