We keep auxiliary and temporary information about servers and their components in tags. Tags may be assigned to any server's element. Some tags are visible to the end-user, some are not. 

Tag actions:

ResourceActionDescription
tags.phpaddAction add a tag to the server or change existing tag
tags.phpremoveAction removes a tag for a server
tags.phplistAction gets all tags for the server
tags.phpuser_searchAction find the servers with tags

The tag could be mounted to the server itself, or its CPU, or NIC or IP address - any DB component. The customer could assign their own tags to servers via API (and web interface). It's possible to search for tags, change or remove them.
It may be useful to keep some automation data, user settings, or application states in tags.

Tags/Add


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringadd Main action - Action add a tag to the server or change existing tag
token     *        string              Your session token
id     *        int              Your server ID
tag     *      string              Tag name
value    *    string              Tag value
extra       string              extra value if necessary to keep several values for the key

Example create new tag cURL:

curl -s "https://invapi.hostkey.com/tags.php" -X POST \
--data "action=add" \
--data "token=" \
--data "id=" \
--data "tag=" \
--data "value=" \
--data "extra="

Example change existing tag cURL:

curl -s "https://invapi.hostkey.com/tags.php" -X POST \
--data "action=add" \
--data "token=" \
--data "id=" \
--data "tag=" \
--data "value=" \
--data "extra="

Tags/Remove


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringremove Main action - removes a tag from a server
token     *        string              Your session token
id     *        int              Your server ID
tag     *      string         Tag name
curl -s "https://invapi.hostkey.com/tags.php" -X POST \
--data "action=remove" \
--data "token=" \
--data "id=" \
--data "tag="

Tags/List


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringlist Main action - retrive all tags from the server server_id
token     *        string              Your session token
id     *        int              Your server ID
curl -s "https://invapi.hostkey.com/tags.php" -X POST \
--data "action=list" \
--data "token=" \
--data "id="



HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        string user_search Main action - this request searches for servers IDs with tag name or value matching search_pattern as a substing
token     *        string              Your session token
value   *        string              search pattern
curl -s "https://invapi.hostkey.com/tags.php" -X POST \
--data "action=user_search" \
--data "token=" \
--data "value="


Tags: