FEATURES

Routes for configured objects in the system

Namespace for object configuration starts from "/_objects". Route may be appended by /_list to get short list of objects or object classes.

All routes can be followed by format specifier: .xml, .yaml, .json. When format specifier is omitted, default format output is used (configurable).

Following routes are implemented (all GET):

Routes to get service status information

Every route can optionally end with /_list or /_state and format specifier \.(xml|json|yaml)

Hosts

Services

Examples

Application summary

curl http://localhost:4567/
{"application":"Nagira",
 "version":"0.2.0",
 "source":"http://dmytro.github.com/nagira/",
 "apiUrl":"http://localhost:4567/_api"}

See API information

This command will print list of all implemented API endpoints. Note: this list is shortened for readability.

Nagios server configuration

This will retrive full configuration of Nagios process.

Same as above this is shortened list.

Status information: hosts and services

    curl http://localhost:4567/_status

    curl http://localhost:4567/_status/viy/_state

    curl http://localhost:4567/_status/viy/_services/_list
    curl http://localhost:4567/_status/viy/_services/list.json

    curl http://localhost:4567/_status/viy/_services/state
    curl http://localhost:4567/_status/viy/_services/state.yaml

    curl http://localhost:4567/_status/viy/_services/SSH
    curl http://localhost:4567/_status/viy/_services/SSH/state.yaml

Objects configuration

    curl   http://localhost:4567/_objects/command
    curl   http://localhost:4567/_objects/command/_list
    curl   http://localhost:4567/_objects/command.json

    curl   http://localhost:4567/_objects/command/traffic-average
    curl   http://localhost:4567/_objects/command/traffic_average.yaml

    curl   http://localhost:4567/_objects/contact
    curl   http://localhost:4567/_objects/contact/_list
    curl   http://localhost:4567/_objects/contact/_list.yaml

    curl   http://localhost:4567/_objects/host/_list.yaml
    curl   http://localhost:4567/_objects/host/viy

More examples

Some examples are included with the distribution in the ./test/data/json directory. This directory have examples of JSON files for HTTP PUT's and sample curl script to be used with JSON files. See also README.txt file in this directory.