Class: VCloudSdk::Xml::Disk

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #edit_link, #get_nodes, #href, #href=, #href_id, #initialize, #name, #name=, #power_off_link, #power_on_link, #remove_link, #to_s, #type, #type=, #undeploy_link, #urn, #xpath

Constructor Details

This class inherits a constructor from VCloudSdk::Xml::Wrapper

Instance Method Details

#bus_sub_typeObject



12
13
14
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 12

def bus_sub_type
  @root["busSubType"]
end

#bus_sub_type=(value) ⇒ Object



16
17
18
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 16

def bus_sub_type=(value)
  @root["busSubType"] = value.to_s
end

#bus_typeObject



4
5
6
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 4

def bus_type
  @root["busType"]
end

#bus_type=(value) ⇒ Object



8
9
10
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 8

def bus_type=(value)
  @root["busType"] = value.to_s
end

#capacityObject



20
21
22
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 20

def capacity
  @root["size"].to_i / 1024 / 1024
end

#running_tasksObject



24
25
26
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 24

def running_tasks
  tasks.select { |t| RUNNING.include?(t.status) }
end

#statusObject



32
33
34
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 32

def status
  @root["status"]
end

#tasksObject



28
29
30
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 28

def tasks
  get_nodes(XML_TYPE[:TASK])
end


36
37
38
39
40
41
# File 'lib/ruby_vcloud_sdk/xml/wrapper_classes/disk.rb', line 36

def vms_link
  get_nodes(XML_TYPE[:LINK],
            { type: MEDIA_TYPE[:VMS] },
            true)
           .first
end