Class: DeltacloudVM::Client::Firewall::Rule

Inherits:
Base
  • Object
show all
Defined in:
lib/deltacloud_vm/client/models/firewall.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #name, #obj_id, #url

Class Method Summary collapse

Methods inherited from Base

#client, #connection, convert, #entrypoint, from_collection, #id, #initialize, #original_body, #to_s, #update_instance_variables!, validate_attrs!

Methods included from Helpers::XmlHelper

#extract_xml_body

Methods included from Methods::Api

#api_uri, #current_driver, #current_provider, #feature?, #features, #must_support!, #path, #support?, #supported_collections, #version

Methods included from Helpers::Model

#error, #from_collection, #from_resource, #model

Constructor Details

This class inherits a constructor from DeltacloudVM::Client::Base

Instance Attribute Details

#allow_protocolObject (readonly)

Returns the value of attribute allow_protocol.



44
45
46
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 44

def allow_protocol
  @allow_protocol
end

#directionObject (readonly)

Returns the value of attribute direction.



47
48
49
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 47

def direction
  @direction
end

#port_fromObject (readonly)

Returns the value of attribute port_from.



45
46
47
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 45

def port_from
  @port_from
end

#port_toObject (readonly)

Returns the value of attribute port_to.



46
47
48
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 46

def port_to
  @port_to
end

#sourcesObject (readonly)

Returns the value of attribute sources.



48
49
50
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 48

def sources
  @sources
end

Class Method Details

.parse(xml_body) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 50

def self.parse(xml_body)
  {
   :allow_protocol => xml_body.text_at(:allow_protocol),
   :port_from => xml_body.text_at(:port_from),
   :port_to => xml_body.text_at(:port_to),
   :direction => xml_body.text_at(:direction),
   :sources => xml_body.xpath('sources/source').map { |s|
     { :name => s['name'], :owner => s['owner'], :type => s['type'] }
   }
  }
end