Firewall Policies

OneAndOne::Firewall()

The Firewall class allows a user to perform actions against the 1and1 API.

list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)

Return a list of all shared storages.

Parameters:
  • page (int) – Allows the use of pagination. Indicate which page to start on.
  • per_page (int) – Number of items per page.
  • sort (str) – sort: 'name' retrieves a list of elements sorted alphabetically. sort: 'creation_date' retrieves a list of elements sorted by their creation date in descending order.
  • q (str) – q is for query. Use this parameter to return only the items that match your search query.
  • fields (str) – Returns only the parameters requested. (i.e. fields: ‘id, name, description, hardware.ram’)
Return type:

JSON

create(name: nil, description: nil, rules: nil)

Create a firewall policy.

Parameters:
  • name (str) – firewall policy’s name.
  • description (str) – firewall policy’s name.
  • rules (array) – an array of rules for the new firewall policy.
Return type:

JSON

get(firewall_id: @id)

Returns a firewall policy’s current specs.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall.
Return type:

JSON

modify(firewall_id: @id, name: nil, description: nil)

Modify a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • name (str) – firewall policy name.
  • description (str) – firewall policy description.
Return type:

JSON

delete(firewall_id: @id)

Delete a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall.
Return type:

JSON

ips(firewall_id: @id)

Returns a list of the IPs assigned to a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall.
Return type:

JSON

ip(firewall_id: @id, ip_id: nil)

Returns information about an IP assigned to a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • ip_id (str) – the unique identifier for the IP.
Return type:

JSON

add_ips(firewall_id: @id, ips: nil)

Add IPs to a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • ips (array) – an array of IP ID’s for the new firewall policy..
Return type:

JSON

rules(firewall_id: @id)

Returns a list the firewall policy’s rules.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall.
Return type:

JSON

rule(firewall_id: @id, rule_id: nil)

Returns information about a firewall policy’s rule.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • rule_id (str) – the unique identifier for the firewall rule.
Return type:

JSON

add_rules(firewall_id: @id, rules: nil)

Add rules to a firewall policy.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • rules (array) – an array of rule objects.
Return type:

JSON

remove_rule(firewall_id: @id, rule_id: nil)

Remove a firewall policy’s rule.

Parameters:
  • firewall_id (str) – the unique identifier for the firewall policy.
  • rule_id (str) – the unique identifier for the firewall rule.
Return type:

JSON

wait_for()

Polls the firewall policy until an “ACTIVE” state is returned. Use this when chaining actions.

Return type:nil