Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Move YARD macros definitions inside the class.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytro committed Dec 24, 2015
1 parent e26965a commit 4c898f8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 118 deletions.
88 changes: 44 additions & 44 deletions app/app.rb
@@ -1,52 +1,52 @@
# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#
#
#
# @!macro [new] type
# @param [String] :type Type is one of Nagios objects like hosts, hostgroupsroups, etc.
#
# @!macro [new] name
# @param [String] :name
#
# @!macro [new] hostname
# @param [String] :hostname Configured Nagios hostname
#
# @!macro [new] service_name
# @param [String] :service_name Configured Nagios service for the host
#
# @!macro [new] accepted
#
# <b>Accepted output type modifiers:</b>
#
# @!macro [new] list
#
# - +/_list+ : Short list of available objects, depending on the
# current request context: hosts, services, etc.
#
# @!macro [new] state
#
# - +/_state+ - Instead of full status information send only
# current state. For hosts up/down, for services OK, Warn,
# Critical, Unknown (0,1,2-1)
#
# @!macro [new] full
#
# - +/_full+ - Show full status information. When used in
# /_status/_full call will display full hoststaus and
# servicestatus information for each host.
#
#
require_relative '../lib/nagira'
##
# Main class of Nagira application implementing RESTful API for
# Nagios.
#
class Nagira < Sinatra::Base

include OutputTypeable
# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#
#
#
# @!macro [new] type
# @param [String] :type Type is one of Nagios objects like hosts, hostgroupsroups, etc.
#
# @!macro [new] name
# @param [String] :name
#
# @!macro [new] hostname
# @param [String] :hostname Configured Nagios hostname
#
# @!macro [new] service_name
# @param [String] :service_name Configured Nagios service for the host
#
# @!macro [new] accepted
#
# <b>Accepted output type modifiers:</b>
#
# @!macro [new] list
#
# - +/_list+ : Short list of available objects, depending on the
# current request context: hosts, services, etc.
#
# @!macro [new] state
#
# - +/_state+ - Instead of full status information send only
# current state. For hosts up/down, for services OK, Warn,
# Critical, Unknown (0,1,2-1)
#
# @!macro [new] full
#
# - +/_full+ - Show full status information. When used in
# /_status/_full call will display full hoststaus and
# servicestatus information for each host.
#
#

end
12 changes: 0 additions & 12 deletions app/get/config.rb
@@ -1,17 +1,5 @@
class Nagira < Sinatra::Base

# Config routes
# ============================================================

# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#
#

# @method get_config
# @overload get("/_config")
#
Expand Down
46 changes: 0 additions & 46 deletions app/get/status.rb
Expand Up @@ -2,52 +2,6 @@
require_relative 'status/servicegroups'

class Nagira < Sinatra::Base
# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#
#
#
# @!macro [new] type
# @param [String] :type Type is one of Nagios objects like hosts, hostgroupsroups, etc.
#
# @!macro [new] name
# @param [String] :name
#
# @!macro [new] hostname
# @param [String] :hostname Configured Nagios hostname
#
# @!macro [new] service_name
# @param [String] :service_name Configured Nagios service for the host
#
# @!macro [new] accepted
#
# <b>Accepted output type modifiers:</b>
#
# @!macro [new] list
#
# - +/_list+ : Short list of available objects, depending on the
# current request context: hosts, services, etc.
#
# @!macro [new] state
#
# - +/_state+ - Instead of full status information send only
# current state. For hosts up/down, for services OK, Warn,
# Critical, Unknown (0,1,2-1)
#
# @!macro [new] full
#
# - +/_full+ - Show full status information. When used in
# /_status/_full call will display full hoststaus and
# servicestatus information for each host.
#
#

# Status routes
# ============================================================

##
# @method get_status_hostname_services_service_name
Expand Down
8 changes: 0 additions & 8 deletions app/get/status/hostgroups.rb
@@ -1,12 +1,4 @@
class Nagira < Sinatra::Base
# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#


##
# @method get_status_hostgroup
Expand Down
8 changes: 0 additions & 8 deletions app/get/status/servicegroups.rb
@@ -1,12 +1,4 @@
class Nagira < Sinatra::Base
# @!macro [attach] sinatra.get
#
# @overload get "$1"
#
# @return HTTP response. Hash formatted in the format defined by
# requested output type(XML, YAML or JSON).
#


##
# @method get_status_servicegroup
Expand Down

0 comments on commit 4c898f8

Please sign in to comment.