Class: Brightbox::FirewallPolicy

Inherits:
Api
  • Object
show all
Defined in:
lib/brightbox-cli/firewall_policy.rb

Instance Attribute Summary

Attributes inherited from Api

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Api

cache_all!, cached_get, conn, #created_on, #exists?, find, find_all_or_warn, find_by_handle, find_or_call, #fog_attributes, #fog_model, #initialize, klass_name, #method_missing, #respond_to_missing?, #to_row, #to_s

Constructor Details

This class inherits a constructor from Brightbox::Api

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Brightbox::Api

Class Method Details

.allObject



13
14
15
# File 'lib/brightbox-cli/firewall_policy.rb', line 13

def self.all
  conn.firewall_policies
end

.create(options) ⇒ Object



5
6
7
# File 'lib/brightbox-cli/firewall_policy.rb', line 5

def self.create(options)
  new(conn.firewall_policies.create(options))
end

.default_field_orderObject



25
26
27
# File 'lib/brightbox-cli/firewall_policy.rb', line 25

def self.default_field_order
  %i[id server_group name]
end

.get(id) ⇒ Object



9
10
11
# File 'lib/brightbox-cli/firewall_policy.rb', line 9

def self.get(id)
  conn.firewall_policies.get(id)
end

.require_account?Boolean

Returns:

  • (Boolean)


3
# File 'lib/brightbox-cli/firewall_policy.rb', line 3

def self.require_account?; true; end

Instance Method Details

#attributesObject



17
18
19
20
21
22
23
# File 'lib/brightbox-cli/firewall_policy.rb', line 17

def attributes
  fog_attributes.tap do |attrs|
    attrs[:name] = name
    attrs[:description] = description
    attrs[:server_group] = server_group_id
  end
end