n8n-nodes-librenms
Version:
n8n community node for LibreNMS network monitoring system integration with comprehensive device management and monitoring capabilities
102 lines (98 loc) • 1.99 kB
text/typescript
import { INodeProperties } from 'n8n-workflow';
export const arpOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['arp'],
},
},
options: [
{
name: 'Get ARP Entry',
value: 'getArpEntry',
description: 'Retrieve ARP entry by IP, MAC, or network',
action: 'Get ARP entry',
routing: {
request: {
method: 'GET',
url: '=/resources/ip/arp/{{$parameter.query}}',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'arp',
},
},
],
},
},
},
{
name: 'Get Device ARP',
value: 'getDeviceArp',
description: 'Get all ARP entries for a device',
action: 'Get device ARP entries',
routing: {
request: {
method: 'GET',
url: '/resources/ip/arp/all',
qs: {
device: '={{$parameter.deviceId}}',
},
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'arp',
},
},
],
},
},
},
],
default: 'getArpEntry',
},
];
export const arpFields: INodeProperties[] = [
// Query field for IP/MAC/Network lookup
{
displayName: 'Query',
name: 'query',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['arp'],
operation: ['getArpEntry'],
},
},
default: '',
placeholder: '192.168.1.1 or 00:11:22:33:44:55 or 192.168.1.0/24',
description: 'IP address, MAC address, or CIDR network to search for',
},
// Device ID for device-specific ARP lookup
{
displayName: 'Device',
name: 'deviceId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['arp'],
operation: ['getDeviceArp'],
},
},
default: '',
placeholder: 'hostname or device ID',
description: 'Device hostname or ID',
},
];