MENU navbar-image

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.

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" 

Request   

POST api/system/brands/{brand}/logos/store

URL Parameters

brand  string  

The brand.

Body Parameters

lightlogo  file optional  

Must be an image. Must not be greater than 512 kilobytes.

darklogo  file optional  

Must be an image. Must not be greater than 512 kilobytes.

favicon  file optional  

Must be an image. Must not be greater than 512 kilobytes.

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
}"

Request   

DELETE api/system/brands/{brand}/logos/delete

URL Parameters

brand  string  

The brand.

Body Parameters

lightlogo  boolean optional  

darklogo  boolean optional  

favicon  boolean optional  

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"
}
 

Request   

GET api/system/brands

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\"
}"

Request   

POST api/system/brands

Body Parameters

domain  string  

The domain for the new brand.

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"
}
 

Request   

GET api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

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\"
        }
    ]
}"

Request   

PUT api/system/brands/{id}

PATCH api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

Body Parameters

login_page_text  string optional  

Text which is shown above the login form.

page_title  string optional  

The page title.

top_navbar_header_title  string optional  

Text which is shown at the left sidebar.

color_scheme  object optional  

Custom color scheme for this brand.

color_scheme.dark  string[] optional  

color_scheme.light  string[] optional  

user_id  integer optional  

The owner of the brand. The owner is usually a reseller.

languageOverrides  object optional  

The owner of the brand. The owner is usually a reseller.

navbar_text_instead_logo  boolean optional  

navbar_logo_always_dark  boolean optional  

loginpage_text_instead_logo  boolean optional  

loginpage_logo_always_dark  boolean optional  

loginpage_logo_above_form  boolean optional  

loginpage_show_text_within_form  boolean optional  

navbar_logo_max_height  integer optional  

loginpage_logo_max_height  integer optional  

theme_flat_buttons  boolean optional  

theme_cards_elevation  integer optional  

Must be at least 0. Must not be greater than 25.

theme_cards_outlined  boolean optional  

theme_top_bar_full_length  boolean optional  

theme_serverpage_notes_importantNotes_showOnTop  boolean optional  

availableLanguages  object[] optional  

availableLanguages[].languageName  string  

Must not be greater than 50 characters.

availableLanguages[].languageCode  string  

Must not be greater than 10 characters.

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"

Request   

DELETE api/system/brands/{id}

URL Parameters

id  integer  

The ID of the brand.

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"
}
 

Request   

GET api/externalProviders

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\": []
}"

Request   

POST api/externalProviders

Body Parameters

provider  string  

Must be one of proxmox, hetznercloud, hetznerdedicated, vmwarevsphere, ovhdedicated, novoserve, mylocdedicated, innov4web, tailormadeservers, gthost, reliablesite, tenantos, or generic.

name  string  

User definable name. Should be an easily identifiable name.

apiUrl  string optional  

apiUser  string optional  

apiPassword  string optional  

meta  string[] optional  

Depending on the provider, additional meta information must be set.

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"
}
 

Request   

GET api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

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\": []
}"

Request   

PUT api/externalProviders/{id}

PATCH api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

Body Parameters

name  string optional  

User definable name. Should be an easily identifiable name.

apiUrl  string optional  

apiUser  string optional  

apiPassword  string optional  

meta  string[] optional  

Depending on the provider, additional meta information must be set.

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"

Request   

DELETE api/externalProviders/{id}

URL Parameters

id  integer  

The ID of the provider.

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."
}
 

Request   

GET api/files/{fileId}/download

URL Parameters

fileId  string  

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"

Request   

DELETE api/files/{fileId}

URL Parameters

fileId  string  

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\"
}"

Request   

POST api/ip/massaction

Body Parameters

mode  string  

Must be one of reserve, unreserve, delete.

ips  string[]  

An array of IPs or subnets with CIDR where the action should be performed:

type  string  

Must be one of singleIp or subnet. Use singleIp if the listed values at the "ips" param are IP addresses, or subnet if the values are subnets.

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\"
}"

Request   

POST api/ip/reserve

Body Parameters

adminIp  string  

Must be a valid IP address or a subnet with CIDR.

type  string  

Must be one of singleIp or subnet.

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\"
}"

Request   

POST api/ip/unreserve

Body Parameters

adminIp  string  

Must be a valid IP address or a subnet with CIDR.

type  string  

Must be one of singleIp or subnet.

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\"
}"

Request   

POST api/ip/comment

Body Parameters

comment  string optional  

The comment to store. Leave blank to remove the existing comment.

adminIp  string  

Must be a valid IP address or a subnet with CIDR.

type  string  

Must be one of singleIp or subnet.

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\"
}"

Request   

DELETE api/ip/delete

Body Parameters

adminIp  string  

type  string  

Must be one of singleIp or subnet.

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"
}
 

Request   

GET api/inventorycomponents/customfields

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\"
    ]
}"

Request   

POST api/inventorycomponents/customfields

Body Parameters

name  string  

The name of the custom field.

type  string  

Must be one of input, checkbox, or dropdown.

availableValues  string[] optional  

If the type is dropdown, the submitted values are attached to the custom field.

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"
}
 

Request   

GET api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

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\"
    ]
}"

Request   

PUT api/inventorycomponents/customfields/{id}

PATCH api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

Body Parameters

name  string optional  

The name of the custom field.

type  string optional  

Must be one of input, checkbox, or dropdown.

availableValues  string[] optional  

If the type is dropdown, the submitted values are attached to the custom field.

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"

Request   

DELETE api/inventorycomponents/customfields/{id}

URL Parameters

id  integer  

The ID of the inventory component custom field.

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"
}
 

Request   

GET api/inventorycomponents

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\"
}"

Request   

POST api/inventorycomponents

Body Parameters

groupname  string  

The name of the group. For example, "Hardware". Any name can be entered.

description  string  

A short description.

componentname  string  

The name of the component.

customfieldsRelations  string[] optional  

Multiple custom fields can be attached to a component.

valueType  string  

The type of the value. Must be one of text, mb (megabyte) or MHz.

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"
}
 

Request   

GET api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

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\"
}"

Request   

PUT api/inventorycomponents/{id}

PATCH api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

Body Parameters

groupname  string optional  

The name of the group. For example, "Hardware". Any name can be entered.

description  string optional  

A short description.

componentname  string optional  

The name of the component.

customfieldsRelations  string[] optional  

Multiple custom fields can be attached to a component.

valueType  string optional  

The type of the value. Must be one of text, mb (megabyte) or MHz.

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"

Request   

DELETE api/inventorycomponents/{id}

URL Parameters

id  integer  

The ID of the inventory component.

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
}"

Request   

POST api/networkDevices/{networkDevice}/actions/testConnectivity

URL Parameters

networkDevice  integer  

The ID of the network device.

Body Parameters

useCache  boolean optional  

The last status of network devices is cached for at least 15 minutes. Submit true to receive the cached status (for faster response).

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
}
 

Request   

GET api/networkDevices

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\"
    }
}"

Request   

POST api/networkDevices

Body Parameters

deviceType  string  

Must be one of snmp_switch, telejetDigiOne, apc, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, raritanDominionSX, raritanDominionKXII, raritanDominionKXIII, sentry4, or ipoman.

name  string  

host  string  

The hostname or IP of the device.

port  integer optional  

This field is required when deviceType is telejetDigiOne. Must be between 1 and 65535.

username  string optional  

This field is required when deviceType is telejetDigiOne.

password  string optional  

Optional field. Currently only available for telejet.

snmpCommunity  string optional  

This field is required when deviceType is snmp_switch, apc, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, sentry4, or ipoman.

snmpVersion  string optional  

This field is required when deviceType is snmp_switch. The SNMP version for PDUs is detected automatically.

snmpAuthAlgo  string optional  

Must be one of SHA, SHA-224, SHA-256, SHA-384, SHA-512, or MD5. Only used if SNMP v3 is used.

snmpAuthLevel  string optional  

Must be one of noAuthNoPriv, authNoPriv, or authPriv. Only used if SNMP v3 is used.

snmpCryptoAlgo  string optional  

Must be one of AES or DES. Only used if SNMP v3 is used.

snmpCryptoPassword  string optional  

The SNMP v3 crypto password. Only used if SNMP v3 is used.

enableAdvancedManagement  boolean optional  

managementVendor  string optional  

managementPort  integer optional  

Must be between 0 and 65535.

managementUser  string optional  

managementPassword  string optional  

agentId  integer  

The specificated agent will handle the connection.

features  string[] optional  

Some devices have additional features available.

meta  object optional  

Some devices support additional meta flags.

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"
}
 

Request   

GET api/networkDevices/{id}

URL Parameters

id  integer  

The ID of the network device.

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\"
    }
}"

Request   

PUT api/networkDevices/{id}

PATCH api/networkDevices/{id}

URL Parameters

id  integer optional  

The ID of the network device.

Body Parameters

deviceType  string optional  

Must be one of snmp_switch, telejetDigiOne, apc, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, sentry4, enlogicv1, intertechSw, intertechSm, azepdu, raritanDominionSX, raritanDominionKXII, raritanDominionKXIII, or ipoman.

name  string optional  

host  string optional  

The hostname or IP of the device.

port  integer optional  

