Class: Fog::VcloudDirector::Compute::Tags

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/vcloud_director/models/compute/tags.rb

Instance Method Summary collapse

Methods inherited from Collection

#_item_list, #all, #get, #get_everyone, #index, #with_item_list

Instance Method Details

#create(key, value) ⇒ Object



20
21
22
23
# File 'lib/fog/vcloud_director/models/compute/tags.rb', line 20

def create(key,value)
  response = service.(vm.id, { key => value} )
  service.process_task(response.body)
end

#get_by_id(item_id) ⇒ Object



15
16
17
18
# File 'lib/fog/vcloud_director/models/compute/tags.rb', line 15

def get_by_id(item_id)
  item_list unless @items
  @items.find{ |i| i[:id] == item_id}
end

#get_by_name(tag_name) ⇒ Object



11
12
13
# File 'lib/fog/vcloud_director/models/compute/tags.rb', line 11

def get_by_name(tag_name)
  get(tag_name)
end

#hash_itemsObject



25
26
27
28
# File 'lib/fog/vcloud_director/models/compute/tags.rb', line 25

def hash_items
  @tags = service.(vm.id).body
  @tags[:metadata]
end