2010-10-04 17:02:08 -04:00
|
|
|
require 'fog/core/model'
|
2010-04-25 15:55:25 -04:00
|
|
|
|
|
|
|
module Fog
|
2010-05-17 23:57:13 -04:00
|
|
|
module Terremark
|
2010-04-25 15:55:25 -04:00
|
|
|
module Shared
|
|
|
|
|
|
|
|
class Vdc < Fog::Model
|
|
|
|
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :name
|
|
|
|
|
|
|
|
def networks
|
|
|
|
connection.networks(:vdc_id => @id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def addresses
|
|
|
|
connection.addresses(:vdc_id => @id)
|
|
|
|
end
|
|
|
|
|
2010-05-18 14:38:50 -04:00
|
|
|
def servers
|
|
|
|
connection.servers(:vdc_id => @id)
|
|
|
|
end
|
|
|
|
|
2010-04-25 15:55:25 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def href=(new_href)
|
|
|
|
@id = new_href.split('/').last.to_i
|
|
|
|
end
|
|
|
|
|
|
|
|
def type=(new_type); end
|
|
|
|
|
|
|
|
def rel=(new_rel); end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|