Abiquo Documentation Cookies Policy

Our Documentation website uses cookies to improve your experience. Please visit our Cookie Policy page for more information about cookies and how we use them.


Abiquo 4.4

Skip to end of metadata
Go to start of metadata

Contents:

FirewallRulesResource

This resource represents the rules for firewall policies. Firewall policies use the security group model, so the platform denies access by default and users create rules to allow access as required.

Main URI of the Resource

This class operates mainly over the Resource URI: /cloud/locations/{location}/devices/{device}/firewalls/{firewall}/rules

The main URI of the resource is /cloud/locations/{location}/devices/{device}/firewalls/{firewall}/rules

Prior to Abiquo 3.8, it was /cloud/locations/{location}/firewalls/{firewall}/rules.

Exposed Methods

Retrieves the rules of a firewall policy

Return the list of all rules from a firewall policy.

Synopsis: GET http://example.com/api/cloud/locations/{location}/devices/{device}/firewalls/{firewall}/rules  
Roles Required: MANAGE_FIREWALLS
Request Headers: Accept:  application/vnd.abiquo.firewallrules+json; version=4.4; application/vnd.abiquo.firewallrules+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

    

Request Message Body Entity: 
Response Message Body Entity: Firewall Rules Media Type
Request Example:

 Click here to show or hide the request example

GET_cld_locs_X_devs_X_fws_X_rls_AC_firewallrls_j.0001.txt

cURL:

curl -X GET http://localhost:9000/api/cloud/locations/1828/devices/419/firewalls/279/rules \ 
	 -H 'Accept:application/vnd.abiquo.firewallrules+json; version=4.2' \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

--none--

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/locations/1828/devices/419/firewalls/279", 
      "type": "application/vnd.abiquo.firewallpolicy+json", 
      "rel": "firewall", 
      "title": "nameR"
    }
  ], 
  "collection": [
    {
      "sources": [], 
      "protocol": "153", 
      "links": [], 
      "fromPort": 154, 
      "toPort": 155, 
      "targets": [
        "159", 
        "160"
      ], 
      "id": 570
    }, 
    {
      "sources": [
        "161", 
        "162"
      ], 
      "protocol": "156", 
      "links": [], 
      "fromPort": 157, 
      "toPort": 158, 
      "targets": [], 
      "id": 571
    }
  ]
}

Modify the rules of a firewall policy

Modifies the list of all rules from a firewall policy, removing the old rules and creating only the given ones.

SynopsisPUT http://example.com/api/cloud/locations/{location}/devices/{device}/firewalls/{firewall}/rules 
Roles Required: MANAGE_FIREWALLS
Request Headers: Accept:  application/vnd.abiquo.firewallrules+json; version=4.4; application/vnd.abiquo.firewallrules+xml; version=4.4;  Content-type:  application/vnd.abiquo.firewallrules+json; version=4.4; application/vnd.abiquo.firewallrules+xml; version=4.4;
Request Parameters:

Parameter

Required

Default Value

Description

    

Request Message Body Entity: 
Request body:

 Click here to show or hide the request example
Request body of firewall rules example
<firewallrules>
    <firewallrule>
        <protocol>ALL</protocol>
        <fromPort>0</fromPort>
        <toPort>65535</toPort>
        <target>any</target>
        <target>other</target>
    </firewallrule>
    <firewallrule>
        <protocol>TCP</protocol>
        <fromPort>80</fromPort>
        <toPort>85</toPort>
        <source>any</source>
        <source>other</source>
    </firewallrule>
</firewallrules>


Response Message Body Entity: Firewall Rules Media Type
Request Example:

 Click here to show or hide the request example
PUT_cld_locs_X_devs_X_fws_X_rls_CT_firewallrls_j_AC_firewallrls_j.0001.txt

cURL:

curl -X PUT http://localhost:9000/api/cloud/locations/1830/devices/421/firewalls/281/rules \ 
	 -H 'Accept:application/vnd.abiquo.firewallrules+json; version=4.2' \ 
	 -H 'Content-Type:application/vnd.abiquo.firewallrules+json; version=4.2' \ 
	 -d @requestpayload.json \ 
	 -u user:password --verbose 

Success status code: 200

Request payload:

{
  "links": [], 
  "collection": [
    {
      "sources": [
        "source1", 
        "source2"
      ], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [], 
      "id": 0
    }, 
    {
      "sources": [], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [
        "target1", 
        "target2"
      ], 
      "id": 1
    }, 
    {
      "sources": [
        "source1", 
        "source2"
      ], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [], 
      "id": 2
    }
  ]
}

Response payload:

{
  "links": [
    {
      "href": "http://localhost:9009/api/cloud/locations/1830/devices/421/firewalls/281", 
      "type": "application/vnd.abiquo.firewallpolicy+json", 
      "rel": "firewall", 
      "title": "nameR"
    }
  ], 
  "collection": [
    {
      "sources": [
        "source1", 
        "source2"
      ], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [], 
      "id": 576
    }, 
    {
      "sources": [], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [
        "target1", 
        "target2"
      ], 
      "id": 577
    }, 
    {
      "sources": [
        "source1", 
        "source2"
      ], 
      "protocol": "http", 
      "links": [], 
      "fromPort": 0, 
      "toPort": 65355, 
      "targets": [], 
      "id": 578
    }
  ]
}