mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
adding new models
This commit is contained in:
parent
0b7e329055
commit
25bef4f802
3 changed files with 63 additions and 0 deletions
21
lib/fog/cloudsigma/models/fwpolicies.rb
Normal file
21
lib/fog/cloudsigma/models/fwpolicies.rb
Normal 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
|
21
lib/fog/cloudsigma/models/fwpolicy.rb
Normal file
21
lib/fog/cloudsigma/models/fwpolicy.rb
Normal 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
|
21
lib/fog/cloudsigma/models/rule.rb
Normal file
21
lib/fog/cloudsigma/models/rule.rb
Normal 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue