A node.js client for the Proxmox API
const proxmox = require('proxmox-client');
proxmox.auth('localhost:8006', 'root@pam!testToken', 'token').then(() => {
proxmox.get('/nodes').then((res) => {
if(res.status !== 200) {
console.log("statusCode is not 200");
}
res = JSON.parse(res.text).data;
console.log(res);
})
.catch((err) => {
console.log('Error:', err);
});
}).catch((err) => {
console.log(err);
});
const proxmox = require('proxmox-client');
proxmox.auth('localhost:8006', 'root@pam!testToken', 'token').then(() => {
proxmox.post('/nodes/testnode/qemu/100/status/reboot', {timeout: 1500}).then((res) => {
if(res.status !== 200) {
console.log("statusCode is not 200");
}
res = JSON.parse(res.text).data;
console.log(res);
})
.catch((err) => {
console.log('Error:', err);
});
}).catch((err) => {
console.log(err);
});
});
Stores the auth information
Stores the auth information
Sends a GET Request to the defined path and returns a superagent request
Sends a POST Request to the defined path with the defined body and returns a superagent request
Sends a PUT Request to the defined path with the defined body and returns a superagent request
Sends a DELETE Request to the defined path and returns a superagent request
Sends a DELETE Request to the defined path and returns a superagent request
You can enable the debug outputs by setting the DEBUG environment variable to 'proxmox:*'.
GPL-3.0