Sha256: dcb841b3fd041115c5a8b045df369c20112f507a0b006bcab36b25061e04292b
Contents?: true
Size: 944 Bytes
Versions: 39
Compression:
Stored size: 944 Bytes
Contents
require 'fog/core/collection' require 'fog/vcloud_director/models/compute/catalog_item' module Fog module Compute class VcloudDirector class CatalogItems < Collection model Fog::Compute::VcloudDirector::CatalogItem attribute :catalog private def item_list data = service.get_catalog(catalog.id).body items = data[:CatalogItems][:CatalogItem].select do |link| link[:type] == 'application/vnd.vmware.vcloud.catalogItem+xml' end items.each {|item| service.add_id_from_href!(item)} items end def get_by_id(item_id) item = service.get_catalog_item(item_id).body item[:vapp_template_id] = item[:Entity][:href].split('/').last %w(:Link :Entity).each {|key_to_delete| item.delete(key_to_delete) } service.add_id_from_href!(item) item end end end end end
Version data entries
39 entries across 39 versions & 2 rubygems