This field is required when deviceType is telejetDigiOne. Must be between 1 and 65535.

username  string optional  

This field is required when deviceType is telejetDigiOne.

password  string optional  

Optional field. Currently only available for telejet.

snmpCommunity  string optional  

This field is required when deviceType is snmp_switch, apc, apcCpdu, racktivityEnergySwitch, racktivityPowerManager, cyberpowerAts, cyberpowerEpdu2, dellrPdu, enlogicv1, intertechSw, intertechSm, azepdu, sentry4, or ipoman.

snmpAuthAlgo  string optional  

Must be one of SHA, SHA-224, SHA-256, SHA-384, SHA-512, or MD5. Only used if SNMP v3 is used.

snmpAuthLevel  string optional  

Must be one of noAuthNoPriv, authNoPriv, or authPriv. Only used if SNMP v3 is used.

snmpCryptoAlgo  string optional  

Must be one of AES or DES. Only used if SNMP v3 is used.

snmpCryptoPassword  string optional  

The SNMP v3 crypto password. Only used if SNMP v3 is used.

snmpVersion  string optional  

This field is required when deviceType is snmp_switch. The SNMP version for PDUs is detected automatically.

enableAdvancedManagement  boolean optional  

managementVendor  string optional  

managementPort  integer optional  

Must be between 0 and 65535.

managementUser  string optional  

managementPassword  string optional  

agentId  integer optional  

The specificated agent will handle the connection.

features  string[] optional  

Some devices have additional features available.

meta  object optional  

Some devices support additional meta flags.

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"

Request   

DELETE api/networkDevices/{id}

URL Parameters

id  integer  

The ID of the network device.

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"
}
 

Request   

POST api/networkDevices/{networkDevice}/actions/{networkDeviceAction}

URL Parameters

networkDevice  integer optional  

The ID of the network device.

networkDeviceAction  string optional  

The action to execute. Use getFeatures to see the available actions. The features depend on the network device type.

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"
}
 

Request   

GET api/networkDevices/{networkDevice}/extendedDetails

URL Parameters

networkDevice  string  

The networkDevice.

id  integer  

The ID of the network device.

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"
}
 

Request   

GET api/system/version

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"
}
 

Request   

GET api/system/listTimezones

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"
}
 

Request   

GET api/ping

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"
}
 

Request   

GET api/system/listTimeDateFormats

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"
}
 

Request   

GET api/system/settingsAfterLogin

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"
}
 

Request   

GET api/system/ui/uiLanguage

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"
}
 

Request   

GET api/system/ui/settings

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"
}
 

Request   

GET api/system/ui/version

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\"
}"

Request   

POST api/pxe/profiles/{pxeProfileId}/duplicate

URL Parameters

pxeProfileId  integer  

The ID of the PXE profile which should be duplicated.

Body Parameters

name  string  

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\"
}"

Request   

POST api/pxe/scripts/{pxeScriptId}/duplicate

URL Parameters

pxeScriptId  integer  

The ID of the PXE script which should be duplicated.

Body Parameters

name  string  

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\"
}"

Request   

POST api/pxe/disklayouts/{pxeDisklayoutId}/duplicate

URL Parameters

pxeDisklayoutId  integer  

The ID of the PXE script which should be duplicated.

Body Parameters

name  string  

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\"
}"

Request   

POST api/os/list

Body Parameters

type  string  

Must be one of pxe.

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"
}
 

Request   

GET api/pxe/disklayouts

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\"
}"

Request   

POST api/pxe/disklayouts

Body Parameters

tags  string[]  

Must have at least 1 item. The disk layout is linked to the operating systems via tags.

disklayout  string optional  

The kickstart or preseed configuration.

name  string  

min_disks  integer optional  

The profile will only be offered if the server has the specificated minimum amount of disks. Leave empty to always offer.

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

hw_raid_handling  string optional  

Must be one of always_offer, only_offer_if_hw_raid, or dont_offer_if_hw_raid.

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"
}
 

Request   

GET api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

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\"
}"

Request   

PUT api/pxe/disklayouts/{id}

PATCH api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

Body Parameters

tags  string[] optional  

The disk layout is linked to the operating systems via tags.

disklayout  string optional  

The kickstart or preseed configuration.

name  string optional  

min_disks  integer optional  

The profile will only be offered if the server has the specificated minimum amount of disks. Leave empty to always offer.

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

partition_size_boot  integer optional  

Must be at least 100.

partition_size_efi  integer optional  

Must be at least 100.

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

hw_raid_handling  string optional  

Must be one of always_offer, only_offer_if_hw_raid, or dont_offer_if_hw_raid.

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"

Request   

DELETE api/pxe/disklayouts/{id}

URL Parameters

id  integer  

