Introduction
Tenantos API
This documentation aims to provide all the information you need to work with our API. Depending on the user's permissions, some endpoints may not be accessible or only certain parameters may be available.
The following additional resources are available:
If any parameters are unclear or if you're unsure which API endpoint to use, perform the action through the Tenantos interface and check the requests in the development tools of your browser. The Tenantos web interface uses the same API, checking these requests will help you determine the correct parameters and endpoints.
Legal:
Base URL
domain.com
Authenticating requests
This API is authenticated by sending an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by opening your account settings and clicking API Keys.
Impersonate Accounts via API
By adding the impersonateUserId
HTTP header to API requests, the request will be executed over the specified user ID. Using the impersonateClientIp
header, it's possible to override the IP which is shown in the API and activity log.
Brands
Feature: https://documentation.tenantos.com/Tenantos/branding/branding/
POST api/system/brands/{brand}/logos/store
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/system/brands/dolorem/logos/store',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'lightlogo',
'contents' => fopen('/tmp/phpeUQAbx', 'r')
],
[
'name' => 'darklogo',
'contents' => fopen('/tmp/phpFuhT3u', 'r')
],
[
'name' => 'favicon',
'contents' => fopen('/tmp/php4LdXBv', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands/dolorem/logos/store"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('lightlogo', document.querySelector('input[name="lightlogo"]').files[0]);
body.append('darklogo', document.querySelector('input[name="darklogo"]').files[0]);
body.append('favicon', document.querySelector('input[name="favicon"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
curl --request POST \
"domain.com/api/system/brands/dolorem/logos/store" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "lightlogo=@/tmp/phpeUQAbx" \
--form "darklogo=@/tmp/phpFuhT3u" \
--form "favicon=@/tmp/php4LdXBv"
Received response:
Request failed with error:
DELETE api/system/brands/{brand}/logos/delete
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/system/brands/qui/logos/delete',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'lightlogo' => false,
'darklogo' => true,
'favicon' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands/qui/logos/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"lightlogo": false,
"darklogo": true,
"favicon": true
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/system/brands/qui/logos/delete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"lightlogo\": false,
\"darklogo\": true,
\"favicon\": true
}"
Received response:
Request failed with error:
GET api/system/brands
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/brands',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/brands" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"user_id": 1,
"domain": "domain.com",
"login_page_text": "Server Management",
"top_navbar_header_title": "Tenantos",
"page_title": "Control",
"color_scheme": {
"light": {
"primary": "#0C47A0",
"...": "..."
},
"dark": {
"primary": "#536DFE",
"...": "..."
}
},
"languageOverrides": [],
"languageData": [
{
"en-us": {
"common_table_nodata_reload": "No data available. Reload?",
"...": "..."
}
}
],
"navbar_text_instead_logo": 0,
"navbar_logo_always_dark": 1,
"loginpage_text_instead_logo": 0,
"loginpage_logo_always_dark": 0,
"loginpage_logo_above_form": 0,
"loginpage_show_text_within_form": 0,
"navbar_logo_max_height": 30,
"loginpage_logo_max_height": 40,
"theme_flat_buttons": 0,
"theme_cards_elevation": 3,
"theme_cards_outlined": 0,
"theme_top_bar_full_length": 0,
"theme_serverpage_notes_importantNotes_showOnTop": 0,
"availableLanguages": [
{
"languageName": "English",
"languageCode": "en-us"
}
],
"defaultColorScheme": {
"light": {
"primary": "#0C47A0",
"...": "..."
},
"dark": {
"primary": "#536DFE",
"...": "..."
}
},
"logos": {
"favicon": {
"publicPath": "/storage/brands/1/logos/favicon_673930630b2c9.png"
},
"lightlogo": {
"publicPath": "/storage/brands/1/logos/lightlogo_3e6ed656923ef.png"
},
"darklogo": {
"publicPath": "/storage/brands/1/logos/darklogo_e4c15c2d3b6e5.png"
}
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/system/brands
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/system/brands',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'domain' => 'app.domain.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"domain": "app.domain.com"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/system/brands" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"domain\": \"app.domain.com\"
}"
Received response:
Request failed with error:
GET api/system/brands/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/brands/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/brands/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 1,
"user_id": 1,
"domain": "domain.com",
"login_page_text": "Server Management",
"top_navbar_header_title": "Tenantos",
"page_title": "Control",
"color_scheme": {
"light": {
"primary": "#0C47A0",
"...": "..."
},
"dark": {
"primary": "#536DFE",
"...": "..."
}
},
"languageOverrides": [],
"languageData": [
{
"en-us": {
"common_table_nodata_reload": "No data available. Reload?",
"...": "..."
}
}
],
"navbar_text_instead_logo": 0,
"navbar_logo_always_dark": 1,
"loginpage_text_instead_logo": 0,
"loginpage_logo_always_dark": 0,
"loginpage_logo_above_form": 0,
"loginpage_show_text_within_form": 0,
"navbar_logo_max_height": 30,
"loginpage_logo_max_height": 40,
"theme_flat_buttons": 0,
"theme_cards_elevation": 3,
"theme_cards_outlined": 0,
"theme_top_bar_full_length": 0,
"theme_serverpage_notes_importantNotes_showOnTop": 0,
"availableLanguages": [
{
"languageName": "English",
"languageCode": "en-us"
}
],
"defaultColorScheme": {
"light": {
"primary": "#0C47A0",
"...": "..."
},
"dark": {
"primary": "#536DFE",
"...": "..."
}
},
"logos": {
"favicon": {
"publicPath": "/storage/brands/1/logos/favicon_673930630b2c9.png"
},
"lightlogo": {
"publicPath": "/storage/brands/1/logos/lightlogo_3e6ed656923ef.png"
},
"darklogo": {
"publicPath": "/storage/brands/1/logos/darklogo_e4c15c2d3b6e5.png"
}
}
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/system/brands/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/system/brands/11',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'login_page_text' => 'Login To App',
'page_title' => 'Tenantos',
'top_navbar_header_title' => 'Tenantos',
'color_scheme' => [
'dark' => [
'primary' => '#536DFE',
],
'light' => [
'primary' => '#0C47A0',
],
],
'user_id' => 16,
'languageOverrides' => [
'en-us' => [
'common_table_nodata_reload' => 'No data available. Reload?',
],
],
'navbar_text_instead_logo' => false,
'navbar_logo_always_dark' => true,
'loginpage_text_instead_logo' => false,
'loginpage_logo_always_dark' => false,
'loginpage_logo_above_form' => false,
'loginpage_show_text_within_form' => true,
'navbar_logo_max_height' => 12,
'loginpage_logo_max_height' => 15,
'theme_flat_buttons' => false,
'theme_cards_elevation' => 13,
'theme_cards_outlined' => false,
'theme_top_bar_full_length' => false,
'theme_serverpage_notes_importantNotes_showOnTop' => true,
'availableLanguages' => [
[
'languageName' => 'xlfwtv',
'languageCode' => 'wn',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands/11"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"login_page_text": "Login To App",
"page_title": "Tenantos",
"top_navbar_header_title": "Tenantos",
"color_scheme": {
"dark": {
"primary": "#536DFE"
},
"light": {
"primary": "#0C47A0"
}
},
"user_id": 16,
"languageOverrides": {
"en-us": {
"common_table_nodata_reload": "No data available. Reload?"
}
},
"navbar_text_instead_logo": false,
"navbar_logo_always_dark": true,
"loginpage_text_instead_logo": false,
"loginpage_logo_always_dark": false,
"loginpage_logo_above_form": false,
"loginpage_show_text_within_form": true,
"navbar_logo_max_height": 12,
"loginpage_logo_max_height": 15,
"theme_flat_buttons": false,
"theme_cards_elevation": 13,
"theme_cards_outlined": false,
"theme_top_bar_full_length": false,
"theme_serverpage_notes_importantNotes_showOnTop": true,
"availableLanguages": [
{
"languageName": "xlfwtv",
"languageCode": "wn"
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/system/brands/11" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"login_page_text\": \"Login To App\",
\"page_title\": \"Tenantos\",
\"top_navbar_header_title\": \"Tenantos\",
\"color_scheme\": {
\"dark\": {
\"primary\": \"#536DFE\"
},
\"light\": {
\"primary\": \"#0C47A0\"
}
},
\"user_id\": 16,
\"languageOverrides\": {
\"en-us\": {
\"common_table_nodata_reload\": \"No data available. Reload?\"
}
},
\"navbar_text_instead_logo\": false,
\"navbar_logo_always_dark\": true,
\"loginpage_text_instead_logo\": false,
\"loginpage_logo_always_dark\": false,
\"loginpage_logo_above_form\": false,
\"loginpage_show_text_within_form\": true,
\"navbar_logo_max_height\": 12,
\"loginpage_logo_max_height\": 15,
\"theme_flat_buttons\": false,
\"theme_cards_elevation\": 13,
\"theme_cards_outlined\": false,
\"theme_top_bar_full_length\": false,
\"theme_serverpage_notes_importantNotes_showOnTop\": true,
\"availableLanguages\": [
{
\"languageName\": \"xlfwtv\",
\"languageCode\": \"wn\"
}
]
}"
Received response:
Request failed with error:
DELETE api/system/brands/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/system/brands/16',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/brands/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/system/brands/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
External Providers
Feature: https://documentation.tenantos.com/Tenantos/external-providers/about-external-providers/
GET api/externalProviders
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/externalProviders',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/externalProviders"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/externalProviders" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"provider": "proxmox",
"name": "host-01",
"apiUrl": "proxmox01.domain.com",
"apiUser": "root",
"apiPassword": "**************",
"meta": null,
"isStandaloneRdnsProvider": [],
"usage": {
"serverIds": [
2,
3,
4,
5
]
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/externalProviders
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/externalProviders',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'provider' => 'gthost',
'name' => 'Host-01',
'apiUrl' => 'proxmox01.domain.com',
'apiUser' => 'root',
'apiPassword' => 'secret',
'meta' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/externalProviders"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"provider": "gthost",
"name": "Host-01",
"apiUrl": "proxmox01.domain.com",
"apiUser": "root",
"apiPassword": "secret",
"meta": []
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/externalProviders" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"provider\": \"gthost\",
\"name\": \"Host-01\",
\"apiUrl\": \"proxmox01.domain.com\",
\"apiUser\": \"root\",
\"apiPassword\": \"secret\",
\"meta\": []
}"
Received response:
Request failed with error:
GET api/externalProviders/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/externalProviders/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/externalProviders/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/externalProviders/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 1,
"provider": "proxmox",
"name": "Host 01",
"apiUrl": "proxmox01.domain.com",
"apiUser": "root",
"apiPassword": "**************",
"meta": null,
"providerDetails": {
"nodes": [
{
"value": "host01",
"name": "host01"
},
{
"value": "host02",
"name": "host02"
}
],
"storages": {
"host01": [
{
"shared": 0,
"used": 1719563468800,
"content": [
"snippets",
"images",
"iso",
"rootdir",
"vztmpl",
"backup"
],
"used_fraction": 0.881667875391091,
"type": "dir",
"total": 1950352867328,
"avail": 220859899904,
"enabled": 1,
"storage": "local",
"active": 1,
"backendId": "local"
}
],
"host02": [
{
"avail": 87191961600,
"active": 1,
"total": 468513751040,
"enabled": 1,
"content": [
"iso",
"snippets",
"vztmpl",
"rootdir",
"images",
"backup"
],
"storage": "local",
"used_fraction": 0.811824328459309,
"type": "dir",
"used": 380350861312,
"shared": 0,
"backendId": "local"
}
]
},
"networks": {
"host02": [
{
"bridge_stp": "off",
"bridge_ports": "enp2s0",
"options": [
"hwaddress 44:aa:5b:2c:3c:dc",
"pointopoint 192.168.100.1",
"bridge_hello 2",
"bridge_maxage 12"
],
"cidr": "10.10.11.10/24",
"address": "10.10.11.10",
"type": "bridge",
"autostart": 1,
"method6": "manual",
"iface": "vmbr0",
"bridge_fd": "1",
"families": [
"inet"
],
"priority": 4,
"method": "static",
"netmask": "32",
"gateway": "10.10.11.1",
"active": 1,
"backendId": "vmbr0"
},
{
"method6": "manual",
"autostart": 1,
"type": "bridge",
"mtu": "1400",
"bridge_fd": 0,
"iface": "vmbr2",
"bridge_ports": "enp2s0.4000",
"bridge_stp": "off",
"address": "10.10.11.2",
"cidr": "10.10.11.2/24",
"method": "static",
"active": 1,
"netmask": "24",
"priority": 6,
"families": [
"inet"
],
"backendId": "vmbr2"
}
],
"host01": [
{
"netmask": "29",
"bridge_fd": "0",
"bridge_ports": "",
"address": "10.20.10.5",
"active": 1,
"autostart": 1,
"cidr": "10.20.10.5/24",
"method6": "manual",
"bridge_stp": "off",
"iface": "vmbr0",
"families": [
"inet"
],
"type": "bridge",
"method": "static",
"priority": 12,
"backendId": "vmbr3"
}
]
},
"haGroups": [
{
"group": "ha-group-ceph-1",
"comment": "Ceph nodes"
},
{
"group": "ha-group-nfs-1",
"comment": "NFS, only for dev"
}
]
},
"nodeResources": {
"host01": {
"cpuCores": 8,
"cpuUtil": 0.0133663366336634,
"maxMem": 33523425280,
"usedMem": 25098756096,
"freeMem": 8424669184,
"memUsagePercentage": 74.8693067201992,
"uptime": 54516143,
"status": "online"
},
"host02": {
"cpuCores": 8,
"cpuUtil": 0.510303390007536,
"maxMem": 67213066240,
"usedMem": 43491606528,
"freeMem": 23721459712,
"memUsagePercentage": 64.70707105178482,
"uptime": 54137712,
"status": "online"
}
},
"availableVpsBalancerPlans": [
{
"id": 1,
"created_at": "2023-05-03T21:11:53.000000Z",
"updated_at": "2023-05-03T21:11:53.000000Z",
"planname": "Balancer #1",
"cpuPriority": 2,
"cpuRequireIdlePercentage": 30,
"storagePriority": 1,
"storageReserveFreeAmount": 20,
"ramPriority": 1.5,
"ramReserveFreeAmount": 10,
"vmCountPriority": 1,
"vmMaxAmount": 50,
"nodeMustMatchRegex": "/^node[0-9]+$/",
"nodeMustNotMatchRegex": "/^gluster[0-9]+$/"
}
],
"isStandaloneRdnsProvider": [],
"usage": {
"serverIds": [
2,
3,
4,
5
]
}
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/externalProviders/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/externalProviders/13',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Host-01',
'apiUrl' => 'proxmox01.domain.com',
'apiUser' => 'root',
'apiPassword' => 'secret',
'meta' => [],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/externalProviders/13"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Host-01",
"apiUrl": "proxmox01.domain.com",
"apiUser": "root",
"apiPassword": "secret",
"meta": []
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/externalProviders/13" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Host-01\",
\"apiUrl\": \"proxmox01.domain.com\",
\"apiUser\": \"root\",
\"apiPassword\": \"secret\",
\"meta\": []
}"
Received response:
Request failed with error:
DELETE api/externalProviders/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/externalProviders/8',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/externalProviders/8"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/externalProviders/8" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Files
To some objects files can be attached (e.g. server comments). This endpoint is used to download and delete these files.
GET api/files/{fileId}/download
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/files/est/download',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/files/est/download"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/files/est/download" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"message": "Exception",
"result": "Access to this file denied or file not found."
}
Received response:
Request failed with error:
DELETE api/files/{fileId}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/files/ex',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/files/ex"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/files/ex" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
IP Management
These API endpoints are, by default, only accessible as admin and are not intended for normal users.
POST api/ip/massaction
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/ip/massaction',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'reserve',
'ips' => [
'10.10.10.28',
'10.10.10.29',
],
'type' => 'singleIp',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ip/massaction"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "reserve",
"ips": [
"10.10.10.28",
"10.10.10.29"
],
"type": "singleIp"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/ip/massaction" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"reserve\",
\"ips\": [
\"10.10.10.28\",
\"10.10.10.29\"
],
\"type\": \"singleIp\"
}"
Received response:
Request failed with error:
POST api/ip/reserve
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/ip/reserve',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'adminIp' => '10.10.10.20',
'type' => 'singleIp',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ip/reserve"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"adminIp": "10.10.10.20",
"type": "singleIp"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/ip/reserve" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"adminIp\": \"10.10.10.20\",
\"type\": \"singleIp\"
}"
Received response:
Request failed with error:
POST api/ip/unreserve
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/ip/unreserve',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'adminIp' => '10.10.10.20',
'type' => 'singleIp',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ip/unreserve"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"adminIp": "10.10.10.20",
"type": "singleIp"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/ip/unreserve" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"adminIp\": \"10.10.10.20\",
\"type\": \"singleIp\"
}"
Received response:
Request failed with error:
POST api/ip/comment
requires authentication
If a user wants to create a comment for an IP, the PUT api/servers/{server_id}/ipassignments/{id}
endpoint can be used.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/ip/comment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'comment' => 'VPN IP',
'adminIp' => '10.10.10.20',
'type' => 'singleIp',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ip/comment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"comment": "VPN IP",
"adminIp": "10.10.10.20",
"type": "singleIp"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/ip/comment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"comment\": \"VPN IP\",
\"adminIp\": \"10.10.10.20\",
\"type\": \"singleIp\"
}"
Received response:
Request failed with error:
DELETE api/ip/delete
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/ip/delete',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'adminIp' => 'deserunt',
'type' => 'subnet',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ip/delete"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"adminIp": "deserunt",
"type": "subnet"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/ip/delete" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"adminIp\": \"deserunt\",
\"type\": \"subnet\"
}"
Received response:
Request failed with error:
Inventory
Feature: https://documentation.tenantos.com/Tenantos/inventory-manager/inventory-manager/
GET api/inventorycomponents/customfields
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/inventorycomponents/customfields',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/customfields"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/inventorycomponents/customfields" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 1,
"name": "Disk Type",
"type": "dropdown",
"availableValues": [
{
"id": "1",
"value": "HDD"
},
{
"id": "2",
"value": "SSD"
},
{
"id": "3",
"value": "NVMe"
}
],
"notdeletable": 1,
"created_at": "2021-12-25T23:14:22.000000Z",
"updated_at": "2021-12-25T23:14:22.000000Z"
},
{
"id": 2,
"name": "Cores",
"type": "input",
"availableValues": [],
"notdeletable": 1,
"created_at": "2021-12-27T00:00:00.000000Z",
"updated_at": "2021-12-27T22:41:28.000000Z"
},
{
"id": 3,
"name": "MHz Turbo",
"type": "input",
"availableValues": [],
"notdeletable": 1,
"created_at": "2021-12-27T00:00:00.000000Z",
"updated_at": "2021-12-27T22:41:30.000000Z"
},
{
"id": 4,
"name": "MHz Normal",
"type": "input",
"availableValues": [],
"notdeletable": 1,
"created_at": "2021-12-27T00:00:00.000000Z",
"updated_at": "2021-12-27T22:41:32.000000Z"
},
{
"id": 5,
"name": "Threads",
"type": "input",
"availableValues": [],
"notdeletable": 1,
"created_at": "2021-12-27T00:00:00.000000Z",
"updated_at": "2021-12-27T22:41:33.000000Z"
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/inventorycomponents/customfields
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/inventorycomponents/customfields',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Datacenter',
'type' => 'dropdown',
'availableValues' => [
'Datacenter-1',
'Datacenter-2',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/customfields"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Datacenter",
"type": "dropdown",
"availableValues": [
"Datacenter-1",
"Datacenter-2"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/inventorycomponents/customfields" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Datacenter\",
\"type\": \"dropdown\",
\"availableValues\": [
\"Datacenter-1\",
\"Datacenter-2\"
]
}"
Received response:
Request failed with error:
GET api/inventorycomponents/customfields/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/inventorycomponents/customfields/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/customfields/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/inventorycomponents/customfields/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"id": 1,
"name": "Disk Type",
"type": "dropdown",
"availableValues": [
{
"id": "1",
"value": "HDD"
},
{
"id": "2",
"value": "SSD"
},
{
"id": "3",
"value": "NVMe"
}
],
"notdeletable": 1,
"created_at": "2021-12-25T23:14:22.000000Z",
"updated_at": "2021-12-25T23:14:22.000000Z"
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/inventorycomponents/customfields/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/inventorycomponents/customfields/13',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Datacenter',
'type' => 'dropdown',
'availableValues' => [
'Datacenter-1',
'Datacenter-2',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/customfields/13"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Datacenter",
"type": "dropdown",
"availableValues": [
"Datacenter-1",
"Datacenter-2"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/inventorycomponents/customfields/13" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Datacenter\",
\"type\": \"dropdown\",
\"availableValues\": [
\"Datacenter-1\",
\"Datacenter-2\"
]
}"
Received response:
Request failed with error:
DELETE api/inventorycomponents/customfields/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/inventorycomponents/customfields/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/customfields/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/inventorycomponents/customfields/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
GET api/inventorycomponents
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/inventorycomponents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/inventorycomponents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 1,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "cpu",
"description": "CPU Model",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "MHz",
"customfieldsRelations": [
2,
3,
4,
5
],
"customfields": [
{
"field_id": 2,
"name": "Cores",
"type": "input",
"values": []
},
{
"field_id": 3,
"name": "MHz Turbo",
"type": "input",
"values": []
},
{
"field_id": 4,
"name": "MHz Normal",
"type": "input",
"values": []
},
{
"field_id": 5,
"name": "Threads",
"type": "input",
"values": []
}
]
},
{
"id": 2,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "memory",
"description": "RAM",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "mb",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 3,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "system",
"description": "System",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 4,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "bios",
"description": "BIOS",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 5,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "storage_controller",
"description": "Storage Controller",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 6,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "mainboard",
"description": "Mainboard Model",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 7,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:06:00.000000Z",
"componentname": "disk",
"description": "Disk",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "mib",
"customfieldsRelations": [
1
],
"customfields": [
{
"field_id": 1,
"name": "Disk Type",
"type": "dropdown",
"values": [
{
"id": "1",
"value": "HDD"
},
{
"id": "2",
"value": "SSD"
},
{
"id": "3",
"value": "NVMe"
}
]
}
]
},
{
"id": 8,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "nic",
"description": "NIC",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
},
{
"id": 9,
"created_at": "2024-09-04T13:06:00.000000Z",
"updated_at": "2024-09-04T13:06:00.000000Z",
"componentname": "raid_controller",
"description": "RAID Controller",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "text",
"customfieldsRelations": [],
"customfields": []
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/inventorycomponents
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/inventorycomponents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'groupname' => 'Software',
'description' => 'Software licenses',
'componentname' => 'Software name',
'customfieldsRelations' => [
1,
3,
],
'valueType' => 'text',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"groupname": "Software",
"description": "Software licenses",
"componentname": "Software name",
"customfieldsRelations": [
1,
3
],
"valueType": "text"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/inventorycomponents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"groupname\": \"Software\",
\"description\": \"Software licenses\",
\"componentname\": \"Software name\",
\"customfieldsRelations\": [
1,
3
],
\"valueType\": \"text\"
}"
Received response:
Request failed with error:
GET api/inventorycomponents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/inventorycomponents/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/inventorycomponents/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"id": 1,
"created_at": "2024-09-04T13:05:37.000000Z",
"updated_at": "2024-09-04T13:05:37.000000Z",
"componentname": "cpu",
"description": "CPU Model",
"notdeletable": 1,
"groupname": "Hardware",
"valueType": "MHz",
"customfieldsRelations": [
2,
3,
4,
5
],
"customfields": [
{
"field_id": 2,
"name": "Cores",
"type": "input",
"values": []
},
{
"field_id": 3,
"name": "MHz Turbo",
"type": "input",
"values": []
},
{
"field_id": 4,
"name": "MHz Normal",
"type": "input",
"values": []
},
{
"field_id": 5,
"name": "Threads",
"type": "input",
"values": []
}
]
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/inventorycomponents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/inventorycomponents/20',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'groupname' => 'Software',
'description' => 'Software licenses',
'componentname' => 'Software name',
'customfieldsRelations' => [
1,
3,
],
'valueType' => 'text',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/20"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"groupname": "Software",
"description": "Software licenses",
"componentname": "Software name",
"customfieldsRelations": [
1,
3
],
"valueType": "text"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/inventorycomponents/20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"groupname\": \"Software\",
\"description\": \"Software licenses\",
\"componentname\": \"Software name\",
\"customfieldsRelations\": [
1,
3
],
\"valueType\": \"text\"
}"
Received response:
Request failed with error:
DELETE api/inventorycomponents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/inventorycomponents/16',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/inventorycomponents/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/inventorycomponents/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Network Devices
Feature: https://documentation.tenantos.com/Tenantos/network-devices/network-devices/
POST api/networkDevices/{networkDevice}/actions/testConnectivity
requires authentication
Tests if the connection between the Tenantos main server and the network device does work.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/networkDevices/7/actions/testConnectivity',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'useCache' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/7/actions/testConnectivity"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"useCache": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/networkDevices/7/actions/testConnectivity" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"useCache\": true
}"
Received response:
Request failed with error:
GET api/networkDevices
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/networkDevices',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/networkDevices" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"id": 1,
"name": "EX3200",
"host": "192.168.188.223",
"deviceType": "snmp_switch",
"snmpCommunity": "Aks8gkjsa8a2",
"snmpVersion": "2c",
"agentId": 1,
"features": [
"bw_collection"
],
"meta": {
"cachePorts": true
},
"username": "",
"password": "",
"port": null,
"statusCache": [],
"snmpAuthAlgo": null,
"snmpAuthLevel": null,
"snmpCryptoAlgo": null,
"snmpCryptoPassword": "",
"enableAdvancedManagement": 1,
"managementVendor": "juniperSsh",
"managementPort": "22",
"managementUser": "root",
"managementPassword": "secret",
"rootType": "snmp_switch",
"extendedDetailsAvailable": true
}
Received response:
Request failed with error:
POST api/networkDevices
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/networkDevices',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'deviceType' => 'snmp_switch',
'name' => 'quibusdam',
'host' => 'switch01.domain.com',
'snmpCommunity' => 'sed',
'snmpVersion' => '2c',
'enableAdvancedManagement' => true,
'managementVendor' => 'ducimus',
'managementPort' => 44216,
'managementUser' => 'aliquid',
'managementPassword' => 'aut',
'agentId' => 1,
'features' => [
'bw_collection',
],
'meta' => [
'flip_in_out' => 'true',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"deviceType": "snmp_switch",
"name": "quibusdam",
"host": "switch01.domain.com",
"snmpCommunity": "sed",
"snmpVersion": "2c",
"enableAdvancedManagement": true,
"managementVendor": "ducimus",
"managementPort": 44216,
"managementUser": "aliquid",
"managementPassword": "aut",
"agentId": 1,
"features": [
"bw_collection"
],
"meta": {
"flip_in_out": "true"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/networkDevices" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"deviceType\": \"snmp_switch\",
\"name\": \"quibusdam\",
\"host\": \"switch01.domain.com\",
\"snmpCommunity\": \"sed\",
\"snmpVersion\": \"2c\",
\"enableAdvancedManagement\": true,
\"managementVendor\": \"ducimus\",
\"managementPort\": 44216,
\"managementUser\": \"aliquid\",
\"managementPassword\": \"aut\",
\"agentId\": 1,
\"features\": [
\"bw_collection\"
],
\"meta\": {
\"flip_in_out\": \"true\"
}
}"
Received response:
Request failed with error:
GET api/networkDevices/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/networkDevices/2',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/2"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/networkDevices/2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 3,
"name": "EdgeSwitch WZ",
"host": "192.168.188.215",
"deviceType": "snmp_switch",
"snmpCommunity": "secret",
"snmpVersion": "2c",
"agentId": 1,
"features": [
"bw_collection"
],
"meta": {
"cachePorts": true
},
"username": "",
"password": "",
"port": null,
"statusCache": [],
"snmpAuthAlgo": null,
"snmpAuthLevel": null,
"snmpCryptoAlgo": null,
"snmpCryptoPassword": "",
"enableAdvancedManagement": null,
"managementVendor": null,
"managementPort": null,
"managementUser": "",
"managementPassword": "",
"ports": [
{
"id": 1,
"name": "GigabitEthernet1",
"assignments": []
},
{
"id": 1007,
"name": "LAG8",
"assignments": []
}
],
"rootType": "snmp_switch",
"extendedDetailsAvailable": true
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/networkDevices/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/networkDevices/9',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'deviceType' => 'snmp_switch',
'name' => 'et',
'host' => 'switch01.domain.com',
'snmpCommunity' => 'sed',
'snmpVersion' => '2c',
'enableAdvancedManagement' => true,
'managementVendor' => 'expedita',
'managementPort' => 40968,
'managementUser' => 'non',
'managementPassword' => 'inventore',
'agentId' => 1,
'features' => [
'bw_collection',
],
'meta' => [
'flip_in_out' => 'true',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/9"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"deviceType": "snmp_switch",
"name": "et",
"host": "switch01.domain.com",
"snmpCommunity": "sed",
"snmpVersion": "2c",
"enableAdvancedManagement": true,
"managementVendor": "expedita",
"managementPort": 40968,
"managementUser": "non",
"managementPassword": "inventore",
"agentId": 1,
"features": [
"bw_collection"
],
"meta": {
"flip_in_out": "true"
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/networkDevices/9" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"deviceType\": \"snmp_switch\",
\"name\": \"et\",
\"host\": \"switch01.domain.com\",
\"snmpCommunity\": \"sed\",
\"snmpVersion\": \"2c\",
\"enableAdvancedManagement\": true,
\"managementVendor\": \"expedita\",
\"managementPort\": 40968,
\"managementUser\": \"non\",
\"managementPassword\": \"inventore\",
\"agentId\": 1,
\"features\": [
\"bw_collection\"
],
\"meta\": {
\"flip_in_out\": \"true\"
}
}"
Received response:
Request failed with error:
DELETE api/networkDevices/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/networkDevices/2',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/2"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/networkDevices/2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
POST api/networkDevices/{networkDevice}/actions/{networkDeviceAction}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/networkDevices/1/actions/getFeatures',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/1/actions/getFeatures"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
curl --request POST \
"domain.com/api/networkDevices/1/actions/getFeatures" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"clearCache": {
"requestBody": []
},
"getFeatures": {
"requestBody": []
},
"getStatistics": {
"requestBody": {
"portIds": {
"type": "array",
"required": false,
"example": [
"1",
"2",
"3"
]
},
"mode": {
"type": "string",
"required": false,
"example": "text or graph"
},
"groupBy": {
"type": "string",
"required": false,
"example": "1d"
},
"from": {
"type": "datetime",
"required": false,
"example": "2024-08-02 09:12:27"
},
"to": {
"type": "datetime",
"required": false,
"example": "2024-09-02 09:12:27"
}
}
},
"setPortEnabled": {
"requestBody": {
"portId": {
"type": "string",
"required": true,
"example": "ge-0/0/1"
}
}
},
"setPortDisabled": {
"requestBody": {
"portId": {
"type": "string",
"required": true,
"example": "ge-0/0/1"
}
}
},
"setInterfaceDescription": {
"requestBody": {
"portId": {
"type": "string",
"required": true,
"example": "ge-0/0/1"
},
"description": {
"type": "string",
"required": true,
"example": "Uplink to core switch"
}
}
},
"deleteVlanFromInterface": {
"requestBody": {
"portId": {
"type": "string",
"required": true,
"example": "ge-0/0/1"
},
"vlanId": {
"type": "integer",
"required": true,
"example": 100
}
}
},
"updateInterface": {
"requestBody": {
"portId": {
"type": "string",
"required": true,
"example": "ge-0/0/1"
},
"portAdminStatus": {
"type": "string",
"required": false,
"example": "enabled"
},
"trunkNativeVlan": {
"type": "string",
"required": false,
"example": "0"
},
"trunkVlans": {
"type": "array",
"required": false,
"example": [
10,
20,
30
]
},
"accessVlan": {
"type": "string",
"required": false,
"example": "0"
},
"description": {
"type": "string",
"required": false,
"example": "Uplink to core switch"
}
}
},
"updateVlan": {
"requestBody": {
"id": {
"type": "string|integer",
"required": true,
"example": "30"
},
"name": {
"type": "string",
"required": false,
"example": "vlan30"
},
"l3Ips": {
"type": "array",
"required": false,
"example": [
"10.10.10.1/24",
"10.10.11.1/24"
]
}
}
},
"createVlan": {
"requestBody": {
"id": {
"type": "string|integer",
"required": true,
"example": "30"
},
"name": {
"type": "string",
"required": true,
"example": "vlan30"
},
"l3Ips": {
"type": "array",
"required": false,
"example": [
"10.10.10.1/24",
"10.10.11.1/24"
]
}
}
},
"getActionLogs": {
"requestBody": []
}
},
"message": "success"
}
Received response:
Request failed with error:
GET api/networkDevices/{networkDevice}/extendedDetails
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/networkDevices/et/extendedDetails',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/networkDevices/et/extendedDetails"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/networkDevices/et/extendedDetails" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 2,
"created_at": "2024-09-01T22:11:49.000000Z",
"updated_at": "2024-09-01T22:11:49.000000Z",
"name": "USG 3G",
"host": "192.168.188.1",
"deviceType": "snmp_switch",
"snmpCommunity": "secret",
"snmpVersion": "2c",
"agentId": 1,
"features": [
"bw_collection"
],
"meta": {
"cachePorts": true
},
"username": "",
"password": "",
"port": null,
"statusCache": {
"content": {
"success": 1,
"result": "EdgeOS v4.4.57.5578372.230112.0823"
},
"time": 1725264053
},
"snmpAuthAlgo": null,
"snmpAuthLevel": null,
"snmpCryptoAlgo": null,
"snmpCryptoPassword": "",
"enableAdvancedManagement": null,
"managementVendor": null,
"managementPort": null,
"managementUser": "",
"managementPassword": "",
"ports": [
{
"id": 1,
"name": "lo",
"assignments": []
},
{
"id": 2,
"name": "eth0",
"assignments": [
{
"type": "server",
"relId": 2,
"connectionId": 25
},
{
"type": "server",
"relId": 61,
"connectionId": 26
}
]
}
],
"extendedDetails": {
"ports": [
{
"name": "lo",
"portOperStatus": "1",
"portAdminStatus": "1",
"description": "lo",
"alias": "lo",
"linkSpeed": "10",
"ifType": "24",
"id": 1,
"assignments": []
},
{
"name": "eth0",
"portOperStatus": "1",
"portAdminStatus": "1",
"description": "eth0",
"alias": "WAN",
"linkSpeed": "1000",
"ifType": "6",
"id": 2,
"assignments": [
{
"type": "server",
"relId": 2,
"connectionId": 25
},
{
"type": "server",
"relId": 61,
"connectionId": 26
}
]
}
],
"advancedManagementAvailable": 0
},
"rootType": "snmp_switch",
"extendedDetailsAvailable": true
},
"message": "success"
}
Received response:
Request failed with error:
Others
GET api/system/version
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/version',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/version"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/version" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"app_version": "1.0.31",
"app_changelog_link": "https://documentation.tenantos.com/changelog/Tenantos/",
"updateAvailable": 0,
"updateVersion": "1.0.31"
},
"message": "success"
}
Received response:
Request failed with error:
GET api/system/listTimezones
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/listTimezones',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/listTimezones"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/listTimezones" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
"Africa/Abidjan",
"Africa/Accra",
"..."
],
"message": "success"
}
Received response:
Request failed with error:
GET api/ping
requires authentication
This endpoint provides a simple and resource-efficient way to check if the API is reachable.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/ping',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/ping"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/ping" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": "pong",
"message": "success"
}
Received response:
Request failed with error:
GET api/system/listTimeDateFormats
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/listTimeDateFormats',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/listTimeDateFormats"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/listTimeDateFormats" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"format": "DD.MM.YYYY HH:mm:ss",
"example": "04.09.2024 13:06:12"
},
{
"format": "DD/MM/YYYY HH:mm:ss",
"example": "04/09/2024 13:06:12"
},
{
"format": "DD-MM-YYYY HH:mm:ss",
"example": "04-09-2024 13:06:12"
},
{
"format": "MM.DD.YYYY HH:mm:ss",
"example": "09.04.2024 13:06:12"
},
{
"format": "MM/DD/YYYY HH:mm:ss",
"example": "09/04/2024 13:06:12"
},
{
"format": "MM-DD-YYYY HH:mm:ss",
"example": "09-04-2024 13:06:12"
},
{
"format": "YYYY.MM.DD HH:mm:ss",
"example": "2024.09.04 13:06:12"
},
{
"format": "YYYY/MM/DD HH:mm:ss",
"example": "2024/09/04 13:06:12"
},
{
"format": "YYYY-MM-DD HH:mm:ss",
"example": "2024-09-04 13:06:12"
}
],
"message": "success"
}
Received response:
Request failed with error:
GET api/system/settingsAfterLogin
requires authentication
This endpoint is queried by the browser after logging in into the Tenantos web interface. The response contains various settings for the user interface, such as which checkboxes should be activated by default.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/settingsAfterLogin',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/settingsAfterLogin"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/settingsAfterLogin" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"precheck_addserver_redirect_to_server": "off",
"precheck_adduser_redirect_to_user": "off",
"precheck_deleteserver_delete_vm_on_node": "off",
"server_console_show_dialog": "on",
"ui_connection_assignments_dont_show_already_assigned_items": "off",
"precheck_networkgraph_show_summary": "off",
"networkgraphs_show_total_p95th_line": "off",
"password_hide_ipmipass": "show",
"ui_users_allow_power_actions_during_pxe_boot": "off",
"ui_admins_allow_power_actions_during_pxe_boot": "off"
},
"message": "success"
}
Received response:
Request failed with error:
GET api/system/ui/uiLanguage
requires authentication
This endpoint is queried by the browser before and after logging into the Tenantos interface. The response contains the language files and may differ depending on the brand/domain.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/ui/uiLanguage',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/ui/uiLanguage"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/ui/uiLanguage" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"en-us": {
"common_table_nodata_reload": "No data available. Reload?",
"common_table_placeholder_search": "Search...",
"...": "..."
}
},
"message": "success"
}
Received response:
Request failed with error:
GET api/system/ui/settings
requires authentication
This endpoint is queried by the browser before logging into the Tenantos interface. The response contains various settings for the user interface, such as the color scheme and various texts. The response may differ depending on the brand/domain.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/ui/settings',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/ui/settings"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/ui/settings" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"top_navbar_header_title": "Tenantos",
"page_title": "Control",
"login_page_text": "Server Management",
"theme_dark": {
"primary": "#536DFE",
"...": "..."
},
"theme_light": {
"primary": "#0C47A0",
"...": "..."
}
},
"message": "success"
}
Received response:
Request failed with error:
GET api/system/ui/version
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/system/ui/version',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/system/ui/version"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/system/ui/version" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"frontend_version": "730acc4f301b3a72329b947f2c90810f4dbde511666cfd0a97cb5cbd3a8cea8d"
},
"message": "success"
}
Received response:
Request failed with error:
PXE Basic Operations
POST api/pxe/profiles/{pxeProfileId}/duplicate
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/profiles/10/duplicate',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'consectetur',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/10/duplicate"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "consectetur"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/profiles/10/duplicate" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"consectetur\"
}"
Received response:
Request failed with error:
POST api/pxe/scripts/{pxeScriptId}/duplicate
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/scripts/1/duplicate',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'sint',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts/1/duplicate"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "sint"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/scripts/1/duplicate" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"sint\"
}"
Received response:
Request failed with error:
POST api/pxe/disklayouts/{pxeDisklayoutId}/duplicate
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/disklayouts/19/duplicate',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'soluta',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts/19/duplicate"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "soluta"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/disklayouts/19/duplicate" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"soluta\"
}"
Received response:
Request failed with error:
POST api/os/list
requires authentication
Normally the available profiles are queried via the api/servers/{server}/provisioning/getProfiles
endpoint, but there are situations where all available profiles need to be queried (e.g. for billing integrations).
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/os/list',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => 'pxe',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/os/list"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "pxe"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/os/list" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"pxe\"
}"
Received response:
Request failed with error:
PXE Disklayouts
Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/disklayouts/disklayouts/
GET api/pxe/disklayouts
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/disklayouts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/disklayouts" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 2,
"tags": [
"preseed",
"kickstart"
],
"disklayout": "",
"name": "Auto RAID",
"isDisabled": 0,
"isStockTemplate": 1,
"internal_key": "auto_raid",
"isAutoRaid": 1,
"min_disks": null,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"allow_for_vps": 1,
"allow_for_dedicated": 1
},
{
"id": 4,
"tags": [
"kickstart",
"preseed"
],
"disklayout": "",
"name": "RAID 1",
"isDisabled": 0,
"isStockTemplate": 1,
"internal_key": "auto_raid_1",
"isAutoRaid": 1,
"min_disks": 2,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"allow_for_vps": 1,
"allow_for_dedicated": 1
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/pxe/disklayouts
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/disklayouts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart',
],
'disklayout' => 'autopart --type=lvm',
'name' => 'et',
'min_disks' => 3,
'isDisabled' => false,
'offer_if_has_tag' => [
'dicta',
],
'dont_offer_if_has_tag' => [
'nostrum',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'allow_for_vps' => true,
'allow_for_dedicated' => false,
'hw_raid_handling' => 'always_offer',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart"
],
"disklayout": "autopart --type=lvm",
"name": "et",
"min_disks": 3,
"isDisabled": false,
"offer_if_has_tag": [
"dicta"
],
"dont_offer_if_has_tag": [
"nostrum"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"allow_for_vps": true,
"allow_for_dedicated": false,
"hw_raid_handling": "always_offer"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/disklayouts" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart\"
],
\"disklayout\": \"autopart --type=lvm\",
\"name\": \"et\",
\"min_disks\": 3,
\"isDisabled\": false,
\"offer_if_has_tag\": [
\"dicta\"
],
\"dont_offer_if_has_tag\": [
\"nostrum\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"allow_for_vps\": true,
\"allow_for_dedicated\": false,
\"hw_raid_handling\": \"always_offer\"
}"
Received response:
Request failed with error:
GET api/pxe/disklayouts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/disklayouts/2',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts/2"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/disklayouts/2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 2,
"tags": [
"preseed",
"kickstart"
],
"disklayout": "",
"name": "Auto RAID",
"isDisabled": 0,
"isStockTemplate": 1,
"internal_key": "auto_raid",
"isAutoRaid": 1,
"min_disks": null,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"allow_for_vps": 1,
"allow_for_dedicated": 1
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/pxe/disklayouts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/pxe/disklayouts/6',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart',
],
'disklayout' => 'autopart --type=lvm',
'name' => 'tempore',
'min_disks' => 3,
'isDisabled' => true,
'offer_if_has_tag' => [
'dolorum',
],
'dont_offer_if_has_tag' => [
'nisi',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'partition_size_boot' => 87,
'partition_size_efi' => 49,
'allow_for_vps' => false,
'allow_for_dedicated' => true,
'hw_raid_handling' => 'always_offer',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts/6"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart"
],
"disklayout": "autopart --type=lvm",
"name": "tempore",
"min_disks": 3,
"isDisabled": true,
"offer_if_has_tag": [
"dolorum"
],
"dont_offer_if_has_tag": [
"nisi"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"partition_size_boot": 87,
"partition_size_efi": 49,
"allow_for_vps": false,
"allow_for_dedicated": true,
"hw_raid_handling": "always_offer"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/pxe/disklayouts/6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart\"
],
\"disklayout\": \"autopart --type=lvm\",
\"name\": \"tempore\",
\"min_disks\": 3,
\"isDisabled\": true,
\"offer_if_has_tag\": [
\"dolorum\"
],
\"dont_offer_if_has_tag\": [
\"nisi\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"partition_size_boot\": 87,
\"partition_size_efi\": 49,
\"allow_for_vps\": false,
\"allow_for_dedicated\": true,
\"hw_raid_handling\": \"always_offer\"
}"
Received response:
Request failed with error:
DELETE api/pxe/disklayouts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/pxe/disklayouts/4',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/disklayouts/4"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/pxe/disklayouts/4" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
PXE Profiles
Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/profiles/profile/
GET api/pxe/tags
requires authentication
Returns all available PXE tags (aggregated from all PXE profiles).
POST api/pxe/tags/getPxeProfilesByTags
requires authentication
GET api/pxe/profiles/{pxeProfileId}/clearcache
requires authentication
Deletes all cached OS data from all remote agents for this profile. Tenantos caches the files necessary for the installation of the respective operating system.
Windows operating system installation files cannot be deleted because Windows is imported from an ISO and not downloaded from a remote server.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/profiles/1/clearcache',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/1/clearcache"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/profiles/1/clearcache" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": "ok",
"message": "success"
}
Received response:
Request failed with error:
GET api/pxe/profiles
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/profiles',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/profiles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 2,
"tags": [
"kickstart",
"centos"
],
"osName": "CentOS 8",
"pxeConfig": "...",
"pxeType": "kickstart",
"networkConfigMode": null,
"defaultDiskLayout": "...",
"customPostScript": "",
"customFirstBoot": "",
"packages": "...",
"language": "en_US",
"autoInstallTemplate": "...",
"timezone": "Etc/UTC",
"mirrorUrl": "...",
"cacheDirectory": "centos8",
"httpdirectory": "",
"version": null,
"isStockTemplate": 1,
"isDisabled": 0,
"allow_ssh_keys": 1,
"default_disklayout_template": 2,
"enforced_default_disklayout_template": 0,
"default_run_scripts": [
1
],
"enforced_default_run_scripts": 1,
"default_run_scripts_hide_others": 0,
"allow_set_hostname": 1,
"set_root_password": 1,
"completeAfterDownload": null,
"configure_all_ipvfour_ask_user": null,
"configure_all_ipvfour_enforce": 1,
"configure_ipvfour_even_if_outside_of_gateway": 1,
"configure_all_ipvsix_ask_user": null,
"configure_all_ipvsix_enforce": 1,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"windows_activation_key": null,
"windows_use_empty_activation_key": null,
"windows_key_location_userdata": null,
"windows_key_location_specialize": null,
"windows_skip_oobe": null,
"windows_bypass_system_requirements_check": null,
"allow_for_vps": 1,
"allow_for_dedicated": 1,
"fallback_to_default_disklayout_if_unset": 1,
"pxe_enable_comboot": null,
"licensekey": null,
"additionalDriversUrl": null,
"disklayouts": [
{
"id": 2,
"name": "Auto RAID"
}
],
"scripts": [
{
"id": 1,
"name": "System Upgrade"
}
],
"isRescue": 0
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/pxe/profiles
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/profiles',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart ',
],
'osName' => 'aut',
'pxeType' => 'kickstart',
'pxeConfig' => '#!ipxe',
'defaultDiskLayout' => 'autopart --type=lvm',
'packages' => 'kexec-tools',
'language' => 'nesciunt',
'autoInstallTemplate' => 'network --bootproto=static',
'timezone' => 'nihil',
'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
'additionalDriversUrl' => 'https://domain.com/drivers',
'cacheDirectory' => 'centos8',
'networkConfigMode' => 'default',
'httpdirectory' => 'fugit',
'version' => 'dolore',
'customFirstBoot' => 'touch /root/123',
'customPostScript' => 'touch /root/123',
'isDisabled' => true,
'allow_ssh_keys' => true,
'allow_set_hostname' => false,
'allow_for_vps' => true,
'allow_for_dedicated' => true,
'set_root_password' => true,
'updateServerHardwareInventory' => true,
'completeAfterDownload' => true,
'default_disklayout_template' => 16,
'fallback_to_default_disklayout_if_unset' => false,
'enforced_default_disklayout_template' => false,
'default_run_scripts' => [
'vitae',
],
'enforced_default_run_scripts' => false,
'default_run_scripts_hide_others' => true,
'configure_all_ipvfour_ask_user' => true,
'configure_all_ipvfour_enforce' => false,
'configure_ipvfour_even_if_outside_of_gateway' => false,
'configure_all_ipvsix_ask_user' => true,
'configure_all_ipvsix_enforce' => true,
'offer_if_has_tag' => [
'earum',
],
'dont_offer_if_has_tag' => [
'doloremque',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'windows_activation_key' => 'alias',
'windows_use_empty_activation_key' => true,
'windows_key_location_userdata' => true,
'windows_key_location_specialize' => true,
'windows_bypass_system_requirements_check' => true,
'windows_skip_oobe' => false,
'pxe_enable_comboot' => false,
'ipxe_bios_file' => 'officiis',
'ipxe_efi_file' => 'quam',
'licensekey' => 'qui',
'keep_dhcp_minutes' => 4135,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart "
],
"osName": "aut",
"pxeType": "kickstart",
"pxeConfig": "#!ipxe",
"defaultDiskLayout": "autopart --type=lvm",
"packages": "kexec-tools",
"language": "nesciunt",
"autoInstallTemplate": "network --bootproto=static",
"timezone": "nihil",
"mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
"additionalDriversUrl": "https:\/\/domain.com\/drivers",
"cacheDirectory": "centos8",
"networkConfigMode": "default",
"httpdirectory": "fugit",
"version": "dolore",
"customFirstBoot": "touch \/root\/123",
"customPostScript": "touch \/root\/123",
"isDisabled": true,
"allow_ssh_keys": true,
"allow_set_hostname": false,
"allow_for_vps": true,
"allow_for_dedicated": true,
"set_root_password": true,
"updateServerHardwareInventory": true,
"completeAfterDownload": true,
"default_disklayout_template": 16,
"fallback_to_default_disklayout_if_unset": false,
"enforced_default_disklayout_template": false,
"default_run_scripts": [
"vitae"
],
"enforced_default_run_scripts": false,
"default_run_scripts_hide_others": true,
"configure_all_ipvfour_ask_user": true,
"configure_all_ipvfour_enforce": false,
"configure_ipvfour_even_if_outside_of_gateway": false,
"configure_all_ipvsix_ask_user": true,
"configure_all_ipvsix_enforce": true,
"offer_if_has_tag": [
"earum"
],
"dont_offer_if_has_tag": [
"doloremque"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"windows_activation_key": "alias",
"windows_use_empty_activation_key": true,
"windows_key_location_userdata": true,
"windows_key_location_specialize": true,
"windows_bypass_system_requirements_check": true,
"windows_skip_oobe": false,
"pxe_enable_comboot": false,
"ipxe_bios_file": "officiis",
"ipxe_efi_file": "quam",
"licensekey": "qui",
"keep_dhcp_minutes": 4135
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/profiles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart \"
],
\"osName\": \"aut\",
\"pxeType\": \"kickstart\",
\"pxeConfig\": \"#!ipxe\",
\"defaultDiskLayout\": \"autopart --type=lvm\",
\"packages\": \"kexec-tools\",
\"language\": \"nesciunt\",
\"autoInstallTemplate\": \"network --bootproto=static\",
\"timezone\": \"nihil\",
\"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
\"additionalDriversUrl\": \"https:\\/\\/domain.com\\/drivers\",
\"cacheDirectory\": \"centos8\",
\"networkConfigMode\": \"default\",
\"httpdirectory\": \"fugit\",
\"version\": \"dolore\",
\"customFirstBoot\": \"touch \\/root\\/123\",
\"customPostScript\": \"touch \\/root\\/123\",
\"isDisabled\": true,
\"allow_ssh_keys\": true,
\"allow_set_hostname\": false,
\"allow_for_vps\": true,
\"allow_for_dedicated\": true,
\"set_root_password\": true,
\"updateServerHardwareInventory\": true,
\"completeAfterDownload\": true,
\"default_disklayout_template\": 16,
\"fallback_to_default_disklayout_if_unset\": false,
\"enforced_default_disklayout_template\": false,
\"default_run_scripts\": [
\"vitae\"
],
\"enforced_default_run_scripts\": false,
\"default_run_scripts_hide_others\": true,
\"configure_all_ipvfour_ask_user\": true,
\"configure_all_ipvfour_enforce\": false,
\"configure_ipvfour_even_if_outside_of_gateway\": false,
\"configure_all_ipvsix_ask_user\": true,
\"configure_all_ipvsix_enforce\": true,
\"offer_if_has_tag\": [
\"earum\"
],
\"dont_offer_if_has_tag\": [
\"doloremque\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"windows_activation_key\": \"alias\",
\"windows_use_empty_activation_key\": true,
\"windows_key_location_userdata\": true,
\"windows_key_location_specialize\": true,
\"windows_bypass_system_requirements_check\": true,
\"windows_skip_oobe\": false,
\"pxe_enable_comboot\": false,
\"ipxe_bios_file\": \"officiis\",
\"ipxe_efi_file\": \"quam\",
\"licensekey\": \"qui\",
\"keep_dhcp_minutes\": 4135
}"
Received response:
Request failed with error:
GET api/pxe/profiles/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/profiles/2',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/2"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/profiles/2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 2,
"tags": [
"kickstart",
"centos"
],
"osName": "CentOS 8",
"pxeConfig": "...",
"pxeType": "kickstart",
"networkConfigMode": null,
"defaultDiskLayout": "...",
"customPostScript": "",
"customFirstBoot": "",
"packages": "...",
"language": "en_US",
"autoInstallTemplate": "...",
"timezone": "Etc/UTC",
"mirrorUrl": "...",
"cacheDirectory": "centos8",
"httpdirectory": "",
"version": null,
"isStockTemplate": 1,
"isDisabled": 0,
"allow_ssh_keys": 1,
"default_disklayout_template": 2,
"enforced_default_disklayout_template": 0,
"default_run_scripts": [
1
],
"enforced_default_run_scripts": 1,
"default_run_scripts_hide_others": 0,
"allow_set_hostname": 1,
"set_root_password": 1,
"completeAfterDownload": null,
"configure_all_ipvfour_ask_user": null,
"configure_all_ipvfour_enforce": 1,
"configure_ipvfour_even_if_outside_of_gateway": null,
"configure_all_ipvsix_ask_user": null,
"configure_all_ipvsix_enforce": 1,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"windows_activation_key": null,
"windows_use_empty_activation_key": null,
"windows_key_location_userdata": null,
"windows_key_location_specialize": null,
"windows_skip_oobe": null,
"windows_bypass_system_requirements_check": null,
"allow_for_vps": 1,
"allow_for_dedicated": 1,
"fallback_to_default_disklayout_if_unset": 1,
"pxe_enable_comboot": null,
"licensekey": null,
"additionalDriversUrl": null,
"disklayouts": [
{
"id": 2,
"name": "Auto RAID"
}
],
"scripts": [
{
"id": 1,
"name": "System Upgrade"
}
],
"isRescue": 0
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/pxe/profiles/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/pxe/profiles/10',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart ',
],
'osName' => 'distinctio',
'pxeType' => 'kickstart',
'pxeConfig' => '#!ipxe',
'defaultDiskLayout' => 'autopart --type=lvm',
'packages' => 'kexec-tools',
'language' => 'dolor',
'autoInstallTemplate' => 'network --bootproto=static',
'timezone' => 'aspernatur',
'mirrorUrl' => 'http://mirror.fra10.de.leaseweb.net/centos/8-stream/BaseOS/x86_64/os',
'additionalDriversUrl' => 'https://domain.com/drivers',
'cacheDirectory' => 'centos8',
'networkConfigMode' => 'quia',
'httpdirectory' => 'quis',
'version' => 'qui',
'customFirstBoot' => 'touch /root/123',
'customPostScript' => 'touch /root/123',
'isDisabled' => true,
'allow_ssh_keys' => false,
'allow_for_vps' => false,
'allow_for_dedicated' => false,
'allow_set_hostname' => true,
'set_root_password' => false,
'updateServerHardwareInventory' => true,
'completeAfterDownload' => true,
'default_disklayout_template' => 7,
'fallback_to_default_disklayout_if_unset' => true,
'enforced_default_disklayout_template' => false,
'default_run_scripts' => [
'sed',
],
'enforced_default_run_scripts' => true,
'default_run_scripts_hide_others' => false,
'configure_all_ipvfour_ask_user' => true,
'configure_all_ipvfour_enforce' => false,
'configure_ipvfour_even_if_outside_of_gateway' => true,
'configure_all_ipvsix_ask_user' => true,
'configure_all_ipvsix_enforce' => true,
'offer_if_has_tag' => [
'adipisci',
],
'dont_offer_if_has_tag' => [
'a',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'windows_activation_key' => 'ea',
'windows_use_empty_activation_key' => false,
'windows_key_location_userdata' => true,
'windows_key_location_specialize' => true,
'windows_bypass_system_requirements_check' => true,
'windows_skip_oobe' => true,
'pxe_enable_comboot' => true,
'ipxe_bios_file' => 'a',
'ipxe_efi_file' => 'veniam',
'licensekey' => 'nemo',
'keep_dhcp_minutes' => 3440,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/10"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart "
],
"osName": "distinctio",
"pxeType": "kickstart",
"pxeConfig": "#!ipxe",
"defaultDiskLayout": "autopart --type=lvm",
"packages": "kexec-tools",
"language": "dolor",
"autoInstallTemplate": "network --bootproto=static",
"timezone": "aspernatur",
"mirrorUrl": "http:\/\/mirror.fra10.de.leaseweb.net\/centos\/8-stream\/BaseOS\/x86_64\/os",
"additionalDriversUrl": "https:\/\/domain.com\/drivers",
"cacheDirectory": "centos8",
"networkConfigMode": "quia",
"httpdirectory": "quis",
"version": "qui",
"customFirstBoot": "touch \/root\/123",
"customPostScript": "touch \/root\/123",
"isDisabled": true,
"allow_ssh_keys": false,
"allow_for_vps": false,
"allow_for_dedicated": false,
"allow_set_hostname": true,
"set_root_password": false,
"updateServerHardwareInventory": true,
"completeAfterDownload": true,
"default_disklayout_template": 7,
"fallback_to_default_disklayout_if_unset": true,
"enforced_default_disklayout_template": false,
"default_run_scripts": [
"sed"
],
"enforced_default_run_scripts": true,
"default_run_scripts_hide_others": false,
"configure_all_ipvfour_ask_user": true,
"configure_all_ipvfour_enforce": false,
"configure_ipvfour_even_if_outside_of_gateway": true,
"configure_all_ipvsix_ask_user": true,
"configure_all_ipvsix_enforce": true,
"offer_if_has_tag": [
"adipisci"
],
"dont_offer_if_has_tag": [
"a"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"windows_activation_key": "ea",
"windows_use_empty_activation_key": false,
"windows_key_location_userdata": true,
"windows_key_location_specialize": true,
"windows_bypass_system_requirements_check": true,
"windows_skip_oobe": true,
"pxe_enable_comboot": true,
"ipxe_bios_file": "a",
"ipxe_efi_file": "veniam",
"licensekey": "nemo",
"keep_dhcp_minutes": 3440
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/pxe/profiles/10" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart \"
],
\"osName\": \"distinctio\",
\"pxeType\": \"kickstart\",
\"pxeConfig\": \"#!ipxe\",
\"defaultDiskLayout\": \"autopart --type=lvm\",
\"packages\": \"kexec-tools\",
\"language\": \"dolor\",
\"autoInstallTemplate\": \"network --bootproto=static\",
\"timezone\": \"aspernatur\",
\"mirrorUrl\": \"http:\\/\\/mirror.fra10.de.leaseweb.net\\/centos\\/8-stream\\/BaseOS\\/x86_64\\/os\",
\"additionalDriversUrl\": \"https:\\/\\/domain.com\\/drivers\",
\"cacheDirectory\": \"centos8\",
\"networkConfigMode\": \"quia\",
\"httpdirectory\": \"quis\",
\"version\": \"qui\",
\"customFirstBoot\": \"touch \\/root\\/123\",
\"customPostScript\": \"touch \\/root\\/123\",
\"isDisabled\": true,
\"allow_ssh_keys\": false,
\"allow_for_vps\": false,
\"allow_for_dedicated\": false,
\"allow_set_hostname\": true,
\"set_root_password\": false,
\"updateServerHardwareInventory\": true,
\"completeAfterDownload\": true,
\"default_disklayout_template\": 7,
\"fallback_to_default_disklayout_if_unset\": true,
\"enforced_default_disklayout_template\": false,
\"default_run_scripts\": [
\"sed\"
],
\"enforced_default_run_scripts\": true,
\"default_run_scripts_hide_others\": false,
\"configure_all_ipvfour_ask_user\": true,
\"configure_all_ipvfour_enforce\": false,
\"configure_ipvfour_even_if_outside_of_gateway\": true,
\"configure_all_ipvsix_ask_user\": true,
\"configure_all_ipvsix_enforce\": true,
\"offer_if_has_tag\": [
\"adipisci\"
],
\"dont_offer_if_has_tag\": [
\"a\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"windows_activation_key\": \"ea\",
\"windows_use_empty_activation_key\": false,
\"windows_key_location_userdata\": true,
\"windows_key_location_specialize\": true,
\"windows_bypass_system_requirements_check\": true,
\"windows_skip_oobe\": true,
\"pxe_enable_comboot\": true,
\"ipxe_bios_file\": \"a\",
\"ipxe_efi_file\": \"veniam\",
\"licensekey\": \"nemo\",
\"keep_dhcp_minutes\": 3440
}"
Received response:
Request failed with error:
DELETE api/pxe/profiles/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/pxe/profiles/4',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/4"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/pxe/profiles/4" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
POST api/pxe/profiles/{pxeProfileId}/restore
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/profiles/nam/restore',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/profiles/nam/restore"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/profiles/nam/restore" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
PXE Scripts
Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/scripts/
GET api/pxe/scripts
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/scripts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/scripts" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"tags": [
"kickstart",
"preseed",
"openvz 7"
],
"script": "...",
"name": "System Upgrade",
"isDisabled": 0,
"isStockTemplate": 1,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": [],
"allow_for_vps": 1,
"allow_for_dedicated": 1
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/pxe/scripts
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/scripts',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart',
],
'script' => 'touch /root/123',
'name' => 'doloremque',
'isDisabled' => false,
'offer_if_has_tag' => [
'quia',
],
'dont_offer_if_has_tag' => [
'numquam',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'allow_for_vps' => true,
'allow_for_dedicated' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart"
],
"script": "touch \/root\/123",
"name": "doloremque",
"isDisabled": false,
"offer_if_has_tag": [
"quia"
],
"dont_offer_if_has_tag": [
"numquam"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"allow_for_vps": true,
"allow_for_dedicated": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/scripts" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart\"
],
\"script\": \"touch \\/root\\/123\",
\"name\": \"doloremque\",
\"isDisabled\": false,
\"offer_if_has_tag\": [
\"quia\"
],
\"dont_offer_if_has_tag\": [
\"numquam\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"allow_for_vps\": true,
\"allow_for_dedicated\": true
}"
Received response:
Request failed with error:
GET api/pxe/scripts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/pxe/scripts/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/pxe/scripts/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result":
{
"id": 1,
"tags": [
"kickstart",
"preseed",
"openvz 7"
],
"script": "...",
"name": "System Upgrade",
"isDisabled": 0,
"isStockTemplate": 1,
"offer_if_has_tag": [],
"dont_offer_if_has_tag": [],
"offer_if_user_has_role": [],
"dont_offer_if_user_has_role": []
"allow_for_vps": 1,
"allow_for_dedicated": 1
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/pxe/scripts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/pxe/scripts/6',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'kickstart',
],
'script' => 'touch /root/123',
'name' => 'ipsa',
'isDisabled' => true,
'offer_if_has_tag' => [
'fuga',
],
'dont_offer_if_has_tag' => [
'voluptates',
],
'offer_if_user_has_role' => [
null,
],
'dont_offer_if_user_has_role' => [
null,
],
'allow_for_vps' => false,
'allow_for_dedicated' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts/6"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"kickstart"
],
"script": "touch \/root\/123",
"name": "ipsa",
"isDisabled": true,
"offer_if_has_tag": [
"fuga"
],
"dont_offer_if_has_tag": [
"voluptates"
],
"offer_if_user_has_role": [
null
],
"dont_offer_if_user_has_role": [
null
],
"allow_for_vps": false,
"allow_for_dedicated": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/pxe/scripts/6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"kickstart\"
],
\"script\": \"touch \\/root\\/123\",
\"name\": \"ipsa\",
\"isDisabled\": true,
\"offer_if_has_tag\": [
\"fuga\"
],
\"dont_offer_if_has_tag\": [
\"voluptates\"
],
\"offer_if_user_has_role\": [
null
],
\"dont_offer_if_user_has_role\": [
null
],
\"allow_for_vps\": false,
\"allow_for_dedicated\": false
}"
Received response:
Request failed with error:
DELETE api/pxe/scripts/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/pxe/scripts/18',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/scripts/18"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/pxe/scripts/18" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
PXE Windows Profiles
Feature: https://documentation.tenantos.com/Tenantos/pxe-manager/profiles/windows/
POST api/pxe/windows/importWindows
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/windows/importWindows',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'editions' => [
'Windows Server 2022 SERVERSTANDARD',
],
'cacheDirectory' => 'win2k22',
'language' => 'en-us',
'mode' => 'cdrom',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/windows/importWindows"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"editions": [
"Windows Server 2022 SERVERSTANDARD"
],
"cacheDirectory": "win2k22",
"language": "en-us",
"mode": "cdrom"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/windows/importWindows" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"editions\": [
\"Windows Server 2022 SERVERSTANDARD\"
],
\"cacheDirectory\": \"win2k22\",
\"language\": \"en-us\",
\"mode\": \"cdrom\"
}"
Received response:
Request failed with error:
GET api/pxe/windows/getWindowsInformation
requires authentication
Lists all available Windows versions of the ISO.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/pxe/windows/getWindowsInformation',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'cdrom',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/pxe/windows/getWindowsInformation"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "cdrom"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/pxe/windows/getWindowsInformation" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"cdrom\"
}"
Example response (200):
{
"result": {
"data": [
{
"build": "Windows Server 2022 SERVERSTANDARDCORE",
"name": "Windows Server 2022 Standard Evaluation",
"languages": [
"en-us"
],
"size": "4810.42 MB"
}
]
},
"message": "success"
}
Received response:
Request failed with error:
Remote Agents
Feature: https://documentation.tenantos.com/Tenantos/remote-agents/about-remote-agents/
POST api/remoteAgents/{agentId}/actions/testConnectivity
requires authentication
Tests if the connection between the Tenantos main server and the remote agent does work.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/remoteAgents/1/actions/testConnectivity',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'useCache' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/1/actions/testConnectivity"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"useCache": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/remoteAgents/1/actions/testConnectivity" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"useCache\": true
}"
Received response:
Request failed with error:
GET api/remoteAgents/{agentId}/actions/getAssignments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/remoteAgents/1/actions/getAssignments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/1/actions/getAssignments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/remoteAgents/1/actions/getAssignments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"deviceId": 1,
"name": "USG 3G",
"rootType": "Network Device",
"assignmentType": "snmp_switch",
"features": [
"bw_collection"
]
},
{
"deviceId": 1,
"name": "server-001",
"rootType": "Server",
"assignmentType": "ipmi",
"features": [
"power_management"
]
},
{
"deviceId": 1,
"name": "server-001",
"rootType": "Server",
"assignmentType": "pxe",
"features": [
"installation"
]
}
],
"message": "success"
}
Received response:
Request failed with error:
GET api/remoteAgents/ipmiKvmIsos
requires authentication
Feature: https://documentation.tenantos.com/Tenantos/remote-agents/ipmi-kvm-isos/
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/remoteAgents/ipmiKvmIsos',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/ipmiKvmIsos"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/remoteAgents/ipmiKvmIsos" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"name": "grml64-full 2021.07",
"filename": "789_grml64-full.iso",
"type": "public_admin",
"status": "Completed",
"state": "complete",
"expectedSize": 9547854,
"filesize": 9547854
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/remoteAgents/ipmiKvmIsos
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/remoteAgents/ipmiKvmIsos',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'suscipit',
'downloadUrl' => 'https://download.grml.org/grml64-full_2021.07.iso',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/ipmiKvmIsos"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "suscipit",
"downloadUrl": "https:\/\/download.grml.org\/grml64-full_2021.07.iso"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/remoteAgents/ipmiKvmIsos" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"suscipit\",
\"downloadUrl\": \"https:\\/\\/download.grml.org\\/grml64-full_2021.07.iso\"
}"
Received response:
Request failed with error:
GET api/remoteAgents/ipmiKvmIsos/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/remoteAgents/ipmiKvmIsos/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/ipmiKvmIsos/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/remoteAgents/ipmiKvmIsos/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 1,
"name": "grml64-full 2021.07",
"filename": "789_grml64-full.iso",
"type": "public_admin",
"status": "Completed",
"state": "complete",
"expectedSize": 9547854,
"filesize": 9547854
},
"message": "success"
}
Received response:
Request failed with error:
DELETE api/remoteAgents/ipmiKvmIsos/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/remoteAgents/ipmiKvmIsos/6',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/ipmiKvmIsos/6"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/remoteAgents/ipmiKvmIsos/6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
GET api/remoteAgents
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/remoteAgents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/remoteAgents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"name": "Local Agent",
"ip": "10.99.1.5",
"hostname": "local-agent.domain.com",
"sshport": 22,
"installStatus": 1
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/remoteAgents
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/remoteAgents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'voluptas',
'hostname' => 'omnis',
'password' => 'qui',
'sshport' => 4,
'ip' => 'ut',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "voluptas",
"hostname": "omnis",
"password": "qui",
"sshport": 4,
"ip": "ut"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/remoteAgents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"voluptas\",
\"hostname\": \"omnis\",
\"password\": \"qui\",
\"sshport\": 4,
\"ip\": \"ut\"
}"
Received response:
Request failed with error:
GET api/remoteAgents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/remoteAgents/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/remoteAgents/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 1,
"name": "Local Agent",
"ip": "10.99.1.5",
"hostname": "local-agent.domain.com",
"sshport": 22,
"installStatus": 1
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/remoteAgents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/remoteAgents/14',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'voluptatem',
'hostname' => 'dolores',
'sshport' => 11,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/14"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "voluptatem",
"hostname": "dolores",
"sshport": 11
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/remoteAgents/14" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"voluptatem\",
\"hostname\": \"dolores\",
\"sshport\": 11
}"
Received response:
Request failed with error:
DELETE api/remoteAgents/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/remoteAgents/16',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/remoteAgents/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/remoteAgents/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Reverse DNS
Feature: https://documentation.tenantos.com/Tenantos/ip-manager/rdns-servers/
These API endpoints are, by default, only accessible as admin and are not intended for normal users.
DELETE api/subnets/{subnet_id}/rdnsAssignment
requires authentication
Removes the assigned RDNS server from the subnet.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/subnets/15/rdnsAssignment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/subnets/15/rdnsAssignment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/subnets/15/rdnsAssignment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
GET api/subnets/{subnet_id}/rdnsAssignment
requires authentication
Shows the current assigned RDNS server.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/subnets/1/rdnsAssignment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/subnets/1/rdnsAssignment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/subnets/1/rdnsAssignment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{}
Received response:
Request failed with error:
POST api/rdns/providers/{provider}/configure
requires authentication
The features of this endpoint depends on the RDNS provider. For example, at PowerDNS, it is possible to create a reverse DNS zone using this endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/rdns/providers/1/configure',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers/1/configure"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
curl --request POST \
"domain.com/api/rdns/providers/1/configure" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
POST api/subnets/{subnet}/rdnsAssignment
requires authentication
Assigns a RDNS server to the subnet.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/subnets/1/rdnsAssignment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serverId' => 1,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/subnets/1/rdnsAssignment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serverId": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/subnets/1/rdnsAssignment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serverId\": 1
}"
Received response:
Request failed with error:
POST api/rdns/providers/{provider}/addSubnetAssignment
requires authentication
An alternative way to assign a RDNS server to a subnet. The other way to do it is using the POST api/subnets/{subnet}/rdnsAssignment
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/rdns/providers/1/addSubnetAssignment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'subnet' => '10.10.10.0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers/1/addSubnetAssignment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"subnet": "10.10.10.0"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/rdns/providers/1/addSubnetAssignment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"subnet\": \"10.10.10.0\"
}"
Received response:
Request failed with error:
POST api/rdns/ip
requires authentication
Get the RDNS entry. Users can query the RDNS entry via the POST api/servers/{server}/ipassignments/rdns
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/rdns/ip',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'adminIp' => '117.211.94.203',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/ip"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"adminIp": "117.211.94.203"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/rdns/ip" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"adminIp\": \"117.211.94.203\"
}"
Received response:
Request failed with error:
PUT api/rdns/ip
requires authentication
Set the RDNS entry. Users can set the RDNS entry via the PUT api/servers/{server_id}/ipassignments/{id}
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/rdns/ip',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ptrRecord' => 'excepturi',
'adminIp' => '140.29.96.209',
'setPtrTemplate' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/ip"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ptrRecord": "excepturi",
"adminIp": "140.29.96.209",
"setPtrTemplate": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/rdns/ip" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ptrRecord\": \"excepturi\",
\"adminIp\": \"140.29.96.209\",
\"setPtrTemplate\": false
}"
Received response:
Request failed with error:
DELETE api/rdns/ip
requires authentication
Delete the RDNS entry. Users can delete the RDNS entry via the PUT api/servers/{server_id}/ipassignments/{id}
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/rdns/ip',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'adminIp' => '1.108.163.141',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/ip"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"adminIp": "1.108.163.141"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/rdns/ip" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"adminIp\": \"1.108.163.141\"
}"
Received response:
Request failed with error:
GET api/rdns/providers
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/rdns/providers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/rdns/providers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 1,
"providerName": "PowerDNS",
"serverName": "ns1.tenantos.com",
"status": {
"success": true
},
"detailedAssignments": [
{
"subnet": "10.10.10.0",
"id": 1
}
],
"assignments": [
"10.10.10.0"
],
"configurationFeatures": [
"createZone",
"assignSubnets"
],
"data": {
"serverName": "ns1.tenantos.com",
"mysql_host": "10.10.10.2",
"mysql_port": 9000,
"mysql_username": "root",
"mysql_password": "*******",
"mysql_database": "powerdns"
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/rdns/providers
requires authentication
The body differs depending on the RDNS provider. Please add the provider via the interface to find out the required parameters.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/rdns/providers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'type' => 'PowerDNS',
'data' => [
'serverName' => 'ns1.tenantos.com',
'mysql_host' => '10.10.10.2',
'mysql_port' => 9000,
'mysql_username' => 'root',
'mysql_password' => 'secret',
'mysql_database' => 'powerdns',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "PowerDNS",
"data": {
"serverName": "ns1.tenantos.com",
"mysql_host": "10.10.10.2",
"mysql_port": 9000,
"mysql_username": "root",
"mysql_password": "secret",
"mysql_database": "powerdns"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/rdns/providers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"type\": \"PowerDNS\",
\"data\": {
\"serverName\": \"ns1.tenantos.com\",
\"mysql_host\": \"10.10.10.2\",
\"mysql_port\": 9000,
\"mysql_username\": \"root\",
\"mysql_password\": \"secret\",
\"mysql_database\": \"powerdns\"
}
}"
Received response:
Request failed with error:
GET api/rdns/providers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/rdns/providers/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/rdns/providers/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"id": 1,
"providerName": "PowerDNS",
"serverName": "ns1.tenantos.com",
"status": {
"success": true
},
"detailedAssignments": [
{
"subnet": "10.10.10.0",
"id": 1
}
],
"assignments": [
"10.10.10.0"
],
"configurationFeatures": [
"createZone",
"assignSubnets"
],
"data": {
"serverName": "ns1.tenantos.com",
"mysql_host": "10.10.10.2",
"mysql_port": 9000,
"mysql_username": "root",
"mysql_password": "*******",
"mysql_database": "powerdns"
}
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/rdns/providers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/rdns/providers/10',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serverName' => 'illum',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers/10"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serverName": "illum"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/rdns/providers/10" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serverName\": \"illum\"
}"
Received response:
Request failed with error:
DELETE api/rdns/providers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/rdns/providers/5',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/rdns/providers/5"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/rdns/providers/5" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Roles
Feature: https://documentation.tenantos.com/Tenantos/permissions/manage-roles/
GET api/roles
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/roles',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/roles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"name": "admin ",
"id": 1,
"assignedUsers": [
{
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
}
],
"notDeleteable": 1,
"notAssignable": 0,
"serversIndexDisablePermissionChecks": 0,
"sharedAccess": 0,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "user_created",
"permissions": []
},
{
"name": "reseller ",
"id": 2,
"assignedUsers": [
{
"userId": 2,
"fullname": "Alexie Reichel",
"username": "christiansen.conner2549195"
}
],
"notDeleteable": 0,
"notAssignable": 0,
"serversIndexDisablePermissionChecks": 0,
"sharedAccess": 0,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "user_created",
"permissions": []
},
{
"name": "user ",
"id": 3,
"assignedUsers": [
{
"userId": 3,
"fullname": "Shanel Mayer",
"username": "marquis662975871"
}
],
"notDeleteable": 0,
"notAssignable": 0,
"serversIndexDisablePermissionChecks": 0,
"sharedAccess": 0,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "user_created",
"permissions": []
},
{
"name": "Default Subreseller Template Role For Resellers ",
"id": 4,
"assignedUsers": [],
"notDeleteable": 1,
"notAssignable": 1,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "reseller_template",
"permissions": []
},
{
"name": "Default User Role Template For Resellers ",
"id": 5,
"assignedUsers": [],
"notDeleteable": 1,
"notAssignable": 1,
"serversIndexDisablePermissionChecks": 0,
"sharedAccess": 0,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "user_template",
"permissions": []
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/roles
requires authentication
The available permissions can be requested via the api/permissions
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/roles',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'corrupti',
'permissionlist' => [
'servers.update.param.tags',
'servers.apiOutput.param.tags',
],
'permissionsets' => [
'Manage Server Description',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/roles"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "corrupti",
"permissionlist": [
"servers.update.param.tags",
"servers.apiOutput.param.tags"
],
"permissionsets": [
"Manage Server Description"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/roles" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"corrupti\",
\"permissionlist\": [
\"servers.update.param.tags\",
\"servers.apiOutput.param.tags\"
],
\"permissionsets\": [
\"Manage Server Description\"
]
}"
Received response:
Request failed with error:
GET api/roles/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/roles/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/roles/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/roles/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"name": "admin ",
"id": 1,
"assignedUsers": [
{
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
}
],
"notDeleteable": 1,
"notAssignable": 0,
"serversIndexDisablePermissionChecks": 0,
"sharedAccess": 0,
"ownedBy": {
"userId": 1,
"fullname": "Carlotta West",
"username": "adm"
},
"type": "user_created",
"permissions": [
{
"id": 1,
"name": "system.version"
},
{
"id": "...",
"name": "..."
}
]
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/roles
requires authentication
The available permissions can be requested via the api/permissions
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/roles/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'nostrum',
'permissionlist' => [
'servers.update.param.tags',
'servers.apiOutput.param.tags',
],
'permissionsets' => [
'Manage Server Description',
],
'sharedAccess' => true,
'serversIndexDisablePermissionChecks' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/roles/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "nostrum",
"permissionlist": [
"servers.update.param.tags",
"servers.apiOutput.param.tags"
],
"permissionsets": [
"Manage Server Description"
],
"sharedAccess": true,
"serversIndexDisablePermissionChecks": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/roles/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"nostrum\",
\"permissionlist\": [
\"servers.update.param.tags\",
\"servers.apiOutput.param.tags\"
],
\"permissionsets\": [
\"Manage Server Description\"
],
\"sharedAccess\": true,
\"serversIndexDisablePermissionChecks\": false
}"
Received response:
Request failed with error:
DELETE api/roles/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/roles/17',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/roles/17"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/roles/17" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
GET api/permissions
requires authentication
Returns a list of the available permissions and the group names.
Group names (permissionsets) can be found at the "name" key and the individual permissions (permissionlist) at the apiEndpoint
, apiUpdateFields
and apiOutput
fields.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/permissions',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/permissions"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/permissions" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"name": "View System Version",
"permissions": {
"apiEndpoint": [
"system.version"
],
"apiUpdateFields": [],
"apiOutput": [
"system.apiOutput.param.app_version",
"system.apiOutput.param.updateAvailable",
"system.apiOutput.param.updateVersion"
]
},
"permission_level": "admin"
},
{
"...": "..."
}
],
"message": "success"
}
Received response:
Request failed with error:
Search Function
POST api/search/quicksearch
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/search/quicksearch',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'text' => 'server-001',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/search/quicksearch"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"text": "server-001"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/search/quicksearch" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"text\": \"server-001\"
}"
Example response (200):
{
"result": [
{
"id": 61,
"match": "server-001",
"matchedFields": [
"Servername"
],
"desc": "hostname.com",
"path": "/servers/61",
"group": "Servers",
"uuid": "servers-635bced823ff5"
}
],
"message": "success"
}
Received response:
Request failed with error:
Server BMC User Management
Feature: https://documentation.tenantos.com/Tenantos/server-management/ipmi/ipmi-user-management/
GET api/servers/{server}/bmc/users/listUsers
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/1/bmc/users/listUsers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/listUsers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/1/bmc/users/listUsers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 2,
"name": "ADMIN",
"callin": true,
"linkAuth": true,
"ipmiMsg": true,
"privilegeName": "ADMINISTRATOR",
"privilegeId": 4
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/createUser
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/createUser',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'accusantium',
'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
'dontFailIfUserExists' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/createUser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "accusantium",
"channelAccessSettings": "ipmi=off callin=off link=off privilege=3",
"dontFailIfUserExists": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/createUser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"accusantium\",
\"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\",
\"dontFailIfUserExists\": true
}"
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/createUserWithPasswordAndPrivilege
requires authentication
This is the recommended API endpoint to create IPMI users.
This endpoints automatically handles edge cases which you would have to handle manually if you use the createUser/setUserPassword/setUserPrivilege/enableUser endpoints.
Using this endpoint, it is also possible to update an existing IPMI user: Set dontFailIfUserExists
to true and use the listUsers
endpoint if you need to know if the user already exists.
To update an IPMI user, you can also use the updateUser
endpoint.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'username' => 'id',
'password' => 'quos',
'privilege' => 3,
'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
'dontFailIfUserExists' => false,
'dontChangePasswordIfUserExists' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"username": "id",
"password": "quos",
"privilege": 3,
"channelAccessSettings": "ipmi=off callin=off link=off privilege=3",
"dontFailIfUserExists": false,
"dontChangePasswordIfUserExists": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/createUserWithPasswordAndPrivilege" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"username\": \"id\",
\"password\": \"quos\",
\"privilege\": 3,
\"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\",
\"dontFailIfUserExists\": false,
\"dontChangePasswordIfUserExists\": false
}"
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/updateUser
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/updateUser',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'autem',
'password' => 'quasi',
'privilege' => 3,
'channelAccessSettings' => 'ipmi=off callin=off link=off privilege=3',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/updateUser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "autem",
"password": "quasi",
"privilege": 3,
"channelAccessSettings": "ipmi=off callin=off link=off privilege=3"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/updateUser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"autem\",
\"password\": \"quasi\",
\"privilege\": 3,
\"channelAccessSettings\": \"ipmi=off callin=off link=off privilege=3\"
}"
Received response:
Request failed with error:
DELETE api/servers/{server}/bmc/users/deleteUser
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/1/bmc/users/deleteUser',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'quod',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/deleteUser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "quod"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/1/bmc/users/deleteUser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"quod\"
}"
Received response:
Request failed with error:
PUT api/servers/{server}/bmc/users/enableUser
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/1/bmc/users/enableUser',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'aut',
'withoutSlotCheck' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/enableUser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "aut",
"withoutSlotCheck": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/1/bmc/users/enableUser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"aut\",
\"withoutSlotCheck\": true
}"
Received response:
Request failed with error:
PUT api/servers/{server}/bmc/users/disableUser
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/1/bmc/users/disableUser',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'molestias',
'withoutSlotCheck' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/disableUser"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "molestias",
"withoutSlotCheck": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/1/bmc/users/disableUser" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"molestias\",
\"withoutSlotCheck\": true
}"
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/setUserPassword
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/setUserPassword',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'asperiores',
'password' => 'quod',
'withoutSlotCheck' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/setUserPassword"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "asperiores",
"password": "quod",
"withoutSlotCheck": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/setUserPassword" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"asperiores\",
\"password\": \"quod\",
\"withoutSlotCheck\": true
}"
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/setUserPrivilege
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/setUserPrivilege',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => 1,
'username' => 'eligendi',
'privilege' => '4',
'withoutSlotCheck' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/setUserPrivilege"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": 1,
"username": "eligendi",
"privilege": "4",
"withoutSlotCheck": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/setUserPrivilege" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": 1,
\"username\": \"eligendi\",
\"privilege\": \"4\",
\"withoutSlotCheck\": false
}"
Received response:
Request failed with error:
POST api/servers/{server}/bmc/users/channelSetAccess
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/bmc/users/channelSetAccess',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'slot' => '1',
'username' => 'qui',
'withoutSlotCheck' => false,
'accessSettings' => 'ipmi=off callin=off link=off privilege=3',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/bmc/users/channelSetAccess"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"slot": "1",
"username": "qui",
"withoutSlotCheck": false,
"accessSettings": "ipmi=off callin=off link=off privilege=3"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/bmc/users/channelSetAccess" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"slot\": \"1\",
\"username\": \"qui\",
\"withoutSlotCheck\": false,
\"accessSettings\": \"ipmi=off callin=off link=off privilege=3\"
}"
Received response:
Request failed with error:
Server Basic Operations
Feature: https://documentation.tenantos.com/Tenantos/server-management/add-server/
GET api/servers/tags
requires authentication
GET api/servers/getByIp/{ip}
requires authentication
Find a server by the IP address. At the moment, only IPv4 addresses are supported.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/getByIp/10.10.10.30',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/getByIp/10.10.10.30"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/getByIp/10.10.10.30" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": {
"id": 61,
"hostname": "hostname.com",
"servername": "server-001",
"user_id": 8,
"os": "CentOS 8",
"servertype": "auto",
"suspendedUserIds": [],
"primaryip": "10.10.10.30",
"reinstallationprovider": "pxe",
"powerprovider": {
"type": "ipmi",
"supportedFeatures": [
"getPowerStatus",
"setPowerOff",
"setPowerOn",
"setPowerReset",
"setPowerCycle",
"setBootType",
"setBmcReset",
"executeCustomCommand"
]
},
"consoleprovider": {
"type": "ipmi",
"supportedConsoleMode": "standard"
},
"owner_realname": "Damian Kris",
"tags": [
"Internal"
],
"description": "Database server",
"reinstallationRunning": 0,
"diskwipeRunning": 0,
"rescueBootRunning": 0,
"hardwarecollectRunning": 0,
"passwordResetRunning": 0,
"detailedHardwareInformation": {
"mainboard": {
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"count": 1,
"valueType": "text",
"details": [
{
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"size": "1.0"
}
]
},
"memory": {
"model": "multiple",
"value": 65536,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
},
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
}
]
},
"cpu": {
"model": "AMD Ryzen 9 3900XT",
"value": "2200",
"count": 1,
"valueType": "MHz",
"cores": "12",
"threads": "24",
"mhzTurbo": 4775
},
"disk": {
"model": "multiple",
"value": 2842540,
"count": 4,
"valueType": "mib",
"details": [
{
"model": "Samsung SSD 860 EVO 500GB",
"size": "476940"
},
{
"model": "SanDisk SDSSDHII480G",
"size": "457862"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
}
]
}
},
"ownerChain": [
{
"userId": 1,
"name": "Mr. Gardner Doyle DDS",
"username": "adm",
"type": "admin",
"assignmentDate": "2021-09-04 13:05:39"
},
{
"userId": 8,
"name": "Damian Kris",
"username": "shaylee.smitham1636043",
"type": "enduser",
"assignmentDate": "2021-09-04 13:05:39"
}
],
"typeOfServer": "dedicated",
"cachedPowerstatus": "online",
"backendDeletable": 0,
"assignmentDate": "2021-09-04 13:05:39",
"isExternalServer": 0,
"postReinstallationActionAvailable": "",
"trafficStatistics": {
"1d": "3.65",
"7d": "47.51",
"14d": "177.46",
"30d": "455.50",
"95th_in_30d": "6.70",
"95th_out_30d": "0.30",
"95th_total_30d": "7.01"
},
"lastBwrate": {
"in": "0.50",
"out": "0.15"
},
"isSuspended": 0,
"ipassignments": [
{
"updated_at": "2024-09-04T13:03:56.000000Z",
"ip": "10.10.10.30",
"primary_ip": 1,
"ipAttributes": {
"isIpv4": 1,
"isIpv6": 0,
"isSubnet": 0
},
"subnetinformation": {
"subnet": "10.10.10.0",
"netmask": "255.255.255.0",
"gw": "10.10.10.1",
"type": "v4"
}
}
]
},
"message": "success"
}
Received response:
Request failed with error:
GET api/servers
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 61,
"hostname": "hostname.com",
"servername": "server-001",
"user_id": 8,
"os": "CentOS 8",
"servertype": "auto",
"suspendedUserIds": [],
"primaryip": "10.10.10.30",
"reinstallationprovider": "pxe",
"powerprovider": {
"type": "ipmi",
"supportedFeatures": [
"getPowerStatus",
"setPowerOff",
"setPowerOn",
"setPowerReset",
"setPowerCycle",
"setBootType",
"setBmcReset",
"executeCustomCommand"
]
},
"consoleprovider": {
"type": "ipmi"
},
"owner_realname": "Dr. Sabryna Tromp V",
"tags": [
"Internal"
],
"description": "Database server",
"reinstallationRunning": 0,
"diskwipeRunning": 0,
"rescueBootRunning": 0,
"hardwarecollectRunning": 0,
"passwordResetRunning": 0,
"detailedHardwareInformation": {
"mainboard": {
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"count": 1,
"valueType": "text",
"details": [
{
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"size": "1.0"
}
]
},
"memory": {
"model": "CMW32GX4M2C3200C16",
"value": 65536,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
},
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
}
]
},
"cpu": {
"model": "AMD Ryzen 9 3900XT",
"value": "2200",
"count": 1,
"valueType": "MHz",
"cores": "12"
},
"disk": {
"model": "multiple",
"value": 2842540,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "Samsung SSD 860 EVO 500GB",
"size": "476940"
},
{
"model": "SanDisk SDSSDHII480G",
"size": "457862"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
}
]
}
},
"ownerChain": [
{
"userId": 1,
"name": "Dr. Eva Flatley",
"username": "adm",
"type": "admin",
"assignmentDate": "2021-10-20 21:38:59"
},
{
"userId": 8,
"name": "Dr. Sabryna Tromp V",
"username": "nigel742503837",
"type": "enduser",
"assignmentDate": "2021-10-20 21:38:59"
}
],
"typeOfServer": "dedicated",
"cachedPowerstatus": "online",
"backendDeletable": 0,
"assignmentDate": "2021-10-20 21:38:59",
"isExternalServer": 0,
"postReinstallationActionAvailable": "",
"trafficStatistics": {
"1d": "8.24",
"7d": "790.71",
"14d": "941.83",
"30d": "1783.39",
"95th_in_30d": "5.49",
"95th_out_30d": "0.19",
"95th_total_30d": "5.63"
},
"lastBwrate": {
"in": "0.10",
"out": "3.10"
},
"ipassignments": [
{
"updated_at": "2022-10-20T21:38:15.000000Z",
"ip": "10.10.10.30",
"primary_ip": 1,
"ipAttributes": {
"isIpv4": 1,
"isIpv6": 0,
"isSubnet": 0
},
"subnetinformation": {
"subnet": "10.10.10.0",
"netmask": "255.255.255.0",
"gw": "10.10.10.1",
"type": "v4"
}
}
]
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'hostname' => 'hostname.com',
'servername' => 'server-001',
'description' => 'et',
'tags' => [
'dolore',
],
'os' => 'optio',
'servertype' => 'vm',
'config' => [
'agentId' => 1,
'ipmi_ip' => '10.10.10.99',
'ipmi_user' => 'ADMIN',
'ipmi_password' => 'ADMIN',
'pxe_mac' => 'aa:bb:cc:dd:ee:ff',
'enable_pxe' => true,
'enable_ipmi_console' => true,
'enable_ipmi_powermanagement' => true,
'enable_permanent_dhcp' => true,
],
'ipassignments' => [
[
'ip' => '10.10.10.55',
'subnets_id' => 13,
'primary_ip' => true,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"hostname": "hostname.com",
"servername": "server-001",
"description": "et",
"tags": [
"dolore"
],
"os": "optio",
"servertype": "vm",
"config": {
"agentId": 1,
"ipmi_ip": "10.10.10.99",
"ipmi_user": "ADMIN",
"ipmi_password": "ADMIN",
"pxe_mac": "aa:bb:cc:dd:ee:ff",
"enable_pxe": true,
"enable_ipmi_console": true,
"enable_ipmi_powermanagement": true,
"enable_permanent_dhcp": true
},
"ipassignments": [
{
"ip": "10.10.10.55",
"subnets_id": 13,
"primary_ip": true
}
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"hostname\": \"hostname.com\",
\"servername\": \"server-001\",
\"description\": \"et\",
\"tags\": [
\"dolore\"
],
\"os\": \"optio\",
\"servertype\": \"vm\",
\"config\": {
\"agentId\": 1,
\"ipmi_ip\": \"10.10.10.99\",
\"ipmi_user\": \"ADMIN\",
\"ipmi_password\": \"ADMIN\",
\"pxe_mac\": \"aa:bb:cc:dd:ee:ff\",
\"enable_pxe\": true,
\"enable_ipmi_console\": true,
\"enable_ipmi_powermanagement\": true,
\"enable_permanent_dhcp\": true
},
\"ipassignments\": [
{
\"ip\": \"10.10.10.55\",
\"subnets_id\": 13,
\"primary_ip\": true
}
]
}"
Received response:
Request failed with error:
GET api/servers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 61,
"hostname": "hostname.com",
"servername": "server-001",
"user_id": 8,
"os": "CentOS 8",
"servertype": "auto",
"suspendedUserIds": [],
"primaryip": "10.10.10.30",
"reinstallationprovider": "pxe",
"powerprovider": {
"type": "ipmi",
"supportedFeatures": [
"getPowerStatus",
"setPowerOff",
"setPowerOn",
"setPowerReset",
"setPowerCycle",
"setBootType",
"setBmcReset",
"executeCustomCommand"
]
},
"consoleprovider": {
"type": "ipmi"
},
"owner_realname": "Dejah Leannon",
"tags": [
"Internal"
],
"description": "Database server",
"reinstallationRunning": 0,
"diskwipeRunning": 0,
"rescueBootRunning": 0,
"hardwarecollectRunning": 0,
"passwordResetRunning": 0,
"detailedHardwareInformation": {
"mainboard": {
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"count": 1,
"valueType": "text",
"details": [
{
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"size": "1.0"
}
]
},
"memory": {
"model": "CMW32GX4M2C3200C16",
"value": 65536,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
},
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
}
]
},
"cpu": {
"model": "AMD Ryzen 9 3900XT",
"value": "2200",
"count": 1,
"valueType": "MHz",
"cores": "12"
},
"disk": {
"model": "multiple",
"value": 2842540,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "Samsung SSD 860 EVO 500GB",
"size": "476940"
},
{
"model": "SanDisk SDSSDHII480G",
"size": "457862"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
}
]
}
},
"ownerChain": [
{
"userId": 1,
"name": "Viva Botsford",
"username": "adm",
"type": "admin",
"assignmentDate": "2021-10-21 19:29:10"
},
{
"userId": 8,
"name": "Dejah Leannon",
"username": "esmeralda44314938",
"type": "enduser",
"assignmentDate": "2021-10-21 19:29:10"
}
],
"typeOfServer": "dedicated",
"cachedPowerstatus": "online",
"backendDeletable": 0,
"assignmentDate": "2021-10-21 19:29:10",
"isExternalServer": 0,
"postReinstallationActionAvailable": "",
"trafficStatistics": {
"1d": "8.24",
"7d": "790.71",
"14d": "941.83",
"30d": "1783.39",
"95th_in_30d": "5.49",
"95th_out_30d": "0.19",
"95th_total_30d": "5.63"
},
"lastBwrate": {
"in": "0.10",
"out": "3.10"
},
"ipassignments": [
{
"updated_at": "2022-10-21T19:28:25.000000Z",
"ip": "10.10.10.30",
"primary_ip": 1,
"ipAttributes": {
"isIpv4": 1,
"isIpv6": 0,
"isSubnet": 0
},
"subnetinformation": {
"subnet": "10.10.10.0",
"netmask": "255.255.255.0",
"gw": "10.10.10.1",
"type": "v4"
}
}
]
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/servers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/3',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'hostname' => 'hostname.com',
'servername' => 'server-001',
'user_id' => 14,
'description' => 'eos',
'tags' => [
'quas',
],
'os' => 'et',
'servertype' => 'vm',
'suspendUserIds' => [
19,
],
'assignmentDates' => [
[
'userId' => 9,
'datetime' => '2022-03-31',
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/3"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"hostname": "hostname.com",
"servername": "server-001",
"user_id": 14,
"description": "eos",
"tags": [
"quas"
],
"os": "et",
"servertype": "vm",
"suspendUserIds": [
19
],
"assignmentDates": [
{
"userId": 9,
"datetime": "2022-03-31"
}
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/3" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"hostname\": \"hostname.com\",
\"servername\": \"server-001\",
\"user_id\": 14,
\"description\": \"eos\",
\"tags\": [
\"quas\"
],
\"os\": \"et\",
\"servertype\": \"vm\",
\"suspendUserIds\": [
19
],
\"assignmentDates\": [
{
\"userId\": 9,
\"datetime\": \"2022-03-31\"
}
]
}"
Received response:
Request failed with error:
DELETE api/servers/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/20',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'destroy' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/20"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"destroy": false
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"destroy\": false
}"
Received response:
Request failed with error:
GET api/servers/{server}/console/start
requires authentication
Generates a NoVNC session and returns a link to open the console.
For security reasons, the console can only be opened by the specificated IP. If no IP has been specificated, the console is bound to the requestor IP.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/1/console/start',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'authorizedIp' => '10.0.0.10',
'consoleMode' => 'web',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/console/start"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"authorizedIp": "10.0.0.10",
"consoleMode": "web"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/1/console/start" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"authorizedIp\": \"10.0.0.10\",
\"consoleMode\": \"web\"
}"
Example response (200):
{
"result": {
"token": "fa5ed6be6666631b7e53e0968d47b03dd92cb8ae",
"accessUrl": "https://domain.com/console/fa5ed6be6666631b7e53e0968d47b03dd92cb8ae"
},
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/getByTags
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/getByTags',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'tags' => [
'Clients',
'Damaged',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/getByTags"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"tags": [
"Clients",
"Damaged"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/getByTags" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"tags\": [
\"Clients\",
\"Damaged\"
]
}"
Received response:
Request failed with error:
POST api/servers/{server}/network/regenerateVlanConfiguration
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/ullam/network/regenerateVlanConfiguration',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'performVlanActions' => 'preview',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/ullam/network/regenerateVlanConfiguration"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"performVlanActions": "preview"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/ullam/network/regenerateVlanConfiguration" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"performVlanActions\": \"preview\"
}"
Received response:
Request failed with error:
Server Comments
Feature: https://documentation.tenantos.com/Tenantos/about-notes/about-notes-descriptions-tags/
GET api/servers/{server_id}/comments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/comments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/comments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/comments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 1,
"created_at": "2023-11-17T21:29:07.000000Z",
"updated_at": "2024-08-10T21:29:07.000000Z",
"comment": "<p>Server is broken</p>",
"sticky": 1,
"user_id": 1,
"clientname": "Viva Botsford"
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/comments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/2/comments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'comment',
'contents' => 'repudiandae'
],
[
'name' => 'sticky',
'contents' => '1'
],
[
'name' => 'user_id',
'contents' => '16'
],
[
'name' => 'attachments[]',
'contents' => fopen('/tmp/phpE2Ewgx', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/2/comments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('comment', 'repudiandae');
body.append('sticky', '1');
body.append('user_id', '16');
body.append('attachments[]', document.querySelector('input[name="attachments[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/2/comments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "comment=repudiandae" \
--form "sticky=1" \
--form "user_id=16" \
--form "attachments[]=@/tmp/phpE2Ewgx"
Received response:
Request failed with error:
GET api/servers/{server_id}/comments/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/comments/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/comments/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/comments/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 1,
"created_at": "2023-11-17T21:29:07.000000Z",
"updated_at": "2024-08-10T21:29:07.000000Z",
"comment": "<p>Server is broken</p>",
"sticky": 1,
"user_id": 1
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/servers/{server_id}/comments/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/1/comments/16',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'comment' => 'ab',
'sticky' => false,
'user_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/comments/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"comment": "ab",
"sticky": false,
"user_id": 2
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/1/comments/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"comment\": \"ab\",
\"sticky\": false,
\"user_id\": 2
}"
Received response:
Request failed with error:
DELETE api/servers/{server_id}/comments/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/8/comments/12',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/8/comments/12"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/8/comments/12" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Server Connections
Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/connections/
GET api/servers/{server}/connections/{testConnectionId}/test
requires authentication
Verifies if the connection details are working. Connection testing does not work with every connection. IPMI connection tests are supported.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/connections/21/test',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/connections/21/test"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/connections/21/test" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": "online",
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server_id}/connections
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/connections',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/connections"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/connections" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 21,
"agentId": 1,
"serverId": 61,
"types": [
"power_management",
"remote_console"
],
"agentAssignmentsRelationId": 21,
"agent_details": {
"id": 1,
"name": "Local Agent",
"hostname": "local-agent.domain.com"
},
"related_data": {
"id": 21,
"type": "ipmi",
"meta": {
"username": "ADMIN",
"password": "ADMIN",
"ip": "10.10.10.101",
"javaVersion": "auto",
"bmcPort": "623"
}
}
},
{
"id": 22,
"agentId": 1,
"serverId": 61,
"types": [
"installation"
],
"agentAssignmentsRelationId": 22,
"agent_details": {
"id": 1,
"name": "Local Agent",
"hostname": "local-agent.domain.com"
},
"related_data": {
"id": 22,
"type": "pxe",
"meta": []
}
},
{
"id": 23,
"agentId": 1,
"serverId": 61,
"types": [
"dhcp"
],
"agentAssignmentsRelationId": 23,
"agent_details": {
"id": 1,
"name": "Local Agent",
"hostname": "local-agent.domain.com"
},
"related_data": {
"id": 23,
"type": "dhcp",
"meta": {
"pxe_mac": "00:50:56:86:E1:A3"
}
}
},
{
"id": 26,
"agentId": 0,
"serverId": 61,
"types": [],
"agentAssignmentsRelationId": 26,
"agent_details": null,
"related_data": {
"id": 26,
"type": "snmp_switch",
"meta": {
"switchId": 2,
"portId": 2
}
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/connections
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/12/connections',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'agentId' => 17,
'types' => [
'power_management',
'remote_console',
],
'connectionDetails' => [
'meta' => [
'ip' => '192.168.171.200',
'username' => 'admin',
'password' => 'admin',
'javaVersion' => 'auto',
],
'type' => 'ipmi',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/12/connections"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"agentId": 17,
"types": [
"power_management",
"remote_console"
],
"connectionDetails": {
"meta": {
"ip": "192.168.171.200",
"username": "admin",
"password": "admin",
"javaVersion": "auto"
},
"type": "ipmi"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/12/connections" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"agentId\": 17,
\"types\": [
\"power_management\",
\"remote_console\"
],
\"connectionDetails\": {
\"meta\": {
\"ip\": \"192.168.171.200\",
\"username\": \"admin\",
\"password\": \"admin\",
\"javaVersion\": \"auto\"
},
\"type\": \"ipmi\"
}
}"
Received response:
Request failed with error:
GET api/servers/{server_id}/connections/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/connections/23',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/connections/23"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/connections/23" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 23,
"agentId": 1,
"serverId": 61,
"types": [
"dhcp"
],
"agentAssignmentsRelationId": 23,
"agent_details": {
"id": 1,
"name": "Local Agent",
"hostname": "local-agent.domain.com"
},
"related_data": {
"id": 23,
"type": "dhcp",
"meta": {
"pxe_mac": "00:50:56:86:E1:A3"
}
}
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/servers/{server_id}/connections/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/4/connections/16',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'agentId' => 3,
'types' => [
'power_management',
'remote_console',
],
'connectionDetails' => [
'meta' => [
'ip' => '192.168.171.200',
'username' => 'admin',
'password' => 'admin',
'javaVersion' => 'auto',
],
'type' => 'ipmi',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/4/connections/16"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"agentId": 3,
"types": [
"power_management",
"remote_console"
],
"connectionDetails": {
"meta": {
"ip": "192.168.171.200",
"username": "admin",
"password": "admin",
"javaVersion": "auto"
},
"type": "ipmi"
}
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/4/connections/16" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"agentId\": 3,
\"types\": [
\"power_management\",
\"remote_console\"
],
\"connectionDetails\": {
\"meta\": {
\"ip\": \"192.168.171.200\",
\"username\": \"admin\",
\"password\": \"admin\",
\"javaVersion\": \"auto\"
},
\"type\": \"ipmi\"
}
}"
Received response:
Request failed with error:
DELETE api/servers/{server_id}/connections/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/5/connections/6',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/5/connections/6"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/5/connections/6" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
POST api/servers/{server}/connections/{testConnectionId}/{serverConnectionAction}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/1/connections/24/getSupportedActions',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/connections/24/getSupportedActions"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/1/connections/24/getSupportedActions" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"powerActions": [
"getPowerStatus",
"setPowerOff",
"setPowerOn",
"setPowerReset"
]
},
"message": "success"
}
Received response:
Request failed with error:
Server IP Assignments
Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/server-page/#ip-management
POST api/servers/{server}/ipassignments/rdns
requires authentication
Get the RDNS entry of an IP address.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/61/ipassignments/rdns',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ip' => '10.10.10.30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/ipassignments/rdns"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ip": "10.10.10.30"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/61/ipassignments/rdns" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ip\": \"10.10.10.30\"
}"
Example response (200):
{
"result": {
"ptrRecord": "server-001.com"
},
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server}/ipassignments/getAssignableSubnets
requires authentication
Receives a list of subnets from which IPs can be assigned to the server. Subnets are not always available to all servers.
Alias: GET api/virtualization/ipassignments/getAssignableSubnets
- used to set the subnets in VPS plans.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/1/ipassignments/getAssignableSubnets',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/ipassignments/getAssignableSubnets"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/1/ipassignments/getAssignableSubnets" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 1,
"subnet": "10.10.10.0/24",
"type": {
"hasChildSubnets": 0,
"amountOfDirectChilds": 0,
"hasSubIps": 1,
"amountOfSubIps": 263,
"type": "v4"
},
"usageStatistics": {
"free": 68,
"reserved": 25,
"used": 170,
"totalUsed": 195,
"totalIps": 263,
"usedPercentage": 74.14
},
"vlanAutomationAvailable": false
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/ipassignments/getAssignableIpsOfSubnet
requires authentication
Receives a list of available IPs of the subnet.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/16/ipassignments/getAssignableIpsOfSubnet',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'subnets_id' => 6,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/16/ipassignments/getAssignableIpsOfSubnet"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"subnets_id": 6
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/16/ipassignments/getAssignableIpsOfSubnet" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"subnets_id\": 6
}"
Received response:
Request failed with error:
GET api/servers/{server}/ipassignments/getAssignableSubnets
requires authentication
Receives a list of subnets from which IPs can be assigned to the server. Subnets are not always available to all servers.
Alias: GET api/virtualization/ipassignments/getAssignableSubnets
- used to set the subnets in VPS plans.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/virtualization/ipassignments/getAssignableSubnets',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/virtualization/ipassignments/getAssignableSubnets"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/virtualization/ipassignments/getAssignableSubnets" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
referrer-policy: no-referrer
x-xss-protection: 1; mode=block
x-frame-options: DENY
x-content-type-options: nosniff
vary: Origin
{
"result": [
{
"id": 1,
"subnet": "10.10.10.0/24",
"type": {
"hasChildSubnets": 0,
"amountOfDirectChilds": 0,
"hasSubIps": 1,
"amountOfSubIps": 263,
"type": "v4"
},
"usageStatistics": {
"free": 68,
"reserved": 25,
"used": 170,
"totalUsed": 195,
"totalIps": 263,
"usedPercentage": 74.14
},
"vlanAutomationAvailable": false
}
],
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server_id}/ipassignments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/ipassignments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/ipassignments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/ipassignments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 32,
"updated_at": "2022-10-21T19:28:25.000000Z",
"ip": "10.10.10.30",
"primary_ip": 1,
"description": null,
"ipAttributes": {
"isIpv4": 1,
"isIpv6": 0,
"isSubnet": 0
},
"subnetinformation": {
"subnet": "10.10.10.0",
"netmask": "255.255.255.0",
"gw": "10.10.10.1",
"type": "v4",
"rdnsAvailable": 1
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/ipassignments
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/5/ipassignments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'subnets_id' => 6,
'ips' => [
'10.10.10.20',
'10.10.10.21',
],
'description' => 'voluptas',
'performVlanActions' => 'none',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/5/ipassignments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"subnets_id": 6,
"ips": [
"10.10.10.20",
"10.10.10.21"
],
"description": "voluptas",
"performVlanActions": "none"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/5/ipassignments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"subnets_id\": 6,
\"ips\": [
\"10.10.10.20\",
\"10.10.10.21\"
],
\"description\": \"voluptas\",
\"performVlanActions\": \"none\"
}"
Received response:
Request failed with error:
PUT api/servers/{server_id}/ipassignments/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/61/ipassignments/0',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'description' => 'error',
'primary_ip' => false,
'ptrRecord' => 'repellendus',
'setPtrTemplate' => false,
'ip' => '10.10.10.30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/ipassignments/0"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"description": "error",
"primary_ip": false,
"ptrRecord": "repellendus",
"setPtrTemplate": false,
"ip": "10.10.10.30"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/61/ipassignments/0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"description\": \"error\",
\"primary_ip\": false,
\"ptrRecord\": \"repellendus\",
\"setPtrTemplate\": false,
\"ip\": \"10.10.10.30\"
}"
Received response:
Request failed with error:
DELETE api/servers/{server_id}/ipassignments/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/8/ipassignments/0',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'ip' => '10.10.10.4',
'performVlanActions' => 'perform',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/8/ipassignments/0"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"ip": "10.10.10.4",
"performVlanActions": "perform"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/8/ipassignments/0" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"ip\": \"10.10.10.4\",
\"performVlanActions\": \"perform\"
}"
Received response:
Request failed with error:
Server Inventory
Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/inventory/
GET api/servers/{server_id}/hwsummary
requires authentication
Summarized overview of the hardware inventory.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/hwsummary',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/hwsummary"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/hwsummary" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"mainboard": {
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"count": 1,
"valueType": "text",
"details": null
},
"memory": {
"model": "CMW32GX4M2C3200C16",
"value": 65536,
"count": 4,
"valueType": "mb",
"details": null
},
"cpu": {
"model": "AMD Ryzen 9 3900XT",
"value": "2200",
"count": 1,
"valueType": "MHz",
"cores": "12"
},
"disk": {
"model": "multiple",
"value": 2842540,
"count": 4,
"valueType": "mb",
"details": null
}
},
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server}/hwsummary/withDetails
requires authentication
More detailled summary of the hardware inventory.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/hwsummary/withDetails',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/hwsummary/withDetails"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/hwsummary/withDetails" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"mainboard": {
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"count": 1,
"valueType": "text",
"details": [
{
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"size": "1.0"
}
]
},
"memory": {
"model": "CMW32GX4M2C3200C16",
"value": 65536,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
},
{
"model": "CMH32GX4M2Z3200C16",
"size": "16384"
},
{
"model": "CMW32GX4M2C3200C16",
"size": "16384"
}
]
},
"cpu": {
"model": "AMD Ryzen 9 3900XT",
"value": "2200",
"count": 1,
"valueType": "MHz",
"cores": "12"
},
"disk": {
"model": "multiple",
"value": 2842540,
"count": 4,
"valueType": "mb",
"details": [
{
"model": "Samsung SSD 860 EVO 500GB",
"size": "476940"
},
{
"model": "SanDisk SDSSDHII480G",
"size": "457862"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
},
{
"model": "WDS100T3X0C-00SJG0",
"size": "953869"
}
]
}
},
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server}/inventory/getInventoryCommand
requires authentication
Returns a shell command which can be executed on linux servers to collect information about the server hardware without rebooting.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/1/inventory/getInventoryCommand',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/1/inventory/getInventoryCommand"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/1/inventory/getInventoryCommand" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": "wget -qO - https://domain.com/api/scripts/hwdetect | bash -s 'https://domain.com/api/servers/inventory/callback/40b219a00840e8a242c4bd12ec1a3f43'",
"message": "success"
}
Received response:
Request failed with error:
GET api/servers/{server_id}/inventory
requires authentication
Complete list of the server hardware inventory.
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/inventory',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/inventory"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/inventory" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": [
{
"id": 12,
"created_at": "2022-10-20T21:23:50.000000Z",
"updated_at": "2022-10-20T21:23:50.000000Z",
"model": "MAG X570 TOMAHAWK WIFI (MS-7C84)",
"value": "1.0",
"serial": "K317253975",
"description": "",
"server_id": 61,
"customfields": null,
"root_component": {
"id": 6,
"description": "Mainboard Model",
"valueType": "text"
}
},
{
"id": 13,
"created_at": "2022-10-20T21:23:50.000000Z",
"updated_at": "2022-10-20T21:23:50.000000Z",
"model": "American Megatrends Inc.",
"value": "1.00",
"serial": "04/11/2020",
"description": "",
"server_id": 61,
"customfields": null,
"root_component": {
"id": 4,
"description": "BIOS",
"valueType": "text"
}
}
],
"message": "success"
}
Received response:
Request failed with error:
POST api/servers/{server}/inventory
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/12/inventory',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'model' => 'Samsung SSD 860 EVO',
'value' => '476940',
'serial' => 'S1Z2NB1K736669A',
'inventorycomponent_id' => 7,
'description' => 'Second SSD',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/12/inventory"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"model": "Samsung SSD 860 EVO",
"value": "476940",
"serial": "S1Z2NB1K736669A",
"inventorycomponent_id": 7,
"description": "Second SSD"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"domain.com/api/servers/12/inventory" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"model\": \"Samsung SSD 860 EVO\",
\"value\": \"476940\",
\"serial\": \"S1Z2NB1K736669A\",
\"inventorycomponent_id\": 7,
\"description\": \"Second SSD\"
}"
Received response:
Request failed with error:
GET api/servers/{server_id}/inventory/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
'domain.com/api/servers/61/inventory/32',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/61/inventory/32"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "domain.com/api/servers/61/inventory/32" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Example response (200):
{
"result": {
"id": 32,
"created_at": "2022-10-20T21:23:50.000000Z",
"updated_at": "2022-10-20T21:23:50.000000Z",
"model": "WDS100T3X0C-00SJG0",
"value": "953869",
"serial": "192306800431",
"description": "",
"server_id": 61,
"customfields": [
{
"fieldId": 1,
"value": "3"
}
],
"root_component": {
"id": 7,
"description": "Disk",
"valueType": "mb",
"customfields": [
{
"values": []
}
]
}
},
"message": "success"
}
Received response:
Request failed with error:
PUT api/servers/{server_id}/inventory/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->put(
'domain.com/api/servers/13/inventory/consequatur',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'model' => 'Samsung SSD 860 EVO',
'value' => '476940',
'serial' => 'S1Z2NB1K736669A',
'inventorycomponent_id' => 7,
'description' => 'Second SSD',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/13/inventory/consequatur"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"model": "Samsung SSD 860 EVO",
"value": "476940",
"serial": "S1Z2NB1K736669A",
"inventorycomponent_id": 7,
"description": "Second SSD"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"domain.com/api/servers/13/inventory/consequatur" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"model\": \"Samsung SSD 860 EVO\",
\"value\": \"476940\",
\"serial\": \"S1Z2NB1K736669A\",
\"inventorycomponent_id\": 7,
\"description\": \"Second SSD\"
}"
Received response:
Request failed with error:
DELETE api/servers/{server_id}/inventory/{id}
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'domain.com/api/servers/12/inventory/15',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"domain.com/api/servers/12/inventory/15"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"domain.com/api/servers/12/inventory/15" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Received response:
Request failed with error:
Server OS Provisioning
Feature: https://documentation.tenantos.com/Tenantos/server-management/server-page/reinstallation-rescue/
POST api/servers/{server}/provisioning/startReinstallation
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
'domain.com/api/servers/17/provisioning/startReinstallation',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'profileId' => 1,
'rootpassword' => 'secretpassword',
'disklayoutId' => 1,
'runScripts' => [
1,
2,
],
'userprovidedDiskLayout' => 'autopart --type=lvm',
'hostname' => 'my.hostname.com',
'sshkeys' => [
'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCPMKW3XDPL0k257n8IBrmJrhSTOfczRjD5V