n8n-nodes-arubacentralnextgen
Version:
n8n community node for Aruba Central NextGen API integration with modern monitoring and management capabilities
311 lines (310 loc) • 11.6 kB
JavaScript
;
// descriptions/system/configAssignment.descriptions.ts
// UI Descriptions for Config Assignment Operations
Object.defineProperty(exports, "__esModule", { value: true });
exports.configAssignmentFields = exports.configAssignmentOperations = void 0;
/**
* Config Assignment Operations
* Maps configuration profiles to scopes and device functions.
*
* Scopes: Global, Site Collection, Site, Device Collection, Device
* Device functions: CAMPUS_AP, BRANCH_GW, MOBILITY_GW, ACCESS_SWITCH, etc.
*
* API Reference: https://developer.arubanetworks.com/new-central-config/reference/readconfigassignments
* Base Path: /network-config/v1alpha1/config-assignments
*/
exports.configAssignmentOperations = {
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
},
},
options: [
{
name: 'List Config Assignments',
value: 'listConfigAssignments',
description: 'Retrieve all config assignments, optionally filtered by scope and device function',
action: 'List config assignments',
},
{
name: 'Get Config Assignment',
value: 'getConfigAssignment',
description: 'Get a specific config assignment by scope ID, device function, profile type, and profile instance',
action: 'Get a config assignment',
},
{
name: 'Create Config Assignment',
value: 'createConfigAssignment',
description: 'Create a new config assignment mapping a profile to a scope and device function',
action: 'Create a config assignment',
},
{
name: 'Delete Config Assignment',
value: 'deleteConfigAssignment',
description: 'Delete a specific config assignment by scope ID, device function, profile type, and profile instance',
action: 'Delete a config assignment',
},
],
default: 'listConfigAssignments',
};
const deviceFunctionOptions = [
{ name: 'Access Switch', value: 'ACCESS_SWITCH' },
{ name: 'Aggregation Switch', value: 'AGG_SWITCH' },
{ name: 'All', value: 'ALL' },
{ name: 'AOS-S Access Switch', value: 'AOSS_ACCESS_SWITCH' },
{ name: 'AOS-S Aggregation Switch', value: 'AOSS_AGG_SWITCH' },
{ name: 'AOS-S Core Switch', value: 'AOSS_CORE_SWITCH' },
{ name: 'Branch Gateway', value: 'BRANCH_GW' },
{ name: 'Bridge', value: 'BRIDGE' },
{ name: 'Campus AP', value: 'CAMPUS_AP' },
{ name: 'Core Switch', value: 'CORE_SWITCH' },
{ name: 'Hybrid NAC', value: 'HYBRID_NAC' },
{ name: 'IoT', value: 'IOT' },
{ name: 'Microbranch AP', value: 'MICROBRANCH_AP' },
{ name: 'Mobility Gateway', value: 'MOBILITY_GW' },
{ name: 'Service Persona', value: 'SERVICE_PERSONA' },
{ name: 'VPN Concentrator', value: 'VPNC' },
];
exports.configAssignmentFields = [
// ============================================================
// Shared path parameters (Get, Create, Delete)
// ============================================================
{
displayName: 'Scope ID',
name: 'scopeId',
type: 'string',
required: true,
default: '',
description: 'The scope ID (site, site collection, device, etc.) to which the assignment applies',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['getConfigAssignment', 'createConfigAssignment', 'deleteConfigAssignment'],
},
},
},
{
displayName: 'Device Function',
name: 'deviceFunction',
type: 'options',
options: deviceFunctionOptions,
required: true,
default: 'CAMPUS_AP',
description: 'The device function persona for this assignment',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['getConfigAssignment', 'createConfigAssignment', 'deleteConfigAssignment'],
},
},
},
{
displayName: 'Profile Type',
name: 'profileType',
type: 'string',
required: true,
default: '',
placeholder: 'roles',
description: 'The type of profile to assign (e.g. roles, policies)',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['getConfigAssignment', 'createConfigAssignment', 'deleteConfigAssignment'],
},
},
},
{
displayName: 'Profile Instance',
name: 'profileInstance',
type: 'string',
required: true,
default: '',
placeholder: 'Role1',
description: 'The profile instance name to assign (e.g. Role1)',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['getConfigAssignment', 'createConfigAssignment', 'deleteConfigAssignment'],
},
},
},
// ============================================================
// List Config Assignments - Additional Fields
// ============================================================
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
placeholder: 'Add Field',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['listConfigAssignments'],
},
},
options: [
{
displayName: 'View Type',
name: 'viewType',
type: 'options',
options: [
{
name: 'Library (Shared Objects)',
value: 'LIBRARY',
description: 'Returns shared objects in the library',
},
{
name: 'Local (Scope-Specific)',
value: 'LOCAL',
description: 'Returns configurations for a specific scope and device function',
},
],
default: 'LOCAL',
description: 'LIBRARY returns shared objects; LOCAL returns scope-specific configuration',
},
{
displayName: 'Object Type',
name: 'objectType',
type: 'options',
options: [
{ name: 'Both (Default)', value: '' },
{ name: 'Local', value: 'LOCAL' },
{ name: 'Shared', value: 'SHARED' },
],
default: '',
description: 'Filter by object type: LOCAL, SHARED, or both',
},
{
displayName: 'Scope ID',
name: 'scopeId',
type: 'string',
default: '',
description: 'Filter by scope ID. Required when View Type is LOCAL',
},
{
displayName: 'Device Function',
name: 'deviceFunction',
type: 'options',
options: [{ name: 'All', value: '' }, ...deviceFunctionOptions],
default: '',
description: 'Filter by device function type',
},
{
displayName: 'Effective',
name: 'effective',
type: 'boolean',
default: false,
description: 'Whether to return the effective (hierarchically merged) configuration rather than the committed configuration at a given scope',
},
{
displayName: 'Detailed',
name: 'detailed',
type: 'boolean',
default: false,
description: 'Whether to include annotations indicating the type, scope, and device function of each object',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 100,
description: 'Number of results to return',
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
default: 0,
description: 'Number of results to skip for pagination',
},
],
},
// ============================================================
// Get Config Assignment - Additional Fields
// ============================================================
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
placeholder: 'Add Field',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['getConfigAssignment'],
},
},
options: [
{
displayName: 'Effective',
name: 'effective',
type: 'boolean',
default: false,
description: 'Whether to return the effective (hierarchically merged) configuration',
},
{
displayName: 'Detailed',
name: 'detailed',
type: 'boolean',
default: false,
description: 'Whether to include annotations indicating the type, scope, and device function',
},
],
},
// ============================================================
// Delete Config Assignment - Additional Fields
// ============================================================
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
placeholder: 'Add Field',
displayOptions: {
show: {
domain: ['system'],
resource: ['configAssignment'],
operation: ['deleteConfigAssignment'],
},
},
options: [
{
displayName: 'Object Type',
name: 'objectType',
type: 'options',
options: [
{ name: 'Shared (Default)', value: 'SHARED' },
{ name: 'Local', value: 'LOCAL' },
],
default: 'SHARED',
description: 'Whether to delete a LOCAL or SHARED object',
},
{
displayName: 'Override Scope ID',
name: 'overrideScopeId',
type: 'string',
default: '',
description: 'Scope at which local object needs to be deleted. Required when Object Type is LOCAL',
},
{
displayName: 'Override Device Function',
name: 'overrideDeviceFunction',
type: 'string',
default: '',
description: 'Device function for which local object needs to be deleted. Required when Object Type is LOCAL',
},
],
},
];