2011-08-24 21:29:14 -04:00
|
|
|
require 'fog/ecloud/models/compute/task'
|
2011-02-17 13:44:46 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Ecloud
|
2011-02-17 13:44:46 -05:00
|
|
|
|
|
|
|
class Tasks < Fog::Ecloud::Collection
|
|
|
|
|
2011-06-16 19:28:54 -04:00
|
|
|
model Fog::Compute::Ecloud::Task
|
2011-02-17 13:44:46 -05:00
|
|
|
|
|
|
|
attribute :href, :aliases => :Href
|
|
|
|
|
|
|
|
def all
|
|
|
|
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
|