n8n-nodes-arubacentralnextgen
Version:
n8n community node for Aruba Central NextGen API integration with modern monitoring and management capabilities
628 lines (627 loc) • 19 kB
JavaScript
"use strict";
// descriptions/monitoring.descriptions.ts
Object.defineProperty(exports, "__esModule", { value: true });
exports.apFields = exports.apOperations = exports.deviceFields = exports.deviceOperations = void 0;
exports.deviceOperations = {
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
},
},
default: 'getAllDevices',
options: [
{
name: 'Get All Devices',
value: 'getAllDevices',
description: 'Get a list of all network devices (AP, Switch, Gateway)',
action: 'Get all devices',
},
{
name: 'Get Device Inventory',
value: 'getDeviceInventory',
description: 'Get a list of all devices from device inventory',
action: 'Get device inventory',
},
],
};
// Common fields for pagination and filtering
const paginationFields = [
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 20,
description: 'Max number of results to return',
},
];
const deviceCommonFilters = {
displayName: 'Filters',
name: 'filters',
placeholder: 'Add Filter',
type: 'collection',
default: {},
options: [
{
displayName: 'Site ID',
name: 'siteId',
type: 'string',
default: '',
description: 'Filter by site ID',
},
{
displayName: 'Model',
name: 'model',
type: 'string',
default: '',
description: 'Filter by device model',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{ name: 'Online', value: 'ONLINE' },
{ name: 'Offline', value: 'OFFLINE' },
{ name: 'Unknown', value: 'UNKNOWN' },
],
default: '',
description: 'Filter by device status',
},
{
displayName: 'Device Type',
name: 'deviceType',
type: 'options',
options: [
{ name: 'Access Point', value: 'ACCESS_POINT' },
{ name: 'Switch', value: 'SWITCH' },
{ name: 'Gateway', value: 'GATEWAY' },
],
default: '',
description: 'Filter by device type',
},
{
displayName: 'Deployment',
name: 'deployment',
type: 'options',
options: [
{ name: 'Campus', value: 'CAMPUS' },
{ name: 'Branch', value: 'BRANCH' },
],
default: '',
description: 'Filter by deployment type',
},
],
};
const deviceInventoryFilters = {
displayName: 'Filters',
name: 'filters',
placeholder: 'Add Filter',
type: 'collection',
default: {},
options: [
{
displayName: 'Site ID',
name: 'siteId',
type: 'string',
default: '',
description: 'Filter by site ID',
},
{
displayName: 'Model',
name: 'model',
type: 'string',
default: '',
description: 'Filter by device model',
},
{
displayName: 'Device Type',
name: 'deviceType',
type: 'options',
options: [
{ name: 'Access Point', value: 'ACCESS_POINT' },
{ name: 'Switch', value: 'SWITCH' },
{ name: 'Gateway', value: 'GATEWAY' },
],
default: '',
description: 'Filter by device type',
},
{
displayName: 'Is Provisioned',
name: 'isProvisioned',
type: 'boolean',
default: false,
description: 'Filter by provisioning status',
},
{
displayName: 'Persona',
name: 'persona',
type: 'options',
options: [
{ name: 'Controller', value: 'CONTROLLER' },
{ name: 'Managed Device', value: 'MANAGED_DEVICE' },
{ name: 'AOS-CX', value: 'AOS_CX' },
{ name: 'AOS-S', value: 'AOS_S' },
],
default: '',
description: 'Filter by device persona',
},
],
};
// Specific fields for Get All Devices operation
const getAllDevicesFields = [
...paginationFields,
deviceCommonFilters,
{
displayName: 'Sort Options',
name: 'sortOptions',
type: 'string',
default: '',
placeholder: 'siteId asc, status desc',
description: 'Comma-separated list of fields to sort by (append "asc" or "desc" for direction)',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getAllDevices'],
},
},
},
];
// Specific fields for Get Device Inventory operation
const getDeviceInventoryFields = [
...paginationFields,
deviceInventoryFilters,
{
displayName: 'Sort Options',
name: 'sortOptions',
type: 'string',
default: '',
placeholder: 'siteId asc, siteName desc',
description: 'Comma-separated list of fields to sort by (append "asc" or "desc" for direction)',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getDeviceInventory'],
},
},
},
{
displayName: 'Search Term',
name: 'search',
type: 'string',
default: '',
description: 'Search term to filter devices by deviceName, model, serialNumber, etc.',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getDeviceInventory'],
},
},
},
{
displayName: 'Site Assignment Status',
name: 'siteAssigned',
type: 'options',
options: [
{ name: 'All', value: '' },
{ name: 'Assigned', value: 'ASSIGNED' },
{ name: 'Unassigned', value: 'UNASSIGNED' },
],
default: '',
description: 'Filter by site assignment status',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getDeviceInventory'],
},
},
},
];
exports.deviceFields = [
// Fields for Get All Devices operation
...getAllDevicesFields.map((field) => {
var _a;
return ({
...field,
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getAllDevices'],
...(((_a = field.displayOptions) === null || _a === void 0 ? void 0 : _a.show) || {}),
},
},
});
}),
// Fields for Get Device Inventory operation
...getDeviceInventoryFields.map((field) => {
var _a;
return ({
...field,
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['devices'],
operation: ['getDeviceInventory'],
...(((_a = field.displayOptions) === null || _a === void 0 ? void 0 : _a.show) || {}),
},
},
});
}),
];
// Access Point resource operations
exports.apOperations = {
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
},
},
default: 'getAllAPs',
options: [
{
name: 'Get All Access Points',
value: 'getAllAPs',
description: 'Get a list of all access points',
action: 'Get all access points',
},
{
name: 'Get Access Point Details',
value: 'getAPDetails',
description: 'Get detailed information about a specific access point',
action: 'Get access point details',
},
{
name: 'Get Top APs by Wireless Usage',
value: 'getTopAPsByWirelessUsage',
description: 'Get list of APs with highest wireless bandwidth usage',
action: 'Get top APs by wireless usage',
},
{
name: 'Get AP Throughput Trends',
value: 'getAPThroughputTrends',
description: 'Get throughput trend data for an access point',
action: 'Get access point throughput trends',
},
{
name: 'Get AP CPU Utilization',
value: 'getAPCPUUtilization',
description: 'Get CPU utilization trend data for an access point',
action: 'Get access point CPU utilization',
},
{
name: 'Get AP Memory Utilization',
value: 'getAPMemoryUtilization',
description: 'Get memory utilization trend data for an access point',
action: 'Get access point memory utilization',
},
{
name: 'Get AP Power Consumption',
value: 'getAPPowerConsumption',
description: 'Get power consumption trend data for an access point',
action: 'Get access point power consumption',
},
{
name: 'Get AP Radio Details',
value: 'getRadioDetails',
description: 'Get details about radio interfaces for an access point',
action: 'Get access point radio details',
},
{
name: 'Get Radio Performance',
value: 'getRadioPerformance',
description: 'Get comprehensive performance metrics for an AP radio',
action: 'Get radio performance metrics',
},
],
};
// Fields for AP operations
exports.apFields = [
// Return all option
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getAllAPs'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 20,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
maxValue: 100,
},
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getAllAPs'],
returnAll: [false],
},
},
},
// Filter options for getAllAPs
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
options: [
{
displayName: 'Site ID',
name: 'siteId',
type: 'string',
default: '',
description: 'Filter access points by site ID',
},
{
displayName: 'Model',
name: 'model',
type: 'string',
default: '',
description: 'Filter by access point model',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Online',
value: 'ONLINE',
},
{
name: 'Offline',
value: 'OFFLINE',
},
],
default: '',
description: 'Filter by access point status',
},
{
displayName: 'Deployment',
name: 'deployment',
type: 'string',
default: '',
description: 'Filter by deployment mode',
},
],
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getAllAPs'],
},
},
},
// Serial Number field for operations that need it
{
displayName: 'Serial Number',
name: 'serialNumber',
type: 'string',
default: '',
required: true,
description: 'Access point serial number',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: [
'getAPDetails',
'getAPThroughputTrends',
'getAPCPUUtilization',
'getAPMemoryUtilization',
'getAPPowerConsumption',
'getRadioDetails',
'getRadioPerformance',
],
},
},
},
// Site ID for topAPs operation
{
displayName: 'Site ID',
name: 'siteId',
type: 'string',
default: '',
required: true,
description: 'Site ID for which to retrieve AP information',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getTopAPsByWirelessUsage'],
},
},
},
// Limit for top APs
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 10,
description: 'Max number of top access points to return',
typeOptions: {
minValue: 1,
maxValue: 25,
},
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getTopAPsByWirelessUsage'],
},
},
},
// Time range for operations that support it
{
displayName: 'Time Range',
name: 'timeRange',
type: 'collection',
placeholder: 'Add Time Range',
default: {},
options: [
{
displayName: 'Start Time',
name: 'startTime',
type: 'dateTime',
default: '',
description: 'Start time for data retrieval (ISO 8601 format)',
},
{
displayName: 'End Time',
name: 'endTime',
type: 'dateTime',
default: '',
description: 'End time for data retrieval (ISO 8601 format)',
},
],
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: [
'getTopAPsByWirelessUsage',
'getAPThroughputTrends',
'getAPCPUUtilization',
'getAPMemoryUtilization',
'getAPPowerConsumption',
'getRadioPerformance',
],
},
},
},
// Interface type for throughput trends
{
displayName: 'Interface Type',
name: 'interfaceType',
type: 'options',
options: [
{
name: 'Wireless',
value: 'WIRELESS',
},
{
name: 'Wired',
value: 'WIRED',
},
{
name: 'LTE',
value: 'LTE',
},
],
default: 'WIRELESS',
description: 'Type of interface for which to retrieve throughput data',
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getAPThroughputTrends'],
},
},
},
// Radio number for radio operations
{
displayName: 'Radio Number',
name: 'radioNumber',
type: 'number',
default: 0,
description: 'Radio number within the access point',
typeOptions: {
minValue: 0,
maxValue: 5,
},
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getRadioDetails', 'getRadioPerformance'],
},
},
},
// Additional options for radio details
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
options: [
{
displayName: 'Include Channel Utilization',
name: 'includeChannelUtilization',
type: 'boolean',
default: false,
description: 'Whether to include radio channel utilization trends',
},
{
displayName: 'Include Channel Quality',
name: 'includeChannelQuality',
type: 'boolean',
default: false,
description: 'Whether to include radio channel quality trends',
},
{
displayName: 'Include Noise Floor',
name: 'includeNoiseFloor',
type: 'boolean',
default: false,
description: 'Whether to include radio noise floor trends',
},
{
displayName: 'Include Frame Trends',
name: 'includeFrameTrends',
type: 'boolean',
default: false,
description: 'Whether to include radio frame trends (drops, errors, retries)',
},
],
displayOptions: {
show: {
domain: ['monitoring'],
resource: ['aps'],
operation: ['getRadioDetails'],
},
},
},
];