restapiserver

command
v0.0.0-...-a9562c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2014 License: MIT Imports: 2 Imported by: 0

README

receptor-watcher-restapiserver

restapiserver provides a http restapi to fire events.

Config

Global
{
  "watchers": {
    "restapiserver": {
      "listen": "127.0.0.1:8001"
    }
  }
}
Service
{
  "watchers": {
    "mywatcher": {
      "type": "restapiserver",
      "cfg": {
        "service": "service1"
      }
    }
  }
}

Usage

Using the above example configuration, following rest endpoint is available:

POST http://127.0.0.1:8001/service/service1 Body:

{
  "name":"Testnode",
  "type":"nodedown",
  "host":"126.0.0.2",
  "port": 80
}

Response: 200 - "OK"

Request Body Types:

  • "nodedown"
  • "nodeup"

If the request is not acceptable: Responsecode 400 - Error msg

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL