PUT /system/servers/{server_id}/firewall_rules
Sets the access control firewall rules based on the supplied server ID.
MIME Type |
---|
application/json |
Parameter | Type | Optionality | Data Type | MIME Type | Description |
---|---|---|---|---|---|
server_id |
path |
Required |
Number (Integer) |
text/plain |
Required - The ID of the server. |
Parameter | Data Type | MIME Type | Description | Sample |
---|---|---|---|---|
rules |
Array<Object> |
application/json |
Required - A list of new rules in a JSON string. Each rule record contains the following fields:
|
[ { "is_any_source_ip": true, "port_range": "String", "port_type": "String <one of: ANY, SINGLE, RANGE>", "protocol": "String <one of: ANY, TCP, UDP>", "single_port": "String", "source_ip": "String" } ] |
HTTP Response Code | Unique Code | Description |
---|---|---|
200 |
The rules were updated. |
|
404 |
1002 |
The requested server with the given server ID cannot be found. |
422 |
1005 |
One or more parameters are invalid in request. |
500 |
1020 |
An error occurred while trying to set the access control firewall rules on the server with the given Id. |
Response Description
A list of the rules in a JSON string. Each rule contains the following fields:
- is_any_source_ip - Boolean - Whether any source IP address is accepted.
- port_range - String - A port range in the format of start-end.
- port_type - String - one of: ANY, SINGLE, RANGE.
- protocol - String - one of: ANY, TCP, UDP.
- single_port - String - A single port.
- source_ip - String - A specific IP address.
Response Sample
[
{
"is_any_source_ip": true,
"port_range": "String",
"port_type": "String <one of: ANY, SINGLE, RANGE>",
"protocol": "String <one of: ANY, TCP, UDP>",
"single_port": "String",
"source_ip": "String"
}
]