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)
|
2012-01-30 09:24:14 -05:00
|
|
|
connection.get_task(uri)
|
2011-05-23 21:17:16 -04:00
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|