Class: DeltacloudVM::Client::Firewall

Inherits:
Base
  • Object
show all
Includes:
Methods::Common, Methods::Firewall
Defined in:
lib/deltacloud_vm/client/models/firewall.rb

Defined Under Namespace

Classes: Rule

Instance Attribute Summary collapse

Attributes inherited from Base

#description, #name, #obj_id, #url

Class Method Summary collapse

Methods included from Methods::Firewall

#add_firewall_rule, #create_firewall, #destroy_firewall, #firewall, #firewalls

Methods included from Methods::Common

#create_resource, #destroy_resource

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

#owner_idObject (readonly)

Custom attributes:



26
27
28
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 26

def owner_id
  @owner_id
end

#rulesObject (readonly)

Returns the value of attribute rules.



27
28
29
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 27

def rules
  @rules
end

Class Method Details

.parse(xml_body) ⇒ Object

Parse the Firewall entity from XML body

  • xml_body -> DeltacloudVM API XML representation of the firewall



33
34
35
36
37
38
39
40
# File 'lib/deltacloud_vm/client/models/firewall.rb', line 33

def self.parse(xml_body)
  {
    :owner_id => xml_body.text_at(:owner_id),
    :rules => xml_body.xpath('rules/rule').map { |rule|
      Rule.convert(self, rule)
    }
  }
end