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 Network < Fog::Ecloud::Model
|
|
|
|
identity :href
|
|
|
|
|
|
|
|
attribute :name, :aliases => :Name
|
2012-06-07 12:50:11 -04:00
|
|
|
attribute :type, :aliases => :Type
|
|
|
|
attribute :other_links, :aliases => :Links
|
2011-02-17 13:44:46 -05:00
|
|
|
attribute :address, :aliases => :Address
|
|
|
|
attribute :network_type, :aliases => :NetworkType
|
2012-06-07 12:50:11 -04:00
|
|
|
attribute :broadcast_address, :aliases => :BroadcastAddress
|
|
|
|
attribute :gateway_address, :aliases => :GatewayAddress
|
|
|
|
attribute :rnat_address, :aliases => :RnatAddress
|
2011-02-17 13:44:46 -05:00
|
|
|
|
2012-06-07 12:50:11 -04:00
|
|
|
def rnats
|
|
|
|
@rnats ||= Fog::Compute::Ecloud::Rnats.new(:connection => connection, :href => "cloudapi/ecloud/rnats/networks/#{id}")
|
2011-02-17 13:44:46 -05:00
|
|
|
end
|
|
|
|
|
2012-06-07 12:50:11 -04:00
|
|
|
def ips
|
|
|
|
@ips ||= Fog::Compute::Ecloud::IpAddresses.new(:connection => connection, :href => href)
|
2011-02-17 13:44:46 -05:00
|
|
|
end
|
|
|
|
|
2012-06-07 12:50:11 -04:00
|
|
|
def edit_rnat_association(options)
|
|
|
|
options[:uri] = href
|
|
|
|
data = connection.rnat_associations_edit_network(options).body
|
|
|
|
task = Fog::Compute::Ecloud::Tasks.new(:connection => connection, :href => data[:href])[0]
|
2011-02-17 13:44:46 -05:00
|
|
|
end
|
2012-06-07 12:50:11 -04:00
|
|
|
|
|
|
|
def id
|
|
|
|
href.scan(/\d+/)[0]
|
2011-02-17 13:44:46 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|