Class: Fog::Vcloud::Compute::CatalogItems

Inherits:
Fog::Vcloud::Collection show all
Defined in:
lib/fog/vcloud/models/compute/catalog_items.rb

Instance Method Summary collapse

Methods inherited from Fog::Vcloud::Collection

#check_href!, #load

Instance Method Details

#allObject



11
12
13
14
15
16
17
18
# File 'lib/fog/vcloud/models/compute/catalog_items.rb', line 11

def all
  catalog_item_info = service.get_catalog_item(self.href)
  items = service.get_catalog_item(self.href).body[:CatalogItems]
  if items.size > 0
    data = items[:CatalogItem]
    load(data)
  end
end

#get(uri) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/fog/vcloud/models/compute/catalog_items.rb', line 20

def get(uri)
  if data = service.get_catalog_item(uri)
    new(data.body)
  end
rescue Fog::Errors::NotFound
  nil
end

#organization_uriObject



28
29
30
# File 'lib/fog/vcloud/models/compute/catalog_items.rb', line 28

def organization_uri
  @organization_uri ||= service.default_organization_uri
end