API
Firewalls
Create firewall

Create a Firewall

  • Name
    post
    Type
    /v1/firewalls
    Description

    Send a POST request to create a firewall with the following attributes: inbound_rules and outbound_rules.

Request

Required Attributes

  • Name
    name
    Type
    string
    Description

    Name of the userdata script to create a firewalls.

  • Name
    inboud_rules
    Type
    array
    Description

    An array of inbound_rules access for the firewall.

  • Name
    outboud_rules
    Type
    array
    Description

    An array of outbound_rules access for the firewall.

Optional Attributes

  • Name
    stacklet_ids
    Type
    array
    Description

    An array of the Stacklets IDs attached to the firewall.

  • Name
    project_uuid
    Type
    array
    Description

    The project universal unique identifier where the firewall will be placed. If the user didn't provide the UUID, the system will replace the firewall in the user default project.

Required Rule Attributes

Required firewall's inbound_rules array of attributes:

  • Name
    address
    Type
    string
    Description

    Addresses of IPv4 and/or IPv4 CIDRs for which are allowed traffic to/from the firewalls.

Optional Rule Attributes

Optional firewall's inbound_rules array of attributes:

  • Name
    port
    Type
    integer
    Description

    Protocol port in which the traffic will be allowed, use the values: from 0 - 65535.

  • Name
    protocol
    Type
    string
    Description

    Protocol type: TCP, UDP, ICMP or empty for "all".

Example

curl -X POST "https://api.simplystack.com/v1/firewalls" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token d359ad9cc9422b5ff07aede0cd2707da4ff82be0" \
  -d '{"name": "TestFirewall", "inbound_rules": [{"address": "0.0.0.0/0", "port": 22, "protocol": "tcp"}], "otbound_rules": [{"address": "0.0.0.0/0"}]}'

Response

JSON object with key named firewall. which is an array of the following attributes for the firewall, inboud_rules and outboud_rules objects:

Firewall

See firewall model.

Rule

See firewall rule model.

Example

json
{
  "firewall": {
    "uuid": "c85b4c53-4b37-4163-b8fa-a6d88b78eda8",
    "name": "TestFirewall",
    "created_at": "2020-07-30T07:13:47.482593Z",
    "inbound_rules": [
      {
        "address": "0.0.0.0/0",
        "port": 22,
        "protocol": "tcp"
      }
    ],
    "outbound_rules": [
      {
        "address": "0.0.0.0/0",
        "port": null,
        "protocol": null
      }
    ],
    "project": {
      "id": "8f2455f3-a8ee-49af-aaf1-18738b9662c2",
      "name": "MyProject"
    },
    "resources": {
      "stacklet_ids": []
    }
  }
}