Network operations data:

ResourceActionDescription
net.phpget_statusRetrieve interface status
net.phpport_offDisable interface
net.phpport_onEnable interface
net.phpshow_cactiEnable interface
ip.phpshow_cactiGet IP information
ip.phpget_ptrGet PTR record for IP
ip.phpupdate_ptrUpdate PTR record for IP
ip.phpset_mainSet IP option for a server
net.phpblock_ipBlock specific IP
net.phpunblock_ipUnblock specific IP

Net/ Get_status


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringget_status Main action - Retrieve interface status
token     *        string               Your session token
id     *        int                Your server ID
pin     *        int                Your PIN code
port          string                Physical port's switch
switch            string                Switch id and address
vlan            int                Vlan number if any
speed             string                Physical interface speed 
status            string                Interface status, connected or not
mac            string                Mac information if any
port_security            string                Maximum allowed MACs on port if any
shape           string               Port speed limits if any

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=get_status" \
--data "token=" \
--data "id=" \
--data "port= \
--data "
pin=" \


This action has asynchronous response.


Net/Port_off


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringport_off Main action - Disable interface
token     *        string               Your session token
id     *        int                Your server ID
pin     *        int                Your PIN code
port    *       string                Physical port's switch

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=port_off" \
--data "token=" \
--data "id=" \
--data "port=physical port's switch" \
--data "pin=" \


This action has asynchronous response.


Net/Port_on


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringport_on Main action - Enable interface
token     *        string               Your session token
id     *        int                Your server ID
pin     *        int                Your PIN code
port    *       string                Physical port's switch

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=port_on" \
--data "token=" \
--data "id=" \
--data "port=" \
--data "pin=" \


This action has asynchronous response.


Net/Show_cacti


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringshow_cacti Main action - Show port speed graphs
token     *        string               Your session token
id     *        int                Your server ID
pin     *        int                Your PIN code
port    *       string                Physical port's switch
graph   *       string                Graph values - 1 for daily, 2 for monthly, 3 for annual graphs

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=show_cacti" \
--data "token=" \
--data "id=" \
--data "port=" \
--data "graph=" \

Response:  traffic graph image

Ip/Get_ip


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringget_ip Main action - Get IP information
token     *        string               Your session token
ip     *        int                Your IP address

curl -s "https://invapi.hostkey.com/ip.php" -X POST \
--data "action=get_ip" \
--data "token=" \
--data "ip=" \


Get_ptr


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringget_ptr Main action - Get PTR record for IP
token     *        string               Your session token
id     *        int                Your server ID
ip     *        int                Your IP address

curl -s "https://invapi.hostkey.com/ip.php" -X POST \
--data "action=get_ptr" \
--data "token=" \
--data "id=" \
--data "ip=" \


Ip/Update_ptr

There are allowed to have more than one reverse record for IP. Supplying several RRs could be done with a %0A separator. 


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringupdate_ptr Main action - Update PTR record for IP
token     *        string               Your session token
id     *        int                Your server ID
ip     *        int                Your IP address
ptr    *        string                Your ptr data

curl -s "https://invapi.hostkey.com/ip.php" -X POST \
--data "action=update_ptr" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "ptr=" \


Ip/Set_main


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringset_mainMain action - Set IP option for a server
token     *        string               Your session token
id     *        int                Your server ID
ip     *        int                Your IP address
main    *        int               Ip address to be set as main 

If a server has several IPs assigned, one should be marked as "main" for installation purposes, the config will be created only for the main IP, and the rest of the server will be configured with it.


curl -s "https://invapi.hostkey.com/ip.php" -X POST \
--data "action=set_main" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "main=" \


Net/Block_ip

With this call you could block the specific IP on a server, this is useful to manage abuse requests. This is done on HOSTKEY's network layer.


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringblock_ipMain action - Block specific IP
token     *        string               Your session token
id     *        int                Your server ID
ip     *        int                Your IP address
pin     *        int                Your PIN code
description            string               The reason for the block
four_hours           int               If set, the block will be automatically lifted after 4 hours.

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=block_ip" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "pin=" \
--data "description=this+is+block+test" \
--data "four_hours=1" \


This action has asynchronous response


Net/Unblock_ip


HTTP Method - POST


ParameterRequiredType Value/defaultDescription
action    *        stringunblock_ipMain action - Unblock specific IP
token     *        string               Your session token
id     *        int                Your server ID
ip     *        int                Your IP address
pin     *        int                Your PIN code

curl -s "https://invapi.hostkey.com/net.php" -X POST \
--data "action=unblock_ip" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "pin=" \


This action has asynchronous response


Tags: