Page tree

Overview

This API call only applies to Armor Complete users.

The Create Firewall Rules API retrieves firewall rules for a specified device.   

You can use the Get Firewalls API to find the deviceID. 

Sample request

POST https://api.armor.com/firewall/2/rules

{
    "rules": [
        {
            "destinations": [
                {
                    "id": 1
                }
            ],
            "sources": [
                {
                    "id": 1
                }
            ],
            "services": [
                {
                    "id": 2
                },
                {
                    "id": 1
                }
            ]
        }
    ]
}

Input

The following table describes the different parts of this API call: 

API Call / URLMethod / Type
/firewall/{deviceId}/rulesPOST

The following table describes the parameter (or parameters) for this API call:

ParameterDescriptionFormatRequired or optionalExample
deviceIdID for the device to retrieve rulesIntegerRequired2
rulesArray of FirewallRule objectsFirewallRule []Required

[ ]


Sample return

StatusResponse
200
 {
      "id": 8,
      "deviceId": 2,
      "accountId": 2,
      "rules": [{
                  "id": 15,
                  "destinations": [{
                              "id": 1,
                              "type": "any",
                              "name": "ANY"
                        }],
                  "sources": [{
                              "id": 1,
                              "type": "any",
                              "name": "ANY"
                        }],
                  "services":[{
                              "id": 2,
                              "deviceId": 2,
                              "location": "DFW01",
                              "accountId": 0,
                              "name": "TCP ALL",
                              "description": "",
                              "values": [{
                                          "protocol": "tcp",
                                          "subprotocol": null,
                                          "minimum": 1,
                                          "maximum": 65535
                                    }]
                        }, {
                              "id": 1,
                              "deviceId": 2,
                              "location": null,
                              "accountId": 2,
                              "name": "TCP 80",
                              "description": null,
                              "values": [{
                                          "port": 80,
                                          "protocol": "tcp",
                                          "subprotocol": null
                                    }]
                        }],
                  "action": "allow",
                  "name": "VMW Rules",
                  "description": "",
                  "sortOrder": 1,
                  "isEnabled": true,
                  "readonly": false
            }
      ],
      "staged": true
}