Net
API Methods¶
| Method | Action | Description |
|---|---|---|
add_ipv4 | add IPv4 addresses | Adds a specified number of IPv4 addresses to a server on a specific port and VLAN. Supports selecting specific addresses or automatic selection of free ones. |
block_ip | block IP address | Blocks the specified IP address on the server via BIRD or blackhole. Requires authentication. |
get_status | get network interface status | Returns the current status of the server's network interface (port, MAC, IP, speed, activity status). |
port_off | disable network port | Disables the specified network port on the server. If the reason parameter is provided, a block tag with the specified reason is added. |
port_on | enable network port | Enables the specified network port on the server, removing the block (tag 'block') if it was applied by the user. Administrative blocks require support intervention. |
remove_ipv4 | remove IPv4 addresses | Removes one or all IPv4 addresses from the server. Requires IP validation and access rights. |
show_cacti | get Cacti graphs | Returns Cacti monitoring graph data for the specified server and port. |
show_ipv4_free | get list of free IPv4 addresses | Returns a list of available free IPv4 addresses for the specified server, port, and VLAN. Supports filtering by tags and freshness period. |
unblock_ip | unblock IP address | Unblocks the specified IP address on the server, removing block rules in BIRD and clearing block tags. Requires access rights validation. |
net/add_ipv4¶
Adds a specified number of IPv4 addresses to a server on a specific port and VLAN. Supports selecting specific addresses or automatic selection of free ones.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: add_ipv4 |
| token | ✅ | string | Authorization token |
| id | ✅ | int | ID of the server to which IPs are being added |
| amount | ✅ | int | Number of IP addresses to add (if specific IPs are not specified) |
| port | ✅ | string | Network interface name (e.g., eth0, ipmi) |
| vlan | ❌ | int | VLAN ID. If not specified, the interface VLAN is used or determined automatically |
| ip | ❌ | string | Specific IP address to add (if amount is not used) |
| ips | ❌ | array<string> | Array of specific IP addresses to add (format: ips[]=1.2.3.4&ips[]=1.2.3.5) |
| tag | ❌ | string | Tag for the network (e.g., ipmi, ovirt, bm) |
| fresh_period | ❌ | int | IP freshness period (time in seconds) |
| allow_tech_networks | ❌ | int | Allow use of technical networks (for administrators) |
Example Request
Example of a successful response
net/block_ip¶
Blocks the specified IP address on the server via BIRD or blackhole. Requires authentication.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: block_ip |
| token | ✅ | string | Authentication token |
| id | ✅ | int | ID of the server where the IP is located |
| ip | ✅ | string | IP address to block |
| description | ❌ | string | Reason for blocking (will be added to the tag) |
| four_hours | ❌ | int | Temporary block flag (4 hours) |
Example Request
Example of a successful response
net/get_status¶
Returns the current status of the server's network interface (port, MAC, IP, speed, activity status).
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: get_status |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier |
| port | ❌ | string | Port name (e.g., eth0, ipmi). If not specified, the primary interface is selected |
Example Request
Example of a successful response
Failure response
net/port_off¶
Disables the specified network port on the server. If the reason parameter is provided, a block tag with the specified reason is added.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: port_off |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier |
| port | ❌ | string | Port name (e.g., eth0). If not specified, the primary interface is selected |
| reason | ❌ | string | Reason for blocking. If specified, a 'block' tag is added with this reason |
Example Request
Example of a successful response
Failure response
net/port_on¶
Enables the specified network port on the server, removing the block (tag 'block') if it was applied by the user. Administrative blocks require support intervention.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: port_on |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Unique server identifier |
| port | ❌ | string | Interface name (e.g., eth0, ipmi). If not specified, the primary interface is selected automatically |
| port_id | ❌ | int | Direct network interface identifier (NIC ID) |
Example Request
Example of a successful response
Failure response
net/remove_ipv4¶
Removes one or all IPv4 addresses from the server. Requires IP validation and access rights.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: remove_ipv4 |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier (server_id) |
| ip | ✅ | string | IPv4 address to remove (valid format) |
| remove_all | ❌ | int | Flag to remove all IP addresses from the server (0 or 1) |
Example Request
Example of a successful response
net/show_cacti¶
Returns Cacti monitoring graph data for the specified server and port.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_cacti |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier |
| port | ❌ | string | Port name (e.g., eth0, ipmi) |
| graph | ❌ | string | Flag to display the graph (default 1) |
Example Request
Example of a successful response
net/show_ipv4_free¶
Returns a list of available free IPv4 addresses for the specified server, port, and VLAN. Supports filtering by tags and freshness period.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_ipv4_free |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier |
| port | ✅ | string | Network interface name (e.g., eth0, ipmi) |
| vlan | ❌ | int | VLAN ID. If not specified, it is determined automatically from the server interface |
| tag | ❌ | string | Tag for subnet filtering (e.g., bm, ipmi, ovirt) |
| ip | ❌ | string | Partial IP match for search |
| fresh_period | ❌ | int | IP freshness period (in seconds), -1 to ignore |
| show_all | ❌ | int | Show all available IPs (available only for administrators) |
Example Request
Example of a successful response
{
"result": "OK",
"action": "show_ipv4_free",
"id": 12345,
"ips": [
{
"ip": "192.168.1.10",
"vlan": 100,
"subnet": "192.168.1.0/24",
"location": "AMS",
"status": "free"
},
{
"ip": "192.168.1.11",
"vlan": 100,
"subnet": "192.168.1.0/24",
"location": "AMS",
"status": "free"
}
],
"subnets": [
{
"network": "192.168.1.0",
"mask": 24,
"broadcast": "192.168.1.255",
"total": 254,
"free": 2
}
],
"res": {
"total_found": 2,
"filtered": 0
},
"total_ips": 2,
"fresh": -1
}
net/unblock_ip¶
Unblocks the specified IP address on the server, removing block rules in BIRD and clearing block tags. Requires access rights validation.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: unblock_ip |
| token | ✅ | string | User authorization token |
| id | ✅ | int | Server identifier where the IP is located |
| ip | ✅ | string | IP address to unblock |
Example Request