Ploi API
Ploi API

Create network rule

Creates a new network rule in the server.

POST api/servers/{server}/network-rules

Parameters

Parameter Type Status Description
name string required Maximum: 100
port string required Minimum: 1 Maximum: 65535 Must match this regular expression: /^([0-9]{0,5})(:[0-9]{0,5})?$/
type string required tcp or udp
rule_type string required allow or deny
from_ip_address ip optional IP address that is allowed to interact with this port (or not)

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/network-rules" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{"name":"My Rule", "port":"1000", "type":"tcp", "rule_type": "allow", "from_ip_address":"127.0.0.1"}'