Class: Deltacloud::Client::Firewall::Rule
- Defined in:
- lib/deltacloud/client/models/firewall.rb
Instance Attribute Summary collapse
-
#allow_protocol ⇒ Object
readonly
Returns the value of attribute allow_protocol.
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#port_from ⇒ Object
readonly
Returns the value of attribute port_from.
-
#port_to ⇒ Object
readonly
Returns the value of attribute port_to.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
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
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 Deltacloud::Client::Base
Instance Attribute Details
#allow_protocol ⇒ Object (readonly)
Returns the value of attribute allow_protocol.
44 45 46 |
# File 'lib/deltacloud/client/models/firewall.rb', line 44 def allow_protocol @allow_protocol end |
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
47 48 49 |
# File 'lib/deltacloud/client/models/firewall.rb', line 47 def direction @direction end |
#port_from ⇒ Object (readonly)
Returns the value of attribute port_from.
45 46 47 |
# File 'lib/deltacloud/client/models/firewall.rb', line 45 def port_from @port_from end |
#port_to ⇒ Object (readonly)
Returns the value of attribute port_to.
46 47 48 |
# File 'lib/deltacloud/client/models/firewall.rb', line 46 def port_to @port_to end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
48 49 50 |
# File 'lib/deltacloud/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/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 |