1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request from fred-secludit/cloudsigma_fwplicies

CloudSigma Firewall Policies
This commit is contained in:
Wesley Beary 2013-09-17 08:03:02 -07:00
commit 55488ec46e
5 changed files with 86 additions and 0 deletions

View file

@ -52,6 +52,11 @@ module Fog
request :get_vlan
request :update_vlan
model :rule
model :fwpolicy
collection :fwpolicies
request :list_fwpolicies
model :subscription
collection :subscriptions
request :list_subscriptions

View file

@ -0,0 +1,21 @@
require 'fog/core/collection'
require 'fog/cloudsigma/models/fwpolicy'
module Fog
module Compute
class CloudSigma
class Fwpolicies < Fog::Collection
model Fog::Compute::CloudSigma::FWPolicy
def all
resp = service.list_fwpolicies
data = resp.body['objects']
load(data)
end
end
end
end
end

View file

@ -0,0 +1,21 @@
require 'fog/cloudsigma/nested_model'
require 'fog/core/collection'
require 'fog/cloudsigma/models/rule'
module Fog
module Compute
class CloudSigma
class FWPolicy < Fog::CloudSigma::CloudsigmaModel
identity :uuid
attribute :name, :type => :string
attribute :meta
attribute :owner
attribute :resource_uri, :type => :string
attribute :servers, :type => :array
model_attribute_array :rules, Rule
end
end
end
end

View file

@ -0,0 +1,21 @@
require 'fog/cloudsigma/nested_model'
module Fog
module Compute
class CloudSigma
class Rule < Fog::CloudSigma::CloudsigmaModel
attribute :action, :type => :string
attribute :comment, :type => :string
attribute :direction, :type => :string
attribute :dst_ip, :type => :string
attribute :dst_port, :type => :integer
attribute :ip_proto, :type => :string
attribute :src_ip, :type => :string
attribute :src_port, :type => :string
end
end
end
end

View file

@ -0,0 +1,18 @@
module Fog
module Compute
class CloudSigma
class Real
def list_fwpolicies
list_request('fwpolicies/detail/')
end
end
class Mock
def list_fwpolicies
Fog::Mock.not_implemented
end
end
end
end
end