List serverhosts
curl --request GET \
--url https://controller.platform.simplecloud.app/v0/serverhosts \
--header 'X-Network-ID: <x-network-id>' \
--header 'X-Network-Secret: <x-network-secret>'import requests
url = "https://controller.platform.simplecloud.app/v0/serverhosts"
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Secret": "<x-network-secret>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Network-ID': '<x-network-id>', 'X-Network-Secret': '<x-network-secret>'}
};
fetch('https://controller.platform.simplecloud.app/v0/serverhosts', 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://controller.platform.simplecloud.app/v0/serverhosts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Network-ID: <x-network-id>",
"X-Network-Secret: <x-network-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://controller.platform.simplecloud.app/v0/serverhosts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Secret", "<x-network-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://controller.platform.simplecloud.app/v0/serverhosts")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Secret", "<x-network-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/serverhosts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
response = http.request(request)
puts response.read_body{
"count": 5,
"serverhosts": [
{
"auto_update_targeted_version": true,
"created_at": "2023-01-01T12:00:00Z",
"deactivated": false,
"deactivated_at": "2023-01-01T12:00:00Z",
"host_name": "ServerHost-1",
"installed_java_versions": [
8,
17,
21
],
"last_keep_alive": "2023-01-01T12:00:00Z",
"maximum_memory": 8192,
"network_id": "123e4567-e89b-12d3-a456-426614174000",
"serverhost_access_mode": "MANAGED_GATEWAY",
"serverhost_custom_url": "https://files.example.com",
"serverhost_gateway_last_connected_at": "2023-01-01T12:00:00Z",
"serverhost_gateway_slug": "9f1f7f2c9a224bb29f9e0f7e5b2a070a",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000",
"started_at": "2023-01-01T12:00:00Z",
"targeted_version": "1.2.3",
"updated_at": "2023-01-01T12:00:00Z",
"version": "1.0.0"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}serverhosts
List serverhosts
Get a list of serverhosts for a network
GET
/
v0
/
serverhosts
List serverhosts
curl --request GET \
--url https://controller.platform.simplecloud.app/v0/serverhosts \
--header 'X-Network-ID: <x-network-id>' \
--header 'X-Network-Secret: <x-network-secret>'import requests
url = "https://controller.platform.simplecloud.app/v0/serverhosts"
headers = {
"X-Network-ID": "<x-network-id>",
"X-Network-Secret": "<x-network-secret>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Network-ID': '<x-network-id>', 'X-Network-Secret': '<x-network-secret>'}
};
fetch('https://controller.platform.simplecloud.app/v0/serverhosts', 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://controller.platform.simplecloud.app/v0/serverhosts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Network-ID: <x-network-id>",
"X-Network-Secret: <x-network-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://controller.platform.simplecloud.app/v0/serverhosts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Network-ID", "<x-network-id>")
req.Header.Add("X-Network-Secret", "<x-network-secret>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://controller.platform.simplecloud.app/v0/serverhosts")
.header("X-Network-ID", "<x-network-id>")
.header("X-Network-Secret", "<x-network-secret>")
.asString();require 'uri'
require 'net/http'
url = URI("https://controller.platform.simplecloud.app/v0/serverhosts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
response = http.request(request)
puts response.read_body{
"count": 5,
"serverhosts": [
{
"auto_update_targeted_version": true,
"created_at": "2023-01-01T12:00:00Z",
"deactivated": false,
"deactivated_at": "2023-01-01T12:00:00Z",
"host_name": "ServerHost-1",
"installed_java_versions": [
8,
17,
21
],
"last_keep_alive": "2023-01-01T12:00:00Z",
"maximum_memory": 8192,
"network_id": "123e4567-e89b-12d3-a456-426614174000",
"serverhost_access_mode": "MANAGED_GATEWAY",
"serverhost_custom_url": "https://files.example.com",
"serverhost_gateway_last_connected_at": "2023-01-01T12:00:00Z",
"serverhost_gateway_slug": "9f1f7f2c9a224bb29f9e0f7e5b2a070a",
"serverhost_id": "123e4567-e89b-12d3-a456-426614174000",
"started_at": "2023-01-01T12:00:00Z",
"targeted_version": "1.2.3",
"updated_at": "2023-01-01T12:00:00Z",
"version": "1.0.0"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Was this page helpful?
⌘I