Sha256: 03286e5035d4350ee76b865df005d827754435f106b05e41a903b8b10633ba50

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

#
# PUT routes for host status.
#
class Nagira < Sinatra::Base

  # @method put_status
  # @overload put("/_status")
  #
  # Submit JSON Hash for multiple services,  on multiple hosts.
  put "/_status" do
    "TODO: Not implemented"
  end

  # @method put_status_host_name
  # @overload put("/_status/:host_name")
  #
  # Update hoststatus information only for the given host. URL
  # hostname always override hostname given in the JSON file.
  #
  # == Example
  #
  #        $ curl -i -H "Accept: application/json" -d @host.json -X
  #            PUT http://localhost:4567/_status/svaroh
  #
  #          => {"result": true, "object": [{"data": {"host_name":"svaroh",
  #          "status_code": "0", "plugin_output": "ping OK", "action":
  #          "PROCESS_HOST_CHECK_RESULT"}, "result":true, "messages": []}]}
  #
  # == Example JSON
  #
  #     {
  #      "status_code":"0",
  #      "plugin_output" : "ping OK"
  #     }
  put "/_status/:host_name" do
    @data = update_host_status @input.first.merge({
      'host_name' => params['host_name']
    })
    nil
  end

  # Same as /_status/:host_name (Not implemented)
  #
  # @method put__host_status_host_name
  # @overload put("/_host_status/:host_name")
  #
  put "/_host_status/:host_name" do
    "Not implemented: TODO"
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nagira-0.5.1 app/put/host.rb
nagira-0.5.0 app/put/host.rb
nagira-0.4.2 app/put/host.rb
nagira-0.4.1 app/put/host.rb