UNPKG

n8n-nodes-arubacentral

Version:

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

80 lines (77 loc) 3.66 kB
// api/monitoring/switch/switch.methods.ts import { IExecuteFunctions } from 'n8n-workflow'; import { logger } from '../../../helpers/logger'; import { listSwitches } from './operations/listSwitches.methods'; import { getSwitchVlanInfo } from './operations/getSwitchVlanInfo.methods'; import { getCxSwitchVlanInfo } from './operations/getCxSwitchVlanInfo.methods'; import { getSwitchStackVlanInfo } from './operations/getSwitchStackVlanInfo.methods'; import { getCxSwitchStackVlanInfo } from './operations/getCxSwitchStackVlanInfo.methods'; import { getSwitchPortPoeInfo } from './operations/getSwitchPortPoeInfo.methods'; import { getCxSwitchPortPoeInfo } from './operations/getCxSwitchPortPoeInfo.methods'; import { getSwitchPoeInfo } from './operations/getSwitchPoeInfo.methods'; import { getCxSwitchPoeInfo } from './operations/getCxSwitchPoeInfo.methods'; import { getCxSwitchVsxInfo } from './operations/getCxSwitchVsxInfo.methods'; import { getCxSwitchNeighborInfo } from './operations/getCxSwitchNeighborInfo.methods'; import { getCxSwitchStackNeighborInfo } from './operations/getCxSwitchStackNeighborInfo.methods'; import { getSwitchBandwidthUsage } from './operations/getSwitchBandwidthUsage.methods'; import { getTopNSwitches } from './operations/getTopNSwitches.methods'; import { getSwitchDetails } from './operations/getSwitchDetails.methods'; import { deleteSwitch } from './operations/deleteSwitch.methods'; import { getSwitchPortsDetails } from './operations/getSwitchPortsDetails.methods'; import { getCxSwitchPortsDetails } from './operations/getCxSwitchPortsDetails.methods'; import { getSwitchChassisDetails } from './operations/getSwitchChassisDetails.methods'; import { getSwitchPortsBandwidthUsage } from './operations/getSwitchPortsBandwidthUsage.methods'; import { getCxSwitchPortsBandwidthUsage } from './operations/getCxSwitchPortsBandwidthUsage.methods'; import { getSwitchPortsErrors } from './operations/getSwitchPortsErrors.methods'; import { getCxSwitchPortsErrors } from './operations/getCxSwitchPortsErrors.methods'; import { getSwitchStackPortDetails } from './operations/getSwitchStackPortDetails.methods'; import { getCxSwitchStackPortDetails } from './operations/getCxSwitchStackPortDetails.methods'; import { listSwitchStacks } from './operations/listSwitchStacks.methods'; import { getSwitchStackDetails } from './operations/getSwitchStackDetails.methods'; import { deleteSwitchStack } from './operations/deleteSwitchStack.methods'; /** * All operations available for the switch resource */ export const switchOperations = { listSwitches, getSwitchVlanInfo, getCxSwitchVlanInfo, getSwitchStackVlanInfo, getCxSwitchStackVlanInfo, getSwitchPortPoeInfo, getCxSwitchPortPoeInfo, getSwitchPoeInfo, getCxSwitchPoeInfo, getCxSwitchVsxInfo, getCxSwitchNeighborInfo, getCxSwitchStackNeighborInfo, getSwitchBandwidthUsage, getTopNSwitches, getSwitchDetails, deleteSwitch, getSwitchPortsDetails, getCxSwitchPortsDetails, getSwitchChassisDetails, getSwitchPortsBandwidthUsage, getCxSwitchPortsBandwidthUsage, getSwitchPortsErrors, getCxSwitchPortsErrors, getSwitchStackPortDetails, getCxSwitchStackPortDetails, listSwitchStacks, getSwitchStackDetails, deleteSwitchStack, }; /** * Check if a switch operation exists * @param operation Operation name to check * @returns boolean indicating if the operation exists */ export function hasSwitchOperation(operation: string): boolean { const exists = !!switchOperations[operation as keyof typeof switchOperations]; logger.debug( 'monitoring:switch:check', `Operation "${operation}" ${exists ? 'exists' : 'does not exist'}`, ); return exists; }