The ID of the disk layout.

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).

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/pxe/tags',
    [
        '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/tags"
);

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/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "tags": [
            {
                "id": "kickstart",
                "name": "kickstart"
            },
            {
                "id": "centos",
                "name": "centos"
            }
        ]
    },
    "message": "success"
}
 

Request   

GET api/pxe/tags

POST api/pxe/tags/getPxeProfilesByTags

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'domain.com/api/pxe/tags/getPxeProfilesByTags',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'tags' => [
                'eum',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "domain.com/api/pxe/tags/getPxeProfilesByTags"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tags": [
        "eum"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "domain.com/api/pxe/tags/getPxeProfilesByTags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tags\": [
        \"eum\"
    ]
}"

Request   

POST api/pxe/tags/getPxeProfilesByTags

Body Parameters

tags  string[]  

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"
}
 

Request   

GET api/pxe/profiles/{pxeProfileId}/clearcache

URL Parameters

pxeProfileId  integer  

The ID of the PXE profile.

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"
}
 

Request   

GET api/pxe/profiles

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
}"

Request   

POST api/pxe/profiles

Body Parameters

tags  string[]  

osName  string  

pxeType  string  

Must be one of preseed,kickstart,autoinstall,windows,grml,vmware.

pxeConfig  string  

The iPXE boot configuration.

defaultDiskLayout  string optional  

optional The disk layout configuration.

packages  string optional  

A list of packages which should be installed.

language  string optional  

autoInstallTemplate  string optional  

The answer file for the OS installer.

timezone  string optional  

mirrorUrl  string optional  

The URL to the OS mirror.

additionalDriversUrl  string optional  

Must be a valid URL.

cacheDirectory  string  

The OS files will be stored in this directory.

networkConfigMode  string optional  

Must be a valid network mode.

httpdirectory  string optional  

version  string optional  

The version of the operating system. Only required for Ubuntu / Windows.

customFirstBoot  string optional  

Script will be executed on first operating system boot.

customPostScript  string optional  

Script will be executed on after the installation has been completed, but within the installer environment.

isDisabled  boolean optional  

allow_ssh_keys  boolean optional  

allow_set_hostname  boolean optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

set_root_password  boolean optional  

updateServerHardwareInventory  boolean optional  

completeAfterDownload  boolean optional  

default_disklayout_template  integer optional  

fallback_to_default_disklayout_if_unset  boolean optional  

enforced_default_disklayout_template  boolean optional  

default_run_scripts  string[] optional  

enforced_default_run_scripts  boolean optional  

default_run_scripts_hide_others  boolean optional  

configure_all_ipvfour_ask_user  boolean optional  

configure_all_ipvfour_enforce  boolean optional  

configure_ipvfour_even_if_outside_of_gateway  boolean optional  

configure_all_ipvsix_ask_user  boolean optional  

configure_all_ipvsix_enforce  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

windows_activation_key  string optional  

windows_use_empty_activation_key  boolean optional  

windows_key_location_userdata  boolean optional  

windows_key_location_specialize  boolean optional  

windows_bypass_system_requirements_check  boolean optional  

windows_skip_oobe  boolean optional  

pxe_enable_comboot  boolean optional  

ipxe_bios_file  string optional  

ipxe_efi_file  string optional  

licensekey  string optional  

keep_dhcp_minutes  integer optional  

Must be at least 1. Must not be greater than 6000.

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"
}
 

Request   

GET api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

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
}"

Request   

PUT api/pxe/profiles/{id}

PATCH api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

Body Parameters

tags  string[] optional  

osName  string optional  

pxeType  string  

Must be one of preseed,kickstart,autoinstall,windows,grml,vmware.

pxeConfig  string optional  

The iPXE boot configuration.

defaultDiskLayout  string optional  

optional The disk layout configuration.

packages  string optional  

A list of packages which should be installed.

language  string optional  

autoInstallTemplate  string optional  

The answer file for the OS installer.

timezone  string optional  

mirrorUrl  string optional  

The URL to the OS mirror.

additionalDriversUrl  string optional  

Must be a valid URL.

cacheDirectory  string optional  

The OS files will be stored in this directory.

networkConfigMode  string optional  

httpdirectory  string optional  

version  string optional  

The version of the operating system. Only required for Ubuntu / Windows.

customFirstBoot  string optional  

Script will be executed on first operating system boot.

customPostScript  string optional  

Script will be executed on after the installation has been completed, but within the installer environment.

isDisabled  boolean optional  

allow_ssh_keys  boolean optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

allow_set_hostname  boolean optional  

set_root_password  boolean optional  

updateServerHardwareInventory  boolean optional  

completeAfterDownload  boolean optional  

default_disklayout_template  integer optional  

