Sha256: 585925f267443ec8712de207a1fb78e7003dbf42c6581effdc0c5ff8f26f16e2
Contents?: true
Size: 922 Bytes
Versions: 54
Compression:
Stored size: 922 Bytes
Contents
require 'fog/core/collection' require 'fog/vcloud_director/models/compute/tag' module Fog module Compute class VcloudDirector class Tags < Collection model Fog::Compute::VcloudDirector::Tag attribute :vm def get_by_name(tag_name) get(tag_name) end def get_by_id(item_id) item_list unless @items @items.find{ |i| i[:id] == item_id} end def create(key,value) response = service.post_update_vapp_metadata(vm.id, { key => value} ) service.process_task(response.body) end def hash_items @tags = service.get_metadata(vm.id).body @tags[:metadata] end private def item_list @items =[] hash_items.each_pair{ |k,v| @items << {:id => k, :value => v }.merge(:vm => vm) } @items end end end end end
Version data entries
54 entries across 52 versions & 7 rubygems