import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.runAction({
serverId: "sv_WVQJDMVBORbyE",
requestBody: {
data: {
type: "actions",
attributes: {
action: "reboot",
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "act_73qkbw0QmjdaJ",
"type": "actions",
"attributes": {
"status": "Rebooting device"
}
},
"meta": {}
}Performs an action on a given server:
power_onpower_offrebootimport { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.servers.runAction({
serverId: "sv_WVQJDMVBORbyE",
requestBody: {
data: {
type: "actions",
attributes: {
action: "reboot",
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "act_73qkbw0QmjdaJ",
"type": "actions",
"attributes": {
"status": "Rebooting device"
}
},
"meta": {}
}Was this page helpful?