Class: VCloudSdk::Xml::Disk

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

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute_with_ns, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #error, #get_nodes, #href, #href_id, #initialize, #name, #to_s, #type, #urn, #xpath

Constructor Details

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

Instance Method Details

#bus_sub_type=(value) ⇒ Object



9
10
11
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 9

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

#bus_type=(value) ⇒ Object



5
6
7
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 5

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

#name=(name) ⇒ Object



19
20
21
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 19

def name=(name)
  @root["name"] = name.to_s
end

#prerunning_tasksObject



27
28
29
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 27

def prerunning_tasks
  tasks.find_all { |t| PRE_RUNNING_TASK_STATUSES.include?(t.status) }
end


13
14
15
16
17
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 13

def remove_link(force = false)
  link = get_nodes("Link", {"rel" => "remove"}, true).first
  return link unless force
  fix_if_invalid(link, "remove", MEDIA_TYPE[:DISK], "#{href}")
end

#running_tasksObject



31
32
33
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 31

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

#size_mbObject



23
24
25
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 23

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

#tasksObject



35
36
37
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk.rb', line 35

def tasks
  get_nodes("Task")
end