fallback_to_default_disklayout_if_unset  boolean optional  

enforced_default_disklayout_template  boolean optional  

default_run_scripts  string[] optional  

enforced_default_run_scripts  boolean optional  

default_run_scripts_hide_others  boolean optional  

configure_all_ipvfour_ask_user  boolean optional  

configure_all_ipvfour_enforce  boolean optional  

configure_ipvfour_even_if_outside_of_gateway  boolean optional  

configure_all_ipvsix_ask_user  boolean optional  

configure_all_ipvsix_enforce  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

windows_activation_key  string optional  

windows_use_empty_activation_key  boolean optional  

windows_key_location_userdata  boolean optional  

windows_key_location_specialize  boolean optional  

windows_bypass_system_requirements_check  boolean optional  

windows_skip_oobe  boolean optional  

pxe_enable_comboot  boolean optional  

ipxe_bios_file  string optional  

ipxe_efi_file  string optional  

licensekey  string optional  

keep_dhcp_minutes  integer optional  

Must be at least 1. Must not be greater than 6000.

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"

Request   

DELETE api/pxe/profiles/{id}

URL Parameters

id  integer  

The ID of the PXE profile.

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"

Request   

POST api/pxe/profiles/{pxeProfileId}/restore

URL Parameters

pxeProfileId  string  

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"
}
 

Request   

GET api/pxe/scripts

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
}"

Request   

POST api/pxe/scripts

Body Parameters

tags  string[]  

The script is linked to the operating systems via tags.

script  string  

Script will be executed on after the installation has been completed.

name  string  

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

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"
}
 

Request   

GET api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

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
}"

Request   

PUT api/pxe/scripts/{id}

PATCH api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

Body Parameters

tags  string[] optional  

The script is linked to the operating systems via tags.

script  string optional  

Script will be executed on after the installation has been completed.

name  string optional  

isDisabled  boolean optional  

offer_if_has_tag  string[] optional  

dont_offer_if_has_tag  string[] optional  

offer_if_user_has_role  string[] optional  

dont_offer_if_user_has_role  string[] optional  

allow_for_vps  boolean optional  

allow_for_dedicated  boolean optional  

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"

Request   

DELETE api/pxe/scripts/{id}

URL Parameters

id  integer  

The ID of the PXE script.

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\"
}"

Request   

POST api/pxe/windows/importWindows

Body Parameters

editions  string[]  

The specificated editions will be imported.

cacheDirectory  string  

The Windows files will be placed in the specificated directory, regex: ^[a-z0-9]+$.

language  string  

The language which should be imported.

mode  string  

Must be one of iso or cdrom.

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"
}
 

Request   

POST api/pxe/windows/getWindowsInformation

Body Parameters

mode  string  

Must be one of iso or cdrom.

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
}"

Request   

POST api/remoteAgents/{agentId}/actions/testConnectivity

URL Parameters

agentId  integer  

The ID of the agent.

Body Parameters

useCache  boolean optional  

The last status is cached for at least 15 minutes. Submit true to receive the cached status (for faster response).

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"
}
 

Request   

GET api/remoteAgents/{agentId}/actions/getAssignments

URL Parameters

agentId  integer  

The ID of the agent.

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"
}
 

Request   

GET api/remoteAgents/ipmiKvmIsos

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\"
}"

Request   

POST api/remoteAgents/ipmiKvmIsos

Body Parameters

name  string  

downloadUrl  string  

The URL to the ISO file.

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"
}
 

Request   

GET api/remoteAgents/ipmiKvmIsos/{id}

URL Parameters

id  integer  

The ID of the ISO.

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"

Request   

DELETE api/remoteAgents/ipmiKvmIsos/{id}

URL Parameters

id  integer  

The ID of the ISO.

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"
}
 

Request   

GET api/remoteAgents

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\"
}"

Request   

POST api/remoteAgents

Body Parameters

name  string  

hostname  string  

password  string  

sshport  integer  

ip  string  

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"
}
 

Request   

GET api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

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
}"

Request   

PUT api/remoteAgents/{id}

PATCH api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

Body Parameters

name  string optional  

hostname  string optional  

sshport  integer optional  

ip  string optional  

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"

Request   

DELETE api/remoteAgents/{id}

URL Parameters

id  integer  

The ID of the agent.

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"

Request   

DELETE api/subnets/{subnet}/rdnsAssignment

URL Parameters

subnet  integer  

The ID of the subnet.

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):


{}
 

Request   

GET api/subnets/{subnet_id}/rdnsAssignment

URL Parameters

subnet_id  integer  

The ID of the subnet.

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"

Request   

POST api/rdns/providers/{provider}/configure

URL Parameters

provider  integer  

The ID of the RDNS provider.

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
}"

Request   

POST api/subnets/{subnet}/rdnsAssignment

URL Parameters

subnet  integer  

The ID of the subnet.

Body Parameters

serverId  integer  

The ID of the RDNS server.

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\"
}"

Request   

POST api/rdns/providers/{provider}/addSubnetAssignment

URL Parameters

provider  integer  

The ID of the RDNS server.

Body Parameters

subnet  string  

Must be a valid subnet (without CIDR).

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\"
}"

Request   

POST api/rdns/ip

Body Parameters

adminIp  string  

Must be a valid IP address.

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
}"

Request   

PUT api/rdns/ip

Body Parameters

ptrRecord  string optional  

adminIp  string  

Must be a valid IP address.

setPtrTemplate  boolean optional  

If set to true, the RDNS entry will be set to the default value. Default is false.

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\"
}"

Request   

DELETE api/rdns/ip

Body Parameters

adminIp  string  

Must be a valid IP address.

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"
}
 

Request   

GET api/rdns/providers

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\"
    }
}"

Request   

POST api/rdns/providers

Body Parameters

type  string  

The RDNS provider.

data  object  

The access details for the RDNS provider.

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"
}
 

Request   

GET api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

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\"
}"

Request   

PUT api/rdns/providers/{id}

PATCH api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

Body Parameters

serverName  string optional  

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"

Request   

DELETE api/rdns/providers/{id}

URL Parameters

id  integer  

The ID of the RDNS provider.

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"
}
 

Request   

GET api/roles

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\"
    ]
}"

Request   

POST api/roles

Body Parameters

name  string  

permissionlist  string[] optional  

Array of single permissions.

permissionsets  string[] optional  

Array of permission groups.

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"
}
 

Request   

GET api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

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
}"

Request   

PUT api/roles/{id}

PATCH api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

Body Parameters

name  string optional  

permissionlist  string[] optional  

Array of single permissions.

permissionsets  string[] optional  

Array of permission groups.

sharedAccess  boolean optional  

serversIndexDisablePermissionChecks  boolean optional  

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"

Request   

DELETE api/roles/{id}

URL Parameters

id  integer  

The ID of the role.

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"
}
 

Request   

GET api/permissions

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"
}
 

Request   

POST api/search/quicksearch

Body Parameters

text  string  

The search term.

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"
}
 

Request   

GET api/servers/{server}/bmc/users/listUsers

URL Parameters

server  integer  

The ID of the server.

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
}"

Request   

POST api/servers/{server}/bmc/users/createUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

username  string  

channelAccessSettings  string optional  

The channel access settings for the user.

dontFailIfUserExists  boolean optional  

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
}"

Request   

POST api/servers/{server}/bmc/users/createUserWithPasswordAndPrivilege

URL Parameters

server  integer  

The ID of the server.

Body Parameters

username  string  

password  string  

privilege  integer  

The privilege level of the IPMI user.

channelAccessSettings  string optional  

The channel access settings for the user.

dontFailIfUserExists  boolean optional  

dontChangePasswordIfUserExists  boolean optional  

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\"
}"

Request   

POST api/servers/{server}/bmc/users/updateUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer  

The IPMI slot ID of the user (see listUsers).

username  string optional  

password  string optional  

privilege  integer  

The privilege level of the IPMI user.

channelAccessSettings  string optional  

The channel access settings for the user.

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\"
}"

Request   

DELETE api/servers/{server}/bmc/users/deleteUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

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
}"

Request   

PUT api/servers/{server}/bmc/users/enableUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

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
}"

Request   

PUT api/servers/{server}/bmc/users/disableUser

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

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
}"

Request   

POST api/servers/{server}/bmc/users/setUserPassword

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

password  string optional  

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

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
}"

Request   

POST api/servers/{server}/bmc/users/setUserPrivilege

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  integer optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

privilege  integer  

Must be one of 1, 2, 3, or 4.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

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\"
}"

Request   

POST api/servers/{server}/bmc/users/channelSetAccess

URL Parameters

server  integer  

The ID of the server.

Body Parameters

slot  required optional  

The IPMI slot ID of the user (see listUsers). This field is required when username is not present.

username  string optional  

This field is required when slot is not present.

withoutSlotCheck  boolean optional  

Set to true to skip the verification of whether the slot exists. The default value is true. When executing multiple API commands for the same IPMI user, you may choose to verify the user's existence only once to improve performance.

accessSettings  string  

The channel access settings for the user.

Server Basic Operations

Feature: https://documentation.tenantos.com/Tenantos/server-management/add-server/

GET api/servers/tags

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'domain.com/api/servers/tags',
    [
        '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/tags"
);

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/tags" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):


