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 PublicIp < Fog::Ecloud::Model
|
2012-06-07 12:50:11 -04:00
|
|
|
identity :href
|
2011-02-17 13:44:46 -05:00
|
|
|
|
|
|
|
attribute :name, :aliases => :Name
|
2012-06-07 12:50:11 -04:00
|
|
|
attribute :type, :aliases => :Type
|
|
|
|
attribute :other_links, :aliases => :Links
|
|
|
|
attribute :ip_type, :aliases => :IpType
|
2011-02-17 13:44:46 -05:00
|
|
|
|
|
|
|
def internet_services
|
2012-12-22 18:27:38 -05:00
|
|
|
@internet_services = Fog::Compute::Ecloud::InternetServices.new(:service => service, :href => href)
|
2012-06-07 12:50:11 -04:00
|
|
|
end
|
2012-11-27 19:57:16 -05:00
|
|
|
|
2012-06-07 12:50:11 -04:00
|
|
|
def environment_id
|
|
|
|
other_links[:Link].detect { |l| l[:type] == "application/vnd.tmrk.cloud.environment" }[:href].scan(/\d+/)[0]
|
|
|
|
end
|
|
|
|
|
|
|
|
def id
|
|
|
|
href.scan(/\d+/)[0]
|
2011-02-17 13:44:46 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-06-07 12:50:11 -04:00
|
|
|
end
|