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
|
2012-04-29 22:48:06 -04:00
|
|
|
attribute :ResourceEntities
|
|
|
|
attribute :AvailableNetworks
|
|
|
|
attribute :links
|
2010-04-25 15:55:25 -04:00
|
|
|
def networks
|
2012-12-22 18:23:10 -05:00
|
|
|
service.networks(:vdc_id => id)
|
2010-04-25 15:55:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def addresses
|
2012-12-22 18:23:10 -05:00
|
|
|
service.addresses(:vdc_id => id)
|
2010-04-25 15:55:25 -04:00
|
|
|
end
|
|
|
|
|
2010-05-18 14:38:50 -04:00
|
|
|
def servers
|
2012-12-22 18:23:10 -05:00
|
|
|
service.servers(:vdc_id => id)
|
2010-05-18 14:38:50 -04:00
|
|
|
end
|
|
|
|
|
2012-04-28 13:05:06 -04:00
|
|
|
def images
|
2012-12-22 18:23:10 -05:00
|
|
|
service.images(:vdc_id => id)
|
2012-04-28 13:05:06 -04:00
|
|
|
end
|
2010-04-25 15:55:25 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def href=(new_href)
|
2010-11-19 16:45:45 -05:00
|
|
|
self.id = new_href.split('/').last.to_i
|
2010-04-25 15:55:25 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def type=(new_type); end
|
|
|
|
|
|
|
|
def rel=(new_rel); end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|