Skip to content

Latest commit

 

History

History
472 lines (292 loc) · 10.9 KB

README.md

File metadata and controls

472 lines (292 loc) · 10.9 KB

Table of Contents

  1. Cluster State
  2. Fetch event data (optionally filtered by one or more event types)
  3. Monitor Configuration
  4. Fetch check state data including latest check status, ownership, last check timestamp;

cluster

Specification Value
Resource Path /cluster
API Version
BasePath for the API {{.}}
Consumes
Produces

Operations

Resource Path Operation Description
/cluster [GET](#Fetch Cluster Stats) Fetches cluster state data (membership, current director, heartbeats)

API: /cluster (GET)

Fetches cluster state data (membership, current director, heartbeats)

Code Type Model Message
200 object ClusterStats
500 object JSONStatus

Models

RawMessage

Field Name (alphabetical) Field Type Description

ClusterStats

Field Name (alphabetical) Field Type Description
Director encoding.json.RawMessage
Members array

JSONStatus

Field Name (alphabetical) Field Type Description
message string
status string

event

Specification Value
Resource Path /event
API Version
BasePath for the API {{.}}
Consumes application/json
Produces

Operations

Resource Path Operation Description
/event [GET](#Fetch Events) Fetch event data (optionally filtered by one or more event types)

API: /event (GET)

Fetch event data (optionally filtered by one or more event types)

Param Name Param Type Data Type Description Required?
type query string comma separated event types
Code Type Model Message
200 array Event
500 object JSONStatus

Models

Event

Field Name (alphabetical) Field Type Description
memberid string
message string
timestamp Time
type string

JSONStatus

Field Name (alphabetical) Field Type Description
message string
status string

monitor

Specification Value
Resource Path /monitor
API Version
BasePath for the API {{.}}
Consumes application/json
Produces

Operations

Resource Path Operation Description
/monitor [POST](#Add Monitor Configuration) Add/Update monitor config
/monitor/{check} [GET](#Fetch Monitor Configuration) Fetch all (or specific) monitor configuration(s) from etcd
/monitor/{check} [GET](#Set Disabled State for Given Monitor) Enable or disable a specific monitor configuration (changes are immediate)
/monitor/{check} [DELETE](#Delete existing monitor configuration) Delete monitor config

API: /monitor (POST)

Add/Update monitor config

Param Name Param Type Data Type Description Required?
N/A POST object (map[string]MonitorConfig) Collection of monitors to add Yes

Example payload:

{
	"exec-check1": {
		  "type": "exec",
		  "description": "exec check test",
		  "timeout": "5s",
		  "command": "echo",
		  "args": [
		    "hello",
		    "world"
		  ],
		  "interval": "10s",
		  "return-code": 0,
		  "expect": "world",
		  "warning-threshold": 1,
		  "critical-threshold": 3,
		  "warning-alerter": [
		    "primary-slack"
		  ],
		  "critical-alerter": [
		    "primary-email"
		  ],
		  "tags": [
		    "dbservers",
		    "mysql"
		]
	}
}
Code Type Model Message
200 array JSONStatus
400 object JSONStatus
500 object JSONStatus

API: /monitor/{check} (GET)

Fetch all (or specific) monitor configuration(s) from etcd

Param Name Param Type Data Type Description Required?
check path string Specific check name
Code Type Model Message
200 array fullMonitorConfig
500 object JSONStatus

API: /monitor/{check} (GET)

Enable or disable a specific monitor configuration (changes are immediate)

Param Name Param Type Data Type Description Required?
check path string Specific check name Yes
disable query string Disable/enable a check
Code Type Model Message
200 array JSONStatus
500 object JSONStatus

API: /monitor/{check} (DELETE)

Delete existing monitor config

Param Name Param Type Data Type Description Required?
check path string Specific check name Yes
Code Type Model Message
200 array JSONStatus
404 object JSONStatus
500 object JSONStatus

Models

fullMonitorConfig

Field Name (alphabetical) Field Type Description

JSONStatus

Field Name (alphabetical) Field Type Description
message string
status string

alerter

Specification Value
Resource Path /alerter
API Version
BasePath for the API {{.}}
Consumes application/json
Produces

Operations

Resource Path Operation Description
/alerter [POST](#Add Alerter Configuration) Add/Update alerter config
/alerter/{alerterName} [GET](#Fetch Alerter Configuration) Fetch all (or specific) alerter configuration(s) from etcd
/alerter/{alerterName} [DELETE](#Delete existing alerter configuration) Delete alerter config

API: /alerter (POST)

Add/Update alerter config

Param Name Param Type Data Type Description Required?
N/A POST object (map[string]AlerterConfig) Collection of alerters to add Yes

Example payload:

{
	"test-alerter": {
		"type": "slack",
		"description": "foobar",
		"options": {
			"channel": "some-team",
			"icon-url": "https://pbs.twimg.com/profile_images/593893225045200896/r9uL4jWU.png",
			"token": "asdfasdfasdfasdfasdf",
			"username": "monit"
		}
	}
}
Code Type Model Message
200 array JSONStatus
400 object JSONStatus
500 object JSONStatus

API: /alerter/{alerterName} (GET)

Fetch all (or specific) alerter configuration(s) from etcd

Param Name Param Type Data Type Description Required?
alerterName path string Specific alerter name
Code Type Model Message
200 array fullAlerterConfig
500 object JSONStatus

API: /alerter/{alerterName} (DELETE)

Delete existing alerter config

Param Name Param Type Data Type Description Required?
alerterName path string Specific check name Yes
Code Type Model Message
200 array JSONStatus
404 object JSONStatus
500 object JSONStatus

Models

fullAlerterConfig

Field Name (alphabetical) Field Type Description

state

Specification Value
Resource Path /state
API Version
BasePath for the API {{.}}
Consumes application/json
Produces

Operations

Resource Path Operation Description
/state [GET](#Fetch Check State Data) Fetch check state data including latest check status, ownership, last check timestamp;

API: /state (GET)

Fetch check state data including latest check status, ownership, last check timestamp;

Param Name Param Type Data Type Description Required?
tags query string One or more tags (comma separated)
Code Type Model Message
200 array Message
500 object JSONStatus

Models

RawMessage

Field Name (alphabetical) Field Type Description

Message

Field Name (alphabetical) Field Type Description
check string
config encoding.json.RawMessage
count int
date Time
message string
owner string
status string

JSONStatus

Field Name (alphabetical) Field Type Description
message string
status string