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

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

Instance Method Summary collapse

Methods inherited from Collection

#all, #get, #get_everyone, #index

Instance Method Details

#create(key, value) ⇒ Object



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

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

#get_by_id(item_id) ⇒ Object



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

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

#get_by_name(tag_name) ⇒ Object



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

def get_by_name(tag_name)
  get(tag_name)
end

#hash_itemsObject



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

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