diff --git a/lib/fog/cloudsigma/models/fwpolicies.rb b/lib/fog/cloudsigma/models/fwpolicies.rb new file mode 100644 index 000000000..0ee5d89ab --- /dev/null +++ b/lib/fog/cloudsigma/models/fwpolicies.rb @@ -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 diff --git a/lib/fog/cloudsigma/models/fwpolicy.rb b/lib/fog/cloudsigma/models/fwpolicy.rb new file mode 100644 index 000000000..9d50c1f94 --- /dev/null +++ b/lib/fog/cloudsigma/models/fwpolicy.rb @@ -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 diff --git a/lib/fog/cloudsigma/models/rule.rb b/lib/fog/cloudsigma/models/rule.rb new file mode 100644 index 000000000..da910861e --- /dev/null +++ b/lib/fog/cloudsigma/models/rule.rb @@ -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 +