PUT /system/servers/{server_id}/firewall_rules

Sets the access control firewall rules based on the supplied server ID.

Table 1. PUT /system/servers/{server_id}/firewall_rules resource details
MIME Type

application/json

Table 2. PUT /system/servers/{server_id}/firewall_rules request parameter details
Parameter Type Optionality Data Type MIME Type Description

server_id

path

Required

Number (Integer)

text/plain

Required - The ID of the server.

Table 3. PUT /system/servers/{server_id}/firewall_rules request body details
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 - Boolean - Whether any source IP 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.

[ { "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" } ]

Table 4. PUT /system/servers/{server_id}/firewall_rules response codes
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"
    }
]