{
    "result": {
        "tags": [
            "For Rent",
            "Internal",
            "..."
        ]
    },
    "message": "success"
}
 

Request   

GET api/servers/tags

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"
}
 

Request   

GET api/servers/getByIp/{ip}

URL Parameters

ip  string  

Get server by IPv4 address.

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"
}
 

Request   

GET api/servers

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
        }
    ]
}"

Request   

POST api/servers

Body Parameters

hostname  string  

Must not be greater than 255 characters.

servername  string  

Must not be greater than 255 characters.

user_id  string optional  

description  string optional  

tags  string[] optional  

os  string optional  

servertype  string optional  

Must be one of auto, dedicated, or vm.

vpsplan  integer optional  

Only specify if a virtual server, based on the plan ID, should be created.

overrideVpsResources  string[] optional  

Only specify if a virtual server, based on the plan ID, should be created and you want to override the resources. See: https://documentation.tenantos.com/billing-whmcs/configurable-options/vps-resource-overrides/

config  object optional  

Specify to add connections to the server in one go.

ipassignments  object[] optional  

ipassignments[].ip  Enter optional  

the IP which should be assigned to the server.

ipassignments[].subnets_id  integer optional  

ipassignments[].primary_ip  boolean optional  

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"
}
 

Request   

GET api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

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\"
        }
    ]
}"

Request   

PUT api/servers/{id}

PATCH api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

Body Parameters

hostname  string optional  

Must not be greater than 255 characters.

servername  string optional  

Must not be greater than 255 characters.

user_id  integer optional  

description  string optional  

tags  string[] optional  

os  string optional  

servertype  string optional  

Must be one of auto, dedicated, or vm.

suspendUserIds  integer[] optional  

assignmentDates  object[] optional  

assignmentDates[].userId  integer  

assignmentDates[].datetime  string  

Must be a valid date in the format Y-m-d H:i:s. Must be a date before now.

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
}"

Request   

DELETE api/servers/{id}

URL Parameters

id  integer  

The ID of the server.

Body Parameters

destroy  boolean optional  

If server is a VM, the server will be deleted on the hypervisor (e.g. Proxmox)

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"
}
 

Request   

GET api/servers/{server}/console/start

URL Parameters

server  integer  

The ID of the server.

Body Parameters

authorizedIp  string  

Must be a valid IP address. The console is only reachable by the specificated IP.

consoleMode  string optional  

Must be one of standard or web.

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\"
    ]
}"

Request   

POST api/servers/getByTags

Body Parameters

tags  string[]  

An array of tags. Only servers which own all of the specified tags will be returned (= AND query, not OR). A list of all available tags can be received via the /api/servers/tags endpoint.

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\"
}"

Request   

POST api/servers/{server}/network/regenerateVlanConfiguration

URL Parameters

server  string  

The server.

Body Parameters

performVlanActions  string optional  

Must be one of perform, preview, or none.

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"
}
 

Request   

GET api/servers/{server_id}/comments

URL Parameters

server_id  integer  

The ID of the server.

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" 

Request   

POST api/servers/{server}/comments

URL Parameters

server  integer  

The ID of the server.

Body Parameters

comment  string  

sticky  boolean optional  

user_id  integer optional  

attachments  file[] optional  

Must be a file. Must not be greater than 50120 kilobytes.

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"
}
 

Request   

GET api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

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
}"

Request   

PUT api/servers/{server_id}/comments/{id}

PATCH api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

Body Parameters

comment  string optional  

sticky  boolean optional  

user_id  integer optional  

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"

Request   

DELETE api/servers/{server_id}/comments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the comment.

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"
}
 

Request   

GET api/servers/{server}/connections/{testConnectionId}/test

URL Parameters

server  integer  

The ID of the server.

testConnectionId  integer  

The ID of the connection. Not all connections support testing.

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"
}
 

Request   

GET api/servers/{server_id}/connections

URL Parameters

server_id  integer  

The ID of the server.

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\"
    }
}"

Request   

POST api/servers/{server}/connections

URL Parameters

server  integer  

The ID of the server.

Body Parameters

agentId  integer  

types  string[] optional  

Specify the allowed features / types for this connection.

connectionDetails  object  

connectionDetails.meta  object optional  

The connection configuration.

connectionDetails.type  string  

The type of the connection.

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"
}
 

Request   

GET api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

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\"
    }
}"

Request   

PUT api/servers/{server_id}/connections/{id}

PATCH api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

Body Parameters

agentId  integer optional  

types  string[] optional  

Specify the allowed features / types for this connection.

connectionDetails  object optional  

connectionDetails.meta  object optional  

The connection configuration.

connectionDetails.type  string optional  

