n8n-nodes-librenms
Version:
n8n community node for LibreNMS network monitoring system integration with comprehensive device management and monitoring capabilities
59 lines (58 loc) • 1.98 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LibreNmsApi = void 0;
class LibreNmsApi {
constructor() {
this.name = 'libreNmsApi';
this.displayName = 'LibreNMS API';
this.documentationUrl = 'https://docs.librenms.org/API/';
this.properties = [
{
displayName: 'LibreNMS URL',
name: 'url',
type: 'string',
default: '',
placeholder: 'https://librenms.example.com',
required: true,
description: 'The URL of your LibreNMS instance',
},
{
displayName: 'API Token',
name: 'apiToken',
type: 'string',
typeOptions: {
password: true,
},
default: '',
required: true,
description: 'API token generated in LibreNMS at /api-access/',
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
default: false,
description: 'Whether to connect even if SSL certificate validation is not possible',
},
];
this.authenticate = {
type: 'generic',
properties: {
headers: {
'X-Auth-Token': '={{$credentials.apiToken}}',
Accept: 'application/json',
'Content-Type': 'application/json',
},
},
};
this.test = {
request: {
baseURL: '={{$credentials.url.replace(/\\/$/, "")}}',
url: '/api/v0/system',
method: 'GET',
skipSslCertificateValidation: '={{$credentials.allowUnauthorizedCerts}}',
},
};
}
}
exports.LibreNmsApi = LibreNmsApi;