Power action (start/stop/reboot/rebuild)
curl --request POST \
--url https://console.wenium.com/api/servers/{server}/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "start",
"os_id": "ubuntu-22.04",
"hostname": "rebuilt-server",
"password": "SuperSecretPass123",
"ssh_keys": [
1,
2
],
"firewall_group_id": 5
}
'import requests
url = "https://console.wenium.com/api/servers/{server}/action"
payload = {
"action": "start",
"os_id": "ubuntu-22.04",
"hostname": "rebuilt-server",
"password": "SuperSecretPass123",
"ssh_keys": [1, 2],
"firewall_group_id": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'start',
os_id: 'ubuntu-22.04',
hostname: 'rebuilt-server',
password: 'SuperSecretPass123',
ssh_keys: [1, 2],
firewall_group_id: 5
})
};
fetch('https://console.wenium.com/api/servers/{server}/action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.wenium.com/api/servers/{server}/action",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'start',
'os_id' => 'ubuntu-22.04',
'hostname' => 'rebuilt-server',
'password' => 'SuperSecretPass123',
'ssh_keys' => [
1,
2
],
'firewall_group_id' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.wenium.com/api/servers/{server}/action"
payload := strings.NewReader("{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.wenium.com/api/servers/{server}/action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.wenium.com/api/servers/{server}/action")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Power action start completed successfully."
}Virtual Machines
Power action (start/stop/reboot/rebuild)
POST
/
servers
/
{server}
/
action
Power action (start/stop/reboot/rebuild)
curl --request POST \
--url https://console.wenium.com/api/servers/{server}/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "start",
"os_id": "ubuntu-22.04",
"hostname": "rebuilt-server",
"password": "SuperSecretPass123",
"ssh_keys": [
1,
2
],
"firewall_group_id": 5
}
'import requests
url = "https://console.wenium.com/api/servers/{server}/action"
payload = {
"action": "start",
"os_id": "ubuntu-22.04",
"hostname": "rebuilt-server",
"password": "SuperSecretPass123",
"ssh_keys": [1, 2],
"firewall_group_id": 5
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
action: 'start',
os_id: 'ubuntu-22.04',
hostname: 'rebuilt-server',
password: 'SuperSecretPass123',
ssh_keys: [1, 2],
firewall_group_id: 5
})
};
fetch('https://console.wenium.com/api/servers/{server}/action', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.wenium.com/api/servers/{server}/action",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'action' => 'start',
'os_id' => 'ubuntu-22.04',
'hostname' => 'rebuilt-server',
'password' => 'SuperSecretPass123',
'ssh_keys' => [
1,
2
],
'firewall_group_id' => 5
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.wenium.com/api/servers/{server}/action"
payload := strings.NewReader("{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://console.wenium.com/api/servers/{server}/action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.wenium.com/api/servers/{server}/action")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"action\": \"start\",\n \"os_id\": \"ubuntu-22.04\",\n \"hostname\": \"rebuilt-server\",\n \"password\": \"SuperSecretPass123\",\n \"ssh_keys\": [\n 1,\n 2\n ],\n \"firewall_group_id\": 5\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"message": "Power action start completed successfully."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Available options:
start, stop, reboot, rebuild Example:
"start"
Required if action is rebuild. The OS template ID.
Example:
"ubuntu-22.04"
Optional hostname for the rebuild.
Example:
"rebuilt-server"
Optional root password for the rebuild.
Example:
"SuperSecretPass123"
Optional array of SSH key IDs.
Example:
[1, 2]
Optional firewall group ID to assign.
Example:
5
