n8n-nodes-proxmox
Version:
n8n community node for Proxmox Virtual Environment (VE) API integration with VM, container, storage, and cluster management capabilities
92 lines (91 loc) • 3.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProxMoxMinimal = void 0;
class ProxMoxMinimal {
constructor() {
this.description = {
displayName: 'ProxMox VE Minimal',
name: 'proxMoxMinimal',
icon: 'file:ProxMox.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Minimal ProxMox node for debugging',
defaults: {
name: 'ProxMox VE Minimal',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'proxMoxApi',
required: true,
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Virtual Machine',
value: 'vm',
description: 'Manage virtual machines',
},
],
default: 'vm',
required: true,
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['vm'],
},
},
options: [
{
name: 'Get All',
value: 'getAll',
description: 'Get all virtual machines',
action: 'Get all virtual machines',
},
],
default: 'getAll',
},
],
};
}
async execute() {
console.log('\n\n========== PROXMOX MINIMAL NODE EXECUTION STARTED ==========');
try {
const items = this.getInputData();
const returnData = [];
console.log('Getting parameters...');
const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0);
console.log('Parameters retrieved:', { resource, operation });
// Simple test data
returnData.push({
json: {
test: 'ProxMox minimal node working',
resource,
operation,
},
});
console.log('========== PROXMOX MINIMAL NODE EXECUTION COMPLETED ==========\n\n');
return [returnData];
}
catch (error) {
console.log('ERROR in minimal node execution:');
console.log(error);
throw error;
}
}
}
exports.ProxMoxMinimal = ProxMoxMinimal;