UNPKG

n8n-nodes-arubacentral

Version:

n8n community node for Aruba Central API integration with comprehensive monitoring, configuration, and management capabilities

25 lines (24 loc) 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.deleteDevice = deleteDevice; const apiRequest_1 = require("../../../helpers/apiRequest"); const responseFormatter_1 = require("../../../helpers/responseFormatter"); const logger_1 = require("../../../helpers/logger"); async function deleteDevice() { logger_1.logger.info('inventory:devices:deleteDevice', 'Starting deleteDevice operation'); try { const serial = this.getNodeParameter('serial', 0); const requestBody = { serial, }; logger_1.logger.debug('inventory:devices:deleteDevice', `Deleting device with serial: ${serial}`); // Make API request const response = await apiRequest_1.apiRequest.call(this, 'DELETE', '/platform/device_inventory/v1/devices', requestBody, {}); logger_1.logger.info('inventory:devices:deleteDevice', 'Device deleted successfully'); return (0, responseFormatter_1.formatResponse)(response); } catch (error) { logger_1.logger.error('inventory:devices:deleteDevice:error', error.message); throw error; } }