The type of the connection.

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"

Request   

DELETE api/servers/{server_id}/connections/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the connection.

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"
}
 

Request   

POST api/servers/{server}/connections/{testConnectionId}/{serverConnectionAction}

URL Parameters

server  integer  

The ID of the server.

testConnectionId  integer  

The ID of the connection.

serverConnectionAction  string  

The action to execute. Use getSupportedActions to receive information about the available actions. To execute IPMI commands, use the api/servers/{server}/bmc/executeCommand endpoint.

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"
}
 

Request   

POST api/servers/{server}/ipassignments/rdns

URL Parameters

server  integer  

The ID of the server.

Body Parameters

ip  string optional  

Must be a valid IP address which is assigned to this server.

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"
}
 

Request   

GET api/servers/{server}/ipassignments/getAssignableSubnets

URL Parameters

server  integer  

The ID of the server (optional if called via GET api/virtualization/ipassignments/getAssignableSubnets).

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
}"

Request   

POST api/servers/{server}/ipassignments/getAssignableIpsOfSubnet

URL Parameters

server  integer  

The ID of the server.

Body Parameters

subnets_id  integer  

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"
}
 

Request   

GET api/virtualization/ipassignments/getAssignableSubnets

URL Parameters

server  integer  

The ID of the server (optional if called via GET api/virtualization/ipassignments/getAssignableSubnets).

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"
}
 

Request   

GET api/servers/{server_id}/ipassignments

URL Parameters

server_id  integer  

The ID of the server.

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\"
}"

Request   

POST api/servers/{server}/ipassignments

URL Parameters

server  integer  

The ID of the server.

Body Parameters

subnets_id  integer  

ips  string[]  

An array of IP addresses which will be assigned to the server.

description  string optional  

performVlanActions  string optional  

Must be one of perform, preview, or none.

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\"
}"

Request   

PUT api/servers/{server_id}/ipassignments/{id}

PATCH api/servers/{server_id}/ipassignments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the IP assignment. However, actually the "ip" body parameter is used for identification. The id parameter must not be empty, but can be any integer or string.

Body Parameters

description  string optional  

primary_ip  boolean optional  

ptrRecord  string optional  

setPtrTemplate  boolean optional  

If set to true, the RDNS entry will be set to the default value. Default is false.

subnetIp  string optional  

Only used if ip is a subnet. Then, this parameter must be an IP within the subnet (e.g. aaab:bbbb:cccc:aaaa::1).

ip  string  

Must be a IP/subnet which is assigned to the server. If the value is a subnet, it must be the subnet with CIDR (e.g. aaab:bbbb:cccc:aaaa::/52)

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\"
}"

Request   

DELETE api/servers/{server_id}/ipassignments/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the IP assignment. However, actually the "ip" body parameter is used for identification. The id parameter must not be empty, but can be any integer or string.

Body Parameters

ip  string optional  

Required if ips is empty. The IP which you want to delete from the server.

ips  string[] optional  

Required if ip is empty. An array of IPs which you want to delete from the server.

performVlanActions  string optional  

Must be one of perform, preview, or none.

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"
}
 

Request   

GET api/servers/{server_id}/hwsummary

URL Parameters

server_id  integer  

The ID of the server.

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"
}
 

Request   

GET api/servers/{server}/hwsummary/withDetails

URL Parameters

server  integer  

The ID of the server.

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"
}
 

Request   

GET api/servers/{server}/inventory/getInventoryCommand

URL Parameters

server  integer  

The ID of the server.

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"
}
 

Request   

GET api/servers/{server_id}/inventory

URL Parameters

server_id  integer  

The ID of the server.

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\"
}"

Request   

POST api/servers/{server}/inventory

URL Parameters

server  integer  

The ID of the server.

Body Parameters

model  string optional  

value  string optional  

serial  string optional  

inventorycomponent_id  integer  

The ID of the root component.

description  string optional  

customfields  string[] optional  

An array of custom fields, if the root component has custom fields assigned.

customfields[].fieldId  integer  

customfields[].value  string optional  

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"
}
 

Request   

GET api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the inventory.

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\"
}"

Request   

PUT api/servers/{server_id}/inventory/{id}

PATCH api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  string  

integer The ID of the inventory.

Body Parameters

model  string optional  

value  string optional  

serial  string optional  

inventorycomponent_id  integer optional  

The ID of the root component.

description  string optional  

customfields  string[] optional  

An array of custom fields, if the root component has custom fields assigned.

customfields[].fieldId  integer optional  

customfields[].value  string optional  

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"

Request   

DELETE api/servers/{server_id}/inventory/{id}

URL Parameters

server_id  integer  

The ID of the server.

id  integer  

The ID of the inventory.

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