Sha256: c401a6f37d5498909dc3f2bf471c02d6ed11943b91e8db8c827082b3336052ce

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

class Nagira < Sinatra::Base
  include OutputTypeable
  #
  # Objects routes
  # ============================================================
  ##
  # @method get_objects
  #
  # Get full list of Nagios objects. Returns hash containing all
  # configured objects in Nagios: hosts, hostgroups, services,
  # contacts. etc.
  #
  # @macro accepted
  # @macro list
  #
  get "/_objects" do
    body_with_list @objects
  end

  ##
  # @method   get_object_type
  # @!macro type
  #
  # Get all objects of type :type
  #
  # @!macro accepted
  # @!macro list
  #
  #
  get "/_objects/:type" do |type|
    body_with_list @objects[type.to_sym]
  end

  ##
  # @method get_1_object
  #
  # Get single Nagios object.
  #
  # @!macro type
  # @!macro name
  #
  # @!macro accepted
  # * none
  #
  get "/_objects/:type/:name" do |type,name|
    @objects[type.to_sym][name]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nagira-0.5.2 app/routes/get/objects.rb