1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/vcloud_director/models/compute/vms.rb

29 lines
589 B
Ruby
Raw Normal View History

2013-06-24 07:46:30 -04:00
require 'fog/core/collection'
2013-08-27 05:19:54 -04:00
require 'fog/vcloud_director/models/compute/vm'
2013-06-24 07:46:30 -04:00
module Fog
module Compute
2013-08-27 05:19:54 -04:00
class VcloudDirector
2013-06-24 07:46:30 -04:00
2013-07-09 09:48:44 -04:00
class Vms < Collection
2013-08-27 05:19:54 -04:00
model Fog::Compute::VcloudDirector::Vm
2013-06-24 07:46:30 -04:00
2013-07-09 09:48:44 -04:00
attribute :vapp
2013-06-24 07:46:30 -04:00
2013-06-28 06:49:11 -04:00
private
2013-07-09 09:48:44 -04:00
def get_by_id(item_id)
item = item_list.detect{ |vm| vm[:id] == item_id}
item
end
def item_list
data = service.get_vms(vapp.id).body
items = data[:vms]
items
2013-06-24 07:46:30 -04:00
end
end
end
end
end