Parent

Class/Module Index [+]

Quicksearch

Fog::Compute::Brightbox::FirewallPolicy

Public Instance Methods

apply_to(server_group_id) click to toggle source
# File lib/fog/brightbox/models/compute/firewall_policy.rb, line 35
def apply_to(server_group_id)
  requires :identity
  options = {
    :server_group => server_group_id
  }
  data = service.apply_to_firewall_policy(identity, options)
  merge_attributes(data)
  true
end
destroy() click to toggle source
# File lib/fog/brightbox/models/compute/firewall_policy.rb, line 55
def destroy
  requires :identity
  data = service.destroy_firewall_policy(identity)
  true
end
remove(server_group_id) click to toggle source
# File lib/fog/brightbox/models/compute/firewall_policy.rb, line 45
def remove(server_group_id)
  requires :identity
  options = {
    :server_group => server_group_id
  }
  data = service.remove_firewall_policy(identity, options)
  merge_attributes(data)
  true
end
save() click to toggle source

Sticking with existing Fog behaviour, save does not update but creates a new resource

# File lib/fog/brightbox/models/compute/firewall_policy.rb, line 23
def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  options = {
    :server_group => server_group_id,
    :name => name,
    :description => description
  }.delete_if {|k,v| v.nil? || v == "" }
  data = service.create_firewall_policy(options)
  merge_attributes(data)
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.