...
After unbinding all devices from the gateway, use the Device delete method to delete the gateway, specifying the ID of the gateway you want to delete.
This Node.js code sample illustrates how to delete a gateway:
Code Block |
---|
// const cloudRegion = 'us-central1';
// const projectId = 'adjective-noun-123';
// const registryId = 'my-registry';
import { DeviceManagerClient } from '@clearblade/iot';
const iotClient = new DeviceManagerClient({
// optional auth parameters.
});
async function deleteDevice() {
// Construct request
const devPath = iotClient.devicePath(projectId, cloudRegion, registryId, deviceId);
const [responses] = await iotClient.deleteDevice({ name: devPath });
console.log('Successfully deleted device', responses);
}
deleteDevice(); |