2011-09-23 11:15:01 -04:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/brightbox/models/compute/firewall_policy'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Brightbox
|
|
|
|
|
|
|
|
class FirewallPolicies < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::Compute::Brightbox::FirewallPolicy
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:29:21 -05:00
|
|
|
data = service.list_firewall_policies
|
2011-09-23 11:15:01 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
|
|
|
return nil if identifier.nil? || identifier == ""
|
2012-12-22 18:29:21 -05:00
|
|
|
data = service.get_firewall_policy(identifier)
|
2011-09-23 11:15:01 -04:00
|
|
|
new(data)
|
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2012-12-22 18:29:21 -05:00
|
|
|
end
|