net.php¶
Network infrastructure management module: adding and removing IP addresses, blocking traffic, managing network port states, retrieving statistics, and displaying Cacti charts.
API Methods¶
| Method | Action | Description |
|---|---|---|
add_ipv4 | add ipv4 | Adds one or multiple IPv4 addresses to a specific server interface. If no IP is provided, the system searches for available free IPs based on location and VLAN. |
block_ip | block ip | Blocks a specific IP address using BIRD or blackhole mode. If an expiration time is set, it adds a block_expire tag to the server. |
get_status | get status / shape net | Manages network port states (on/off), bandwidth shaping, and interface configurations for a specific server. |
port_off | turn off port | Disables a specific network port on the target device. |
port_on | turn on port | Enables a specific network port on the target device. |
remove_ipv4 | remove IPv4 address from a server | Removes a specific IPv4 address or all IPv4 addresses from the specified server. |
show_cacti | get cacti graph | Retrieves a specific Cacti graph for the given resource ID. |
show_ipv4_free | get free ipv4 addresses | Returns a list of available IPv4 addresses for a specific server, interface (port), and VLAN, considering ownership and subnet constraints. |
unblock_ip | unblock ip | Removes an IP block from a specific server using BIRD or blackhole management. |
net/add_ipv4¶
Adds one or multiple IPv4 addresses to a specific server interface. If no IP is provided, the system searches for available free IPs based on location and VLAN.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform |
| token | ❌ | string | Authentication token |
| id | ✅ | integer | Server ID |
| port | ✅ | string | Interface name or type (e.g., 'eth0', 'ipmi') |
| ips[] | ❌ | array | Specific IP addresses to add. If empty, system searches for free IPs. |
| ip_tag | ❌ | string|array | Tag used for searching/filtering IPs |
| amount | ❌ | integer | Number of free IPs to search for if 'ips' is not provided |
| allow_tech_networks | ❌ | integer | Admin option to allow adding IPs from non-customer networks |
Example Request
Example of a successful response
Failure response
net/block_ip¶
Blocks a specific IP address using BIRD or blackhole mode. If an expiration time is set, it adds a block_expire tag to the server.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform (block_ip or blackhole_ip) |
| token | ✅ | string | Authentication token |
| ip | ✅ | string | The IP address to block |
| id | ❌ | int | Server ID. If not provided, the system attempts to find it via eq_search using the IP. |
| description | ❌ | string | Description for the block entry |
Example Request
Example of a successful response
net/get_status¶
Manages network port states (on/off), bandwidth shaping, and interface configurations for a specific server.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform (e.g., port_on, port_off, shape_net) |
| id | ✅ | int | Server ID |
| port | ❌ | string | Port notation (e.g., eth0, ipmi) |
| vlan | ❌ | int | VLAN ID |
| speed | ❌ | string | Interface speed |
| port_security | ❌ | int | Port security setting |
| trunc | ❌ | int | Trunking configuration |
| status | ❌ | string | Port status |
| token | ❌ | string | Authentication token |
| duplex | ❌ | int | Duplex mode |
| nic_id | ❌ | int | Network Interface Card ID |
| port_virt_node | ❌ | string | Virtual node port information |
Example Request
Example of a successful response
net/port_off¶
Disables a specific network port on the target device.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| token | ✅ | string | Authentication token for verifying user session |
| id | ✅ | int | The unique identifier of the port to be disabled |
Example Request
Example of a successful response
net/port_on¶
Enables a specific network port on the target device.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform |
| token | ✅ | string | Authentication token |
| params[id] | ✅ | integer | The ID of the port to enable |
Example Request
Example of a successful response
net/remove_ipv4¶
Removes a specific IPv4 address or all IPv4 addresses from the specified server.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform |
| token | ❌ | string | Authentication token |
| params[id] | ✅ | int | The ID of the server |
| params[ip] | ❌ | string | The IPv4 address to remove |
| params[remove_all] | ❌ | boolean | Whether to remove all IPv4 addresses from the server |
Example Request
Example of a successful response
net/show_cacti¶
Retrieves a specific Cacti graph for the given resource ID.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_cacti |
| id | ✅ | int | The unique identifier of the network resource (e.g., switch or device). |
| port | ❌ | string | Port identifier for the graph. |
Example Request
Example of a successful response
net/show_ipv4_free¶
Returns a list of available IPv4 addresses for a specific server, interface (port), and VLAN, considering ownership and subnet constraints.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: show_ipv4_free |
| token | ❌ | string | Authentication token for the session |
| id | ✅ | integer | The ID of the server |
| port | ✅ | string | Interface name (e.g., 'ipmi') |
| ip | ❌ | string | IP address to check against |
| amount | ❌ | integer | Number of IP addresses requested |
| show_all | ❌ | integer | Whether to show all available IPs (0 or 1). Customers are restricted to 0. |
Example Request
Example of a successful response
Failure response
net/unblock_ip¶
Removes an IP block from a specific server using BIRD or blackhole management.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The action to perform (e.g., unblock_ip) |
| token | ❌ | string | Authentication token |
| ip | ✅ | string | The IP address to unblock |
| id | ❌ | int | Server ID. If not provided, the system attempts to find the server by IP |
Example Request