mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
adding metadata support for vapp too
This commit is contained in:
parent
b9159ed569
commit
30adc65597
7 changed files with 15 additions and 9 deletions
|
@ -95,10 +95,10 @@ module Fog
|
|||
request :put_vm_disks
|
||||
request :get_vm_network
|
||||
request :put_vm_network
|
||||
request :get_vm_metadata
|
||||
request :get_metadata
|
||||
request :post_vm_metadata
|
||||
request :put_vm_metadata_value
|
||||
request :delete_vm_metadata
|
||||
request :put_metadata_value
|
||||
request :delete_metadata
|
||||
request :post_vm_poweron
|
||||
request :get_request
|
||||
request :get_href
|
||||
|
|
|
@ -15,14 +15,14 @@ module Fog
|
|||
not_first_set = !value.nil?
|
||||
attributes[:value] = new_value
|
||||
if not_first_set && has_changed
|
||||
response = service.put_vm_metadata_value(vm.id, id, value)
|
||||
response = service.put_metadata_value(vm.id, id, value)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
response = service.delete_vm_metadata(vm.id, id)
|
||||
response = service.delete_metadata(vm.id, id)
|
||||
service.process_task(response.body)
|
||||
end
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ module Fog
|
|||
# private
|
||||
|
||||
def item_list
|
||||
@tags = service.get_vm_metadata(vm.id).body
|
||||
@tags = service.get_metadata(vm.id).body
|
||||
@items =[]
|
||||
@tags[:metadata].each_pair{ |k,v| @items << {:id => k, :value => v }.merge(:vm => vm) }
|
||||
@items
|
||||
|
|
|
@ -26,6 +26,12 @@ module Fog
|
|||
service.vms(:vapp => self)
|
||||
end
|
||||
|
||||
def tags
|
||||
requires :id
|
||||
service.tags(:vm => self)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
class Vcloudng
|
||||
class Real
|
||||
|
||||
def delete_vm_metadata(vm_id, metadata_key)
|
||||
def delete_metadata(vm_id, metadata_key)
|
||||
require 'fog/vcloudng/parsers/compute/metadata'
|
||||
|
||||
request(
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
class Vcloudng
|
||||
class Real
|
||||
|
||||
def get_vm_metadata(vm_id)
|
||||
def get_metadata(vm_id)
|
||||
require 'fog/vcloudng/parsers/compute/metadata'
|
||||
|
||||
request(
|
|
@ -3,7 +3,7 @@ module Fog
|
|||
class Vcloudng
|
||||
class Real
|
||||
|
||||
def put_vm_metadata_value(vm_id, metadata_key, metadata_value)
|
||||
def put_metadata_value(vm_id, metadata_key, metadata_value)
|
||||
body="
|
||||
<MetadataValue xmlns=\"http://www.vmware.com/vcloud/v1.5\">
|
||||
<Value>#{metadata_value}</Value>
|
Loading…
Add table
Reference in a new issue