AppController/djinn.rb
# Informs the AppDashboard that the named AppServer is no longer running, so
# that it no longer displays that AppServer in its instance information.
#
# Args:
#   appid: A String that names the application whose AppServer was removed.
#   location: A String that identifies the host and port that the AppServer
#     was removed off of.
Informs the AppDashboard that the named AppServer is no longer running, so
that it no longer displays that AppServer in its instance information.

A String that names the application whose AppServer was removed.
location: A String that identifies the host and port that the AppServer
was removed off of.
Informs the AppDashboard that the named AppServer is no longer running so that it no longer displays that AppServer in its instance information . A String that names the application whose AppServer was removed . location : A String that identifies the host and port that the AppServer was removed off of .
def delete_instance_from_dashboard(appid, location)
    begin
      host, port = location.split(":")
      instance_info = [{
        'appid' => appid,
        'host' => host,
        'port' => Integer(port)
      }]
      url = URI.parse("https://#{get_load_balancer_ip()}:" +
        "#{AppDashboard::LISTEN_SSL_PORT}/apps/stats/instances")
      http = Net::HTTP.new(url.host, url.port)
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      request = Net::HTTP::Delete.new(url.path)
      request.body = JSON.dump(instance_info)
      response = http.request(request)
      Djinn.log_debug("Sent delete_instance to AppDashboard. Info is: " +
        "#{instance_info.inspect}. Response is: #{response.body}.")
    rescue => exception
      Djinn.log_warn("Couldn't delete instance info to AppDashboard because" +
        " of a #{exception.class} exception.")
    end
  end
def delete_instance_from_dashboard ( appid , location ) begin host , port = location . split ( ":" ) instance_info = [ { 'appid' => appid , 'host' => host , 'port' => Integer ( port ) } ] url = URI . parse ( "https://#{get_load_balancer_ip()}:" + "#{AppDashboard::LISTEN_SSL_PORT}/apps/stats/instances" ) http = Net :: HTTP . new ( url . host , url . port ) http . use_ssl = true http . verify_mode = OpenSSL :: SSL :: VERIFY_NONE request = Net :: HTTP :: Delete . new ( url . path ) request . body = JSON . dump ( instance_info ) response = http . request ( request ) Djinn . log_debug ( "Sent delete_instance to AppDashboard. Info is: " + "#{instance_info.inspect}. Response is: #{response.body}." ) rescue => exception Djinn . log_warn ( "Couldn't delete instance info to AppDashboard because" + " of a #{exception.class} exception." ) end end
Informs the AppDashboard that the named AppServer is no longer running, so
that it no longer displays that AppServer in its instance information.
Informs the AppDashboard that the named AppServer is no longer running so that it no longer displays that AppServer in its instance information .
# Don't crash the AppController because we weren't able to send over # the instance info - just continue on.
appid
<not_specific>
location
<not_specific>