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/tasks.rb
Nick Osborn dc2006769b [vcloud_director] Request method renaming.
This renames most request methods in line with page names in the vCloud
API documentation. Previous method names remain as deprecations.
2013-10-01 08:43:28 +01:00

31 lines
674 B
Ruby

require 'fog/core/collection'
require 'fog/vcloud_director/models/compute/task'
module Fog
module Compute
class VcloudDirector
class Tasks < Collection
model Fog::Compute::VcloudDirector::Task
attribute :organization
def get(id)
data = service.get_task(id).body
return nil unless data
data[:id] = data[:href].split('/').last
new(data)
end
private
def item_list
data = service.get_task_list(organization.id).body
tasks = ensure_list(data[:Task])
tasks.each {|task| service.add_id_from_href!(task)}
end
end
end
end
end