UNPKG

n8n-nodes-arubacentral

Version:

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

34 lines (33 loc) 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCxSwitchStackNeighborInfo = getCxSwitchStackNeighborInfo; const apiRequest_1 = require("../../../../helpers/apiRequest"); const logger_1 = require("../../../../helpers/logger"); const errorHandler_1 = require("../../../../helpers/errorHandler"); /** * Get LLDP Device Neighbor Info for CX Switch Stack * * GET /monitoring/v1/cx_switch_stacks/{stack_id}/neighbors * * @param this The n8n execution context * @returns Formatted API response */ async function getCxSwitchStackNeighborInfo() { try { // Get parameters const stackId = this.getNodeParameter('stack_id', 0); logger_1.logger.debug('monitoring:switch:getCxSwitchStackNeighborInfo', `Getting LLDP neighbor info for CX switch stack with ID: ${stackId}`); // Make API request const endpoint = `/monitoring/v1/cx_switch_stacks/${encodeURIComponent(stackId)}/neighbors`; const responseData = await apiRequest_1.apiRequest.call(this, 'GET', endpoint); logger_1.logger.debug('monitoring:switch:getCxSwitchStackNeighborInfo', 'Successfully retrieved CX switch stack LLDP neighbor info'); // Return formatted response return [{ json: responseData }]; } catch (error) { logger_1.logger.error('monitoring:switch:getCxSwitchStackNeighborInfo:error', { message: error.message, }); return errorHandler_1.handleApiError.call(this, error, 'Failed to get CX switch stack LLDP neighbor info'); } }