n8n-nodes-librenms
Version:
n8n community node for LibreNMS network monitoring system integration with comprehensive device management and monitoring capabilities
178 lines (177 loc) • 5.39 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.locationsFields = exports.locationsOperations = void 0;
exports.locationsOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['locations'],
},
},
options: [
{
name: 'Get All',
value: 'getAll',
description: 'Get all locations',
action: 'Get all locations',
routing: {
request: {
method: 'GET',
url: '/resources/locations',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'locations',
},
},
],
},
},
},
{
name: 'Get',
value: 'get',
description: 'Get a specific location',
action: 'Get a location',
routing: {
request: {
method: 'GET',
url: '=/location/{{$parameter.locationId}}',
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'get_location',
},
},
],
},
},
},
{
name: 'Create',
value: 'create',
description: 'Add a new location',
action: 'Create a location',
routing: {
request: {
method: 'POST',
url: '/locations',
},
send: {
type: 'body',
},
},
},
{
name: 'Update',
value: 'update',
description: 'Update a location',
action: 'Update a location',
routing: {
request: {
method: 'PATCH',
url: '=/locations/{{$parameter.locationId}}',
},
send: {
type: 'body',
},
},
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a location',
action: 'Delete a location',
routing: {
request: {
method: 'DELETE',
url: '=/locations/{{$parameter.locationId}}',
},
},
},
],
default: 'getAll',
},
];
exports.locationsFields = [
// Location ID for specific operations
{
displayName: 'Location',
name: 'locationId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['locations'],
operation: ['get', 'update', 'delete'],
},
},
default: '',
placeholder: 'location name or ID',
description: 'Location name or ID',
},
// Fields for creating locations
{
displayName: 'Location Name',
name: 'location',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['locations'],
operation: ['create'],
},
},
default: '',
description: 'Name of the location',
},
// Location coordinates
{
displayName: 'Coordinates',
name: 'coordinates',
type: 'collection',
placeholder: 'Add Coordinates',
default: {},
displayOptions: {
show: {
resource: ['locations'],
operation: ['create', 'update'],
},
},
options: [
{
displayName: 'Latitude',
name: 'lat',
type: 'string',
default: '',
placeholder: '37.4220041',
description: 'Latitude coordinate',
},
{
displayName: 'Longitude',
name: 'lng',
type: 'string',
default: '',
placeholder: '-122.0862462',
description: 'Longitude coordinate',
},
{
displayName: 'Fixed Coordinates',
name: 'fixed_coordinates',
type: 'boolean',
default: true,
description: 'Whether coordinates are fixed or can be updated from device',
},
],
},
];