2010-10-08 20:42:25 +08:00
|
|
|
require 'fog/vcloud/terremark/ecloud/models/node'
|
2010-09-14 10:40:02 -07:00
|
|
|
|
2010-06-18 07:58:09 +08:00
|
|
|
module Fog
|
2010-09-03 01:11:45 -07:00
|
|
|
class Vcloud
|
2010-06-18 07:58:09 +08:00
|
|
|
module Terremark
|
2010-09-14 10:40:02 -07:00
|
|
|
class Ecloud
|
2010-06-18 07:58:09 +08:00
|
|
|
|
|
|
|
class Nodes < Fog::Vcloud::Collection
|
|
|
|
|
|
|
|
model Fog::Vcloud::Terremark::Ecloud::Node
|
|
|
|
|
|
|
|
attribute :href, :aliases => :Href
|
|
|
|
|
|
|
|
def all
|
2010-10-18 07:06:44 +08:00
|
|
|
check_href!( :messages => "the Nodes href of the Internet Service you want to enumerate" )
|
2010-06-18 07:58:09 +08:00
|
|
|
if data = connection.get_nodes(href).body[:NodeService]
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(uri)
|
|
|
|
if data = connection.get_node(uri)
|
|
|
|
new(data.body)
|
|
|
|
end
|
|
|
|
rescue Fog::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|