server

Create a firewall rule

Create a firewall rule. Rules are evaluated in position order; if position is omitted, the rule is appended. Changes can take 1-2 minutes to take effect.

post/1.3/server/{uuid}/firewall_rule

Request

  • Base URL: https://api.upcloud.com
  • URL: https://api.upcloud.com/1.3/server/{uuid}/firewall_rule
  • Auth: HTTP bearer

Path parameters

uuidstring uuid required

Universally unique identifier

Example:0414e0d7-4436-4037-9dd8-6eaf47dce599

Cloud Server UUID

Request body

firewall_ruleServerFirewallRuleRequirements required

Example request

{
  "firewall_rule": {
    "action": "accept",
    "comment": "Allow SSH from the office network",
    "destination_port_end": "22",
    "destination_port_start": "22",
    "direction": "in",
    "family": "IPv4",
    "position": "1",
    "protocol": "tcp",
    "source_address_end": "192.0.2.255",
    "source_address_start": "192.0.2.1"
  }
}

Response

Created firewall rule

Example response

{
  "firewall_rule": {
    "action": "accept",
    "comment": "Allow SSH from the office network",
    "destination_address_end": "",
    "destination_address_start": "",
    "destination_port_end": "22",
    "destination_port_start": "22",
    "direction": "in",
    "family": "IPv4",
    "icmp_type": "",
    "position": "1",
    "protocol": "tcp",
    "source_address_end": "192.0.2.255",
    "source_address_start": "192.0.2.1",
    "source_port_end": "",
    "source_port_start": ""
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.