2011-08-24 21:11:42 -04:00
|
|
|
require 'fog/vcloud/models/compute/task'
|
2011-05-23 21:17:16 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Vcloud
|
|
|
|
class Compute
|
|
|
|
|
|
|
|
class Tasks < Fog::Vcloud::Collection
|
|
|
|
|
|
|
|
model Fog::Vcloud::Compute::Task
|
|
|
|
|
|
|
|
attribute :href, :aliases => :Href
|
|
|
|
|
|
|
|
def all
|
2011-05-25 20:23:49 -04:00
|
|
|
self.href = connection.default_vdc_href unless self.href
|
2011-05-23 21:17:16 -04:00
|
|
|
check_href!
|
|
|
|
if data = connection.get_task_list(href).body[:Task]
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(uri)
|
|
|
|
if data = connection.get_task(uri)
|
|
|
|
new(data.body)
|
|
|
|
end
|
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|