n8n-nodes-arubacentral
Version:
n8n community node for Aruba Central API integration with comprehensive monitoring, configuration, and management capabilities
30 lines (29 loc) • 1.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getArchivedDevices = getArchivedDevices;
const apiRequest_1 = require("../../../helpers/apiRequest");
const responseFormatter_1 = require("../../../helpers/responseFormatter");
const logger_1 = require("../../../helpers/logger");
async function getArchivedDevices() {
var _a;
logger_1.logger.info('inventory:devices:getArchivedDevices', 'Starting getArchivedDevices operation');
try {
const options = this.getNodeParameter('options', 0, {});
const queryParams = {};
if (options.limit) {
queryParams.limit = options.limit;
}
if (options.offset) {
queryParams.offset = options.offset;
}
logger_1.logger.debug('inventory:devices:getArchivedDevices', `Query params: ${JSON.stringify(queryParams)}`);
// Make API request
const response = await apiRequest_1.apiRequest.call(this, 'GET', '/platform/device_inventory/v1/devices/archive', {}, queryParams);
logger_1.logger.info('inventory:devices:getArchivedDevices', `Retrieved ${((_a = response.devices) === null || _a === void 0 ? void 0 : _a.length) || 0} archived devices`);
return (0, responseFormatter_1.formatResponse)(response);
}
catch (error) {
logger_1.logger.error('inventory:devices:getArchivedDevices:error', error.message);
throw error;
}
}