Sha256: ceb4adcc9dec0b5708030e3b5704f2af696bcefb51864530e5b4ef9294309e7f
Contents?: true
Size: 943 Bytes
Versions: 46
Compression:
Stored size: 943 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
46 entries across 44 versions & 7 rubygems