UNPKG

n8n-nodes-librenms

Version:

n8n community node for LibreNMS network monitoring system integration with comprehensive device management and monitoring capabilities

400 lines (399 loc) 12.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.routingFields = exports.routingOperations = void 0; exports.routingOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['routing'], }, }, options: [ { name: 'List BGP Sessions', value: 'listBgp', description: 'List BGP sessions', action: 'List BGP sessions', routing: { request: { method: 'GET', url: '/bgp', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'bgp_sessions', }, }, ], }, }, }, { name: 'Get BGP Session', value: 'getBgp', description: 'Get a specific BGP session', action: 'Get BGP session', routing: { request: { method: 'GET', url: '=/bgp/{{$parameter.bgpId}}', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'bgp_session', }, }, ], }, }, }, { name: 'Update BGP Description', value: 'updateBgpDescription', description: 'Update BGP session description', action: 'Update BGP description', routing: { request: { method: 'POST', url: '=/bgp/{{$parameter.bgpId}}', }, send: { type: 'body', }, }, }, { name: 'List OSPF Neighbors', value: 'listOspf', description: 'List OSPF neighbors', action: 'List OSPF neighbors', routing: { request: { method: 'GET', url: '/ospf', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'ospf_neighbours', }, }, ], }, }, }, { name: 'List VRFs', value: 'listVrf', description: 'List VRFs', action: 'List VRFs', routing: { request: { method: 'GET', url: '/routing/vrf', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'vrfs', }, }, ], }, }, }, { name: 'Get VRF', value: 'getVrf', description: 'Get a specific VRF', action: 'Get VRF', routing: { request: { method: 'GET', url: '=/routing/vrf/{{$parameter.vrfId}}', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'vrf', }, }, ], }, }, }, { name: 'List IP Addresses', value: 'listIpAddresses', description: 'List IP addresses', action: 'List IP addresses', routing: { request: { method: 'GET', url: '=/resources/ip/addresses{{$parameter.addressFamily ? "/" + $parameter.addressFamily : ""}}', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'ip_addresses', }, }, ], }, }, }, { name: 'List IP Networks', value: 'listIpNetworks', description: 'List IP networks', action: 'List IP networks', routing: { request: { method: 'GET', url: '=/resources/ip/networks{{$parameter.addressFamily ? "/" + $parameter.addressFamily : ""}}', }, output: { postReceive: [ { type: 'rootProperty', properties: { property: 'ip_networks', }, }, ], }, }, }, ], default: 'listBgp', }, ]; exports.routingFields = [ // BGP Session ID { displayName: 'BGP Session ID', name: 'bgpId', type: 'string', required: true, displayOptions: { show: { resource: ['routing'], operation: ['getBgp', 'updateBgpDescription'], }, }, default: '', description: 'BGP session ID', }, // VRF ID { displayName: 'VRF ID', name: 'vrfId', type: 'string', required: true, displayOptions: { show: { resource: ['routing'], operation: ['getVrf'], }, }, default: '', description: 'VRF ID', }, // BGP Description update { displayName: 'BGP Description', name: 'bgp_descr', type: 'string', required: true, displayOptions: { show: { resource: ['routing'], operation: ['updateBgpDescription'], }, }, default: '', description: 'New BGP session description', }, // Address family for IP operations { displayName: 'Address Family', name: 'addressFamily', type: 'options', displayOptions: { show: { resource: ['routing'], operation: ['listIpAddresses', 'listIpNetworks'], }, }, options: [ { name: 'All', value: '' }, { name: 'IPv4', value: 'ipv4' }, { name: 'IPv6', value: 'ipv6' }, ], default: '', description: 'IP address family to filter by', }, // Filters for BGP { displayName: 'BGP Filters', name: 'bgpFilters', type: 'collection', placeholder: 'Add Filter', default: {}, displayOptions: { show: { resource: ['routing'], operation: ['listBgp'], }, }, options: [ { displayName: 'Hostname', name: 'hostname', type: 'string', default: '', description: 'Filter by device hostname or ID', routing: { send: { type: 'query', property: 'hostname', }, }, }, { displayName: 'Local ASN', name: 'asn', type: 'string', default: '', description: 'Filter by local ASN', routing: { send: { type: 'query', property: 'asn', }, }, }, { displayName: 'Remote ASN', name: 'remote_asn', type: 'string', default: '', description: 'Filter by remote ASN', routing: { send: { type: 'query', property: 'remote_asn', }, }, }, { displayName: 'BGP State', name: 'bgp_state', type: 'options', options: [ { name: 'Established', value: 'established' }, { name: 'Idle', value: 'idle' }, { name: 'Active', value: 'active' }, { name: 'Connect', value: 'connect' }, ], default: '', description: 'Filter by BGP session state', routing: { send: { type: 'query', property: 'bgp_state', }, }, }, ], }, // Filters for OSPF { displayName: 'OSPF Filters', name: 'ospfFilters', type: 'collection', placeholder: 'Add Filter', default: {}, displayOptions: { show: { resource: ['routing'], operation: ['listOspf'], }, }, options: [ { displayName: 'Hostname', name: 'hostname', type: 'string', default: '', description: 'Filter by device hostname or ID', routing: { send: { type: 'query', property: 'hostname', }, }, }, ], }, // Filters for VRF { displayName: 'VRF Filters', name: 'vrfFilters', type: 'collection', placeholder: 'Add Filter', default: {}, displayOptions: { show: { resource: ['routing'], operation: ['listVrf'], }, }, options: [ { displayName: 'Hostname', name: 'hostname', type: 'string', default: '', description: 'Filter by device hostname or ID', routing: { send: { type: 'query', property: 'hostname', }, }, }, { displayName: 'VRF Name', name: 'vrfname', type: 'string', default: '', description: 'Filter by VRF name', routing: { send: { type: 'query', property: 'vrfname', }, }, }, ], }, ];