Network operations
Last modified by Hostkey Admin on 2022/07/14 11:30
Network operations data:
Resource | Action | Description |
---|---|---|
net.php | get_status | Retrieve interface status |
net.php | port_off | Disable interface |
net.php | port_on | Enable interface |
net.php | show_cacti | Enable interface |
ip.php | show_cacti | Get IP information |
ip.php | get_ptr | Get PTR record for IP |
ip.php | update_ptr | Update PTR record for IP |
ip.php | set_main | Set IP option for a server |
net.php | block_ip | Block specific IP |
net.php | unblock_ip | Unblock specific IP |
Net/ Get_status
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | get_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=" \
--data "action=get_status" \
--data "token=" \
--data "id=" \
--data "port= \
--data "pin=" \
Net/Port_off
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | port_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=" \
--data "action=port_off" \
--data "token=" \
--data "id=" \
--data "port=physical port's switch" \
--data "pin=" \
Net/Port_on
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | port_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=" \
--data "action=port_on" \
--data "token=" \
--data "id=" \
--data "port=" \
--data "pin=" \
Net/Show_cacti
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | show_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=" \
--data "action=show_cacti" \
--data "token=" \
--data "id=" \
--data "port=" \
--data "graph=" \
Response: traffic graph image
Ip/Get_ip
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | get_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=" \
--data "action=get_ip" \
--data "token=" \
--data "ip=" \
Get_ptr
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | get_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=" \
--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
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | update_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=" \
--data "action=update_ptr" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "ptr=" \
Ip/Set_main
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | set_main | Main 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=" \
--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
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | block_ip | Main 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" \
--data "action=block_ip" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "pin=" \
--data "description=this+is+block+test" \
--data "four_hours=1" \
Net/Unblock_ip
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | unblock_ip | Main 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=" \
--data "action=unblock_ip" \
--data "token=" \
--data "id=" \
--data "ip=" \
--data "pin=" \