30 lines
816 B
JavaScript
30 lines
816 B
JavaScript
/*const apiKey = {
|
|
tokenID: 'test@pam!fixparsec',
|
|
secret: 'b4e53082-4891-4d36-95c6-8662bd58f2ee'
|
|
}
|
|
HTTP: POST /api2/json/nodes/{node}/qemu/{vmid}/status/reboot
|
|
url -H "Authorization: test@pam!fixparsec=b4e53082-4891-4d36-95c6-8662bd58f2ee" https://192.168.1.32:8006/api2/json/*/
|
|
|
|
var request = require('request');
|
|
|
|
var headers = {
|
|
'Authorization': 'test@pam!fixparsec=b4e53082-4891-4d36-95c6-8662bd58f2ee'
|
|
};
|
|
|
|
var options = {
|
|
url: 'https://192.168.1.32:8006/api2/json/nodes/pve1/qemu/109/status/reboot',
|
|
headers: headers
|
|
};
|
|
|
|
function callback(error, response, body) {
|
|
if (!error && response.statusCode == 200) {
|
|
console.log(body);
|
|
}
|
|
console.log(body);
|
|
console.log(response)
|
|
console.log(error);
|
|
|
|
}
|
|
|
|
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
|
|
request(options, callback); |