lib/openstack/compute/server.rb
# Add a fixed ip from a specific network to the instance
#
# Returns true if the API call succeeds.
#
#   >> server.add_fixed_ip
#   => true
Add a fixed ip from a specific network to the instance
Returns true if the API call succeeds.


Add a fixed ip from a specific network to the instance Returns true if the API call succeeds .
def add_fixed_ip(network_id)
      data = JSON.generate(:addFixedIp => {
          :networkId => network_id
      })
      response = @compute.connection.csreq("POST",@svrmgmthost,"#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action",@svrmgmtport,@svrmgmtscheme,{'content-type' => 'application/json'},data)
      OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
      true
    end
def add_fixed_ip ( network_id ) data = JSON . generate ( :addFixedIp => { :networkId => network_id } ) response = @compute . connection . csreq ( "POST" , @svrmgmthost , "#{@svrmgmtpath}/servers/#{URI.encode(self.id.to_s)}/action" , @svrmgmtport , @svrmgmtscheme , { 'content-type' => 'application/json' } , data ) OpenStack :: Exception . raise_exception ( response ) unless response . code . match ( / ^20.$ / ) true end
Add a fixed ip from a specific network to the instance
Returns true if the API call succeeds.
Add a fixed ip from a specific network to the instance Returns true if the API call succeeds .
network_id