Class: VCloudSdk::Xml::AdminCatalog

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.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, #name=, #to_s, #type, #urn, #xpath

Constructor Details

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

Instance Method Details



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

def add_item_link
  get_nodes("Link", {"type"=>ADMIN_MEDIA_TYPE[:CATALOG_ITEM],
    "rel"=>"add"}).first
end

#catalog_items(name = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.rb', line 10

def catalog_items(name = nil)
  if name
    get_nodes("CatalogItem", {"name" => name})
  else
    get_nodes("CatalogItem")
  end
end

#prerunning_tasksObject



18
19
20
# File 'lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.rb', line 18

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

#running_tasksObject



22
23
24
# File 'lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.rb', line 22

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

#tasksObject



26
27
28
# File 'lib/cloud/vcloud/xml/wrapper_classes/admin_catalog.rb', line 26

def tasks
  get_nodes("Task")
end