n8n-nodes-arubacentral
Version:
n8n community node for Aruba Central API integration with comprehensive monitoring, configuration, and management capabilities
27 lines (26 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDeviceStats = getDeviceStats;
const apiRequest_1 = require("../../../helpers/apiRequest");
const responseFormatter_1 = require("../../../helpers/responseFormatter");
const logger_1 = require("../../../helpers/logger");
async function getDeviceStats() {
logger_1.logger.info('inventory:devices:getDeviceStats', 'Starting getDeviceStats operation');
try {
const skuType = this.getNodeParameter('skuType', 0);
const serviceType = this.getNodeParameter('serviceType', 0);
const queryParams = {
sku_type: skuType,
service_type: serviceType,
};
logger_1.logger.debug('inventory:devices:getDeviceStats', `Query params: ${JSON.stringify(queryParams)}`);
// Make API request
const response = await apiRequest_1.apiRequest.call(this, 'GET', '/platform/device_inventory/v1/devices/stats', {}, queryParams);
logger_1.logger.info('inventory:devices:getDeviceStats', 'Device stats retrieved successfully');
return (0, responseFormatter_1.formatResponse)(response);
}
catch (error) {
logger_1.logger.error('inventory:devices:getDeviceStats:error', error.message);
throw error;
}
}