Acknowledgements
POST /acknowledgements
# required:
# optional: duration, id, summary
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "acknowledgement",
"id": "15086921-2d21-4efa-834b-15a9cd846f09",
"duration": "1200",
"summary": "Fixing manually"
}, {
"type": "acknowledgement",
"id": "9c5cad20-3fa8-4dec-97d1-405c9e1eb66d",
"duration": "3000",
"summary": "Power return expected"
}
]
}' \
http://localhost:3081/acknowledgements
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required:
# optional: duration, id, summary
Flapjack::Diner.create_acknowledgements({
:id => '15086921-2d21-4efa-834b-15a9cd846f09',
:duration => 1200,
:summary => 'Fixing manually'
}, {
:id => '9c5cad20-3fa8-4dec-97d1-405c9e1eb66d',
:duration => 3000,
:summary => 'Power return expected'
})
Description
Acknowledge a check, or acknowledge all checks linked to a tag.
Parameters
{
"data": {
"duration": 1,
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
}
},
"tag": {
"data": {
"id": "<String(uuid)>",
"type": "tag"
}
}
},
"summary": "<String>",
"type": "acknowledgement"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
acknowledgement to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"duration": 1,
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tag": {
"data": {
"id": "<String(uuid)>",
"type": "tag"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"summary": "<String>",
"type": "acknowledgement"
},
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
acknowledgement creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
Checks
POST /checks
# required: enabled, initial_failure_delay, name, repeat_failure_delay
# optional: id
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "check",
"id": "2937ba38-c26b-4ffc-9db1-6a6fb353d7bb",
"enabled": true,
"initial_failure_delay": 1,
"name": "www.example.com:PING",
"repeat_failure_delay": 1
}, {
"type": "check",
"id": "30324f99-8fd6-4116-b00d-09078f9b6540",
"enabled": true,
"initial_failure_delay": 1,
"name": "www.example.com:SSH",
"repeat_failure_delay": 1
}
]
}' \
http://localhost:3081/checks
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: enabled, initial_failure_delay, name, repeat_failure_delay
# optional: id
Flapjack::Diner.create_checks({
:id => '2937ba38-c26b-4ffc-9db1-6a6fb353d7bb',
:enabled => true,
:initial_failure_delay => 1,
:name => 'www.example.com:PING',
:repeat_failure_delay => 1
}, {
:id => '30324f99-8fd6-4116-b00d-09078f9b6540',
:enabled => true,
:initial_failure_delay => 1,
:name => 'www.example.com:SSH',
:repeat_failure_delay => 1
})
Description
Create a check.
Parameters
{
"data": {
"enabled": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"repeat_failure_delay": 1,
"type": "check"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
check to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"ack_hash": "<String>",
"condition": "<ok|critical|warning|unknown>",
"enabled": true,
"failing": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"alerting_media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_state": {
"data": {
"id": "<String(uuid)>",
"type": "state"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_unscheduled_maintenance": {
"data": {
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"latest_notifications": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"repeat_failure_delay": 1,
"type": "check"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
check creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/checks/2937ba38-c26b-4ffc-9db1-6a6fb353d7bb
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.checks(
:filter => {:id => '2937ba38-c26b-4ffc-9db1-6a6fb353d7bb'}
)
Description
Returns data for a check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"ack_hash": "<String>",
"condition": "<ok|critical|warning|unknown>",
"enabled": true,
"failing": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"alerting_media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_state": {
"data": {
"id": "<String(uuid)>",
"type": "state"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_unscheduled_maintenance": {
"data": {
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"latest_notifications": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"repeat_failure_delay": 1,
"type": "check"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET check response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/checks
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.checks(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns data for multiple check records.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of checks per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"ack_hash": "<String>",
"condition": "<ok|critical|warning|unknown>",
"enabled": true,
"failing": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"alerting_media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_state": {
"data": {
"id": "<String(uuid)>",
"type": "state"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"current_unscheduled_maintenance": {
"data": {
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"latest_notifications": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"repeat_failure_delay": 1,
"type": "check"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET checks success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
PATCH /checks/{check_id}
# required: id
# optional: enabled, initial_failure_delay, name, repeat_failure_delay
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "check",
"id": "2937ba38-c26b-4ffc-9db1-6a6fb353d7bb",
"enabled": true,
"initial_failure_delay": 1,
"name": "www.example.com:PING",
"repeat_failure_delay": 1
}
]
}' \
http://localhost:3081/checks/2937ba38-c26b-4ffc-9db1-6a6fb353d7bb
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: enabled, initial_failure_delay, name, repeat_failure_delay
Flapjack::Diner.update_checks(
:id => '2937ba38-c26b-4ffc-9db1-6a6fb353d7bb',
:enabled => true,
:initial_failure_delay => 1,
:name => 'www.example.com:PING',
:repeat_failure_delay => 1
)
Description
Update a check.
Parameters
{
"data": {
"enabled": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"repeat_failure_delay": 1,
"type": "check"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
uuid
|
data |
body |
|
yes |
Check to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Check update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
PATCH /checks
# required: id
# optional: enabled, initial_failure_delay, name, repeat_failure_delay
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "check",
"id": "2937ba38-c26b-4ffc-9db1-6a6fb353d7bb",
"enabled": true,
"initial_failure_delay": 1,
"name": "www.example.com:PING",
"repeat_failure_delay": 1
}, {
"type": "check",
"id": "30324f99-8fd6-4116-b00d-09078f9b6540",
"enabled": true,
"initial_failure_delay": 1,
"name": "www.example.com:SSH",
"repeat_failure_delay": 1
}
]
}' \
http://localhost:3081/checks
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: enabled, initial_failure_delay, name, repeat_failure_delay
Flapjack::Diner.update_checks({
:id => '2937ba38-c26b-4ffc-9db1-6a6fb353d7bb',
:enabled => true,
:initial_failure_delay => 1,
:name => 'www.example.com:PING',
:repeat_failure_delay => 1
}, {
:id => '30324f99-8fd6-4116-b00d-09078f9b6540',
:enabled => true,
:initial_failure_delay => 1,
:name => 'www.example.com:SSH',
:repeat_failure_delay => 1
})
Description
Update checks.
Parameters
{
"data": [{
"enabled": true,
"id": "<String(uuid)>",
"initial_failure_delay": 1,
"name": "<String>",
"relationships": {
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"repeat_failure_delay": 1,
"type": "check"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
checks to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; checks update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
DELETE /checks/{check_id}
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "check",
"id": "2937ba38-c26b-4ffc-9db1-6a6fb353d7bb",
}
]
}' \
http://localhost:3081/checks/2937ba38-c26b-4ffc-9db1-6a6fb353d7bb
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_checks(
'2937ba38-c26b-4ffc-9db1-6a6fb353d7bb'
)
Description
Delete a check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Check deletion success |
404 |
Not Found |
DELETE /checks
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "check",
"id": "2937ba38-c26b-4ffc-9db1-6a6fb353d7bb",
}, {
"type": "check",
"id": "30324f99-8fd6-4116-b00d-09078f9b6540",
}
]
}' \
http://localhost:3081/checks
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_checks(
'2937ba38-c26b-4ffc-9db1-6a6fb353d7bb',
'30324f99-8fd6-4116-b00d-09078f9b6540'
)
Description
Delete checks.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
checks to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; checks deletion succeeded |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_alerting_media(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
While this check is failing, returns media records which are receiving notifications during this failure.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "medium"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_contacts(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns contacts whose notification rules will allow them to receive notifications for events on this check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "contact"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/current_scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_current_scheduled_maintenances(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns scheduled maintenance periods currently in effect for this check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/current_state
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_current_state(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns the current State record for this check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "state"
}
200 |
GET checks current_state success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/current_unscheduled_maintenance
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_current_unscheduled_maintenance(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
If the check is currently acknowledged, returns the unscheduled maintenance period created for that.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}
200 |
GET checks current_unscheduled_maintenance success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/latest_notifications
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_latest_notifications(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns the most recent State records for each problem condition that produced notifications.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "state"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_scheduled_maintenances(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all scheduled maintenance periods for the check; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /checks/{check_id}/states
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_states(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all state records for the check; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "state"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /checks/{check_id}/relationships/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_check_link_tags({
'2937ba38-c26b-4ffc-9db1-6a6fb353d7bb', # check
'30324f99-8fd6-4116-b00d-09078f9b6540', # tag
'24aa4440-9b37-46c1-a35b-7649a3018aa5' # tag
)
Description
Associate tags with this check.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
data |
body |
|
yes |
tags to associate with the check |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_tags(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all tags linked to this check.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "tag"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_check_link_tags({
'2937ba38-c26b-4ffc-9db1-6a6fb353d7bb', # check
'30324f99-8fd6-4116-b00d-09078f9b6540', # tag
'24aa4440-9b37-46c1-a35b-7649a3018aa5' # tag
)
Description
Update the tags associated with this check.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
data |
body |
|
yes |
tags associations to replace for the check |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_check_link_tags(
'2937ba38-c26b-4ffc-9db1-6a6fb353d7bb', # check
'30324f99-8fd6-4116-b00d-09078f9b6540', # tag
'24aa4440-9b37-46c1-a35b-7649a3018aa5' # tag
)
Description
Delete associations between tags and this check.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
data |
body |
|
yes |
tags to remove from the check |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
GET /checks/{check_id}/unscheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.check_link_unscheduled_maintenances(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all unscheduled maintenance periods for the check; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
check_id |
path |
string |
yes |
Id of a check |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
} ]
200 |
GET checks response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /contacts
# required: name
# optional: id, timezone
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "contact",
"id": "8031bc9e-e6b4-4667-867d-694d1513319a",
"name": "Lucia Moretti",
"timezone": "Europe/Rome"
}, {
"type": "contact",
"id": "a76af83a-404a-4d12-a3e9-82ec8792a1ed",
"name": "Vera Дурейко",
"timezone": "Europe/Paris"
}
]
}' \
http://localhost:3081/contacts
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: name
# optional: id, timezone
Flapjack::Diner.create_contacts({
:id => '8031bc9e-e6b4-4667-867d-694d1513319a',
:name => 'Lucia Moretti',
:timezone => 'Europe/Rome'
}, {
:id => 'a76af83a-404a-4d12-a3e9-82ec8792a1ed',
:name => 'Vera Дурейко',
:timezone => 'Europe/Paris'
})
Description
Create a contact.
Parameters
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"timezone": "<String>",
"type": "contact"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
contact to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"timezone": "<String>",
"type": "contact"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
contact creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/contacts/8031bc9e-e6b4-4667-867d-694d1513319a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contacts(
:filter => {:id => '8031bc9e-e6b4-4667-867d-694d1513319a'}
)
Description
Get data for a contact.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"timezone": "<String>",
"type": "contact"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET contact response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/contacts
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contacts(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get data for multiple contacts.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of contacts per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"timezone": "<String>",
"type": "contact"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET contacts success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
# required: id
# optional: name, timezone
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "contact",
"id": "8031bc9e-e6b4-4667-867d-694d1513319a",
"name": "Lucia Moretti",
"timezone": "Europe/Rome"
}
]
}' \
http://localhost:3081/contacts/8031bc9e-e6b4-4667-867d-694d1513319a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: name, timezone
Flapjack::Diner.update_contacts(
:id => '8031bc9e-e6b4-4667-867d-694d1513319a',
:name => 'Lucia Moretti',
:timezone => 'Europe/Rome'
)
Description
Update a contact record.
Parameters
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"timezone": "<String>",
"type": "contact"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
uuid
|
data |
body |
|
yes |
Contact to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Contact update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
# required: id
# optional: name, timezone
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "contact",
"id": "8031bc9e-e6b4-4667-867d-694d1513319a",
"name": "Lucia Moretti",
"timezone": "Europe/Rome"
}, {
"type": "contact",
"id": "a76af83a-404a-4d12-a3e9-82ec8792a1ed",
"name": "Vera Дурейко",
"timezone": "Europe/Paris"
}
]
}' \
http://localhost:3081/contacts
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: name, timezone
Flapjack::Diner.update_contacts({
:id => '8031bc9e-e6b4-4667-867d-694d1513319a',
:name => 'Lucia Moretti',
:timezone => 'Europe/Rome'
}, {
:id => 'a76af83a-404a-4d12-a3e9-82ec8792a1ed',
:name => 'Vera Дурейко',
:timezone => 'Europe/Paris'
})
Description
Update contact records.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"timezone": "<String>",
"type": "contact"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
contacts to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; contacts update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "contact",
"id": "8031bc9e-e6b4-4667-867d-694d1513319a",
}
]
}' \
http://localhost:3081/contacts/8031bc9e-e6b4-4667-867d-694d1513319a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_contacts(
'8031bc9e-e6b4-4667-867d-694d1513319a'
)
Description
Delete a contact.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Contact deletion success |
404 |
Not Found |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "contact",
"id": "8031bc9e-e6b4-4667-867d-694d1513319a",
}, {
"type": "contact",
"id": "a76af83a-404a-4d12-a3e9-82ec8792a1ed",
}
]
}' \
http://localhost:3081/contacts
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_contacts(
'8031bc9e-e6b4-4667-867d-694d1513319a',
'a76af83a-404a-4d12-a3e9-82ec8792a1ed'
)
Description
Delete contacts.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
contacts to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; contacts deletion succeeded |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contact_link_checks(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns checks which this contact's notification rules allow it to receive notifications.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "check"
} ]
200 |
GET contacts response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contact_link_media(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns media belonging to the contact.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "medium"
} ]
200 |
GET contacts response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contact_link_rules(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns rules belonging to the contact.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "rule"
} ]
200 |
GET contacts response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /contacts/{contact_id}/relationships/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_contact_link_tags({
'8031bc9e-e6b4-4667-867d-694d1513319a', # contact
'a76af83a-404a-4d12-a3e9-82ec8792a1ed', # tag
'17da47b1-9ebd-46d0-9120-d55597936470' # tag
)
Description
Associate tags with this contact.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
data |
body |
|
yes |
tags to associate with the contact |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.contact_link_tags(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all tags linked to this contact.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "tag"
} ]
200 |
GET contacts response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_contact_link_tags({
'8031bc9e-e6b4-4667-867d-694d1513319a', # contact
'a76af83a-404a-4d12-a3e9-82ec8792a1ed', # tag
'17da47b1-9ebd-46d0-9120-d55597936470' # tag
)
Description
Update the tags associated with this contact.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
data |
body |
|
yes |
tags associations to replace for the contact |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_contact_link_tags(
'8031bc9e-e6b4-4667-867d-694d1513319a', # contact
'a76af83a-404a-4d12-a3e9-82ec8792a1ed', # tag
'17da47b1-9ebd-46d0-9120-d55597936470' # tag
)
Description
Delete associations between tags and this contact.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
contact_id |
path |
string |
yes |
Id of a contact |
|
data |
body |
|
yes |
tags to remove from the contact |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
POST /media
# required: address, transport
# optional: id, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "medium",
"id": "b1bba2b3-51d7-4268-8fcb-65fa54ef0263",
"address": "admin@example.org",
"transport": "email",
"interval": "120",
"pagerduty_ack_duration": null,
"pagerduty_subdomain": null,
"pagerduty_token": null,
"rollup_threshold": "3"
}, {
"type": "medium",
"id": "111bea37-4a95-4941-827d-8b13cd0dd4fa",
"address": "\u003cpd_service_key\u003e",
"transport": "pagerduty",
"interval": "nil",
"pagerduty_ack_duration": "30",
"pagerduty_subdomain": "\u003cpd_subdomain\u003e",
"pagerduty_token": "\u003ctoken\u003e",
"rollup_threshold": "nil"
}
]
}' \
http://localhost:3081/media
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: address, transport
# optional: id, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold
Flapjack::Diner.create_media({
:id => 'b1bba2b3-51d7-4268-8fcb-65fa54ef0263',
:address => 'admin@example.org',
:transport => 'email',
:interval => 120,
:pagerduty_ack_duration => nil,
:pagerduty_subdomain => nil,
:pagerduty_token => nil,
:rollup_threshold => 3
}, {
:id => '111bea37-4a95-4941-827d-8b13cd0dd4fa',
:address => '<pd_service_key>',
:transport => 'pagerduty',
:interval => 'nil',
:pagerduty_ack_duration => 30,
:pagerduty_subdomain => '<pd_subdomain>',
:pagerduty_token => '<token>',
:rollup_threshold => 'nil'
})
Description
Create a media record.
Parameters
{
"data": {
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
medium to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
medium creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/media/b1bba2b3-51d7-4268-8fcb-65fa54ef0263
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.media(
:filter => {:id => 'b1bba2b3-51d7-4268-8fcb-65fa54ef0263'}
)
Description
Returns data for a media record.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET medium response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/media
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.media(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns data for media records.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of media per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET media success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
# required: id
# optional: address, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold, transport
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "medium",
"id": "b1bba2b3-51d7-4268-8fcb-65fa54ef0263",
"address": "admin@example.org",
"interval": "120",
"pagerduty_ack_duration": null,
"pagerduty_subdomain": null,
"pagerduty_token": null,
"rollup_threshold": "3",
"transport": "email"
}
]
}' \
http://localhost:3081/media/b1bba2b3-51d7-4268-8fcb-65fa54ef0263
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: address, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold, transport
Flapjack::Diner.update_media(
:id => 'b1bba2b3-51d7-4268-8fcb-65fa54ef0263',
:address => 'admin@example.org',
:interval => 120,
:pagerduty_ack_duration => nil,
:pagerduty_subdomain => nil,
:pagerduty_token => nil,
:rollup_threshold => 3,
:transport => 'email'
)
Description
Update a media record.
Parameters
{
"data": {
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
uuid
|
data |
body |
|
yes |
Medium to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Medium update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
# required: id
# optional: address, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold, transport
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "medium",
"id": "b1bba2b3-51d7-4268-8fcb-65fa54ef0263",
"address": "admin@example.org",
"interval": "120",
"pagerduty_ack_duration": null,
"pagerduty_subdomain": null,
"pagerduty_token": null,
"rollup_threshold": "3",
"transport": "email"
}, {
"type": "medium",
"id": "111bea37-4a95-4941-827d-8b13cd0dd4fa",
"address": "\u003cpd_service_key\u003e",
"interval": "nil",
"pagerduty_ack_duration": "30",
"pagerduty_subdomain": "\u003cpd_subdomain\u003e",
"pagerduty_token": "\u003ctoken\u003e",
"rollup_threshold": "nil",
"transport": "pagerduty"
}
]
}' \
http://localhost:3081/media
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: address, interval, pagerduty_ack_duration, pagerduty_subdomain, pagerduty_token, rollup_threshold, transport
Flapjack::Diner.update_media({
:id => 'b1bba2b3-51d7-4268-8fcb-65fa54ef0263',
:address => 'admin@example.org',
:interval => 120,
:pagerduty_ack_duration => nil,
:pagerduty_subdomain => nil,
:pagerduty_token => nil,
:rollup_threshold => 3,
:transport => 'email'
}, {
:id => '111bea37-4a95-4941-827d-8b13cd0dd4fa',
:address => '<pd_service_key>',
:interval => 'nil',
:pagerduty_ack_duration => 30,
:pagerduty_subdomain => '<pd_subdomain>',
:pagerduty_token => '<token>',
:rollup_threshold => 'nil',
:transport => 'pagerduty'
})
Description
Update media records.
Parameters
{
"data": [{
"address": "<String>",
"id": "<String(uuid)>",
"interval": 1,
"pagerduty_ack_duration": 1,
"pagerduty_subdomain": "<String>",
"pagerduty_token": "<String>",
"relationships": {
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"rollup_threshold": 1,
"transport": "<email|jabber|pagerduty|sms|slack|sms_twilio|sms_nexmo|sms_aspsms|sns>",
"type": "medium"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
media to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; media update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "medium",
"id": "b1bba2b3-51d7-4268-8fcb-65fa54ef0263",
}
]
}' \
http://localhost:3081/media/b1bba2b3-51d7-4268-8fcb-65fa54ef0263
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_media(
'b1bba2b3-51d7-4268-8fcb-65fa54ef0263'
)
Description
Delete a media record.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Medium deletion success |
404 |
Not Found |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "medium",
"id": "b1bba2b3-51d7-4268-8fcb-65fa54ef0263",
}, {
"type": "medium",
"id": "111bea37-4a95-4941-827d-8b13cd0dd4fa",
}
]
}' \
http://localhost:3081/media
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_media(
'b1bba2b3-51d7-4268-8fcb-65fa54ef0263',
'111bea37-4a95-4941-827d-8b13cd0dd4fa'
)
Description
Delete media records.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
media to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; media deletion succeeded |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.medium_link_alerting_checks(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all checks that have alerted through a medium (that are still failing.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "check"
} ]
200 |
GET media response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.medium_link_contact(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get the contact a medium belongs to.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "contact"
}
200 |
GET media contact success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /media/{medium_id}/relationships/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_medium_link_rules({
'b1bba2b3-51d7-4268-8fcb-65fa54ef0263', # medium
'111bea37-4a95-4941-827d-8b13cd0dd4fa', # rule
'9fcbfe54-390c-4c89-ad51-ece49019c833' # rule
)
Description
Associate this medium with rules on medium creation.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
data |
body |
|
yes |
rules to associate with the medium |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.medium_link_rules(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get the rules this medium is associated with.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "rule"
} ]
200 |
GET media response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_medium_link_rules({
'b1bba2b3-51d7-4268-8fcb-65fa54ef0263', # medium
'111bea37-4a95-4941-827d-8b13cd0dd4fa', # rule
'9fcbfe54-390c-4c89-ad51-ece49019c833' # rule
)
Description
Update the rules this medium is associated with.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
data |
body |
|
yes |
rules associations to replace for the medium |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_medium_link_rules(
'b1bba2b3-51d7-4268-8fcb-65fa54ef0263', # medium
'111bea37-4a95-4941-827d-8b13cd0dd4fa', # rule
'9fcbfe54-390c-4c89-ad51-ece49019c833' # rule
)
Description
Delete associations between this medium and rules.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
medium_id |
path |
string |
yes |
Id of a medium |
|
data |
body |
|
yes |
rules to remove from the medium |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
Metrics
GET /metrics
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/metrics
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.metrics(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get metrics
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"check_counts": {
"all": 1,
"enabled": 1,
"failing": 1
},
"check_freshness": {
"0": 1,
"300": 1,
"3600": 1,
"60": 1,
"900": 1
},
"event_queue_length": 1,
"processed_events": {
"action_events": 1,
"all_events": 1,
"failure_events": 1,
"invalid_events": 1,
"ok_events": 1
},
"total_keys": 1,
"type": "metrics"
},
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET metrics response |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
Rules
POST /rules
# required: blackhole, enabled, strategy
# optional: conditions_list, id, name, time_restriction_ical
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "rule",
"id": "f85db541-f294-4d83-829b-c27b171cead4",
"blackhole": "false",
"enabled": "true",
"strategy": "global",
"conditions_list": "critical",
"name": "all critical",
"time_restriction_ical": "nil"
}, {
"type": "rule",
"id": "b712205c-ed6a-4d5b-9690-52956963de18",
"blackhole": "true",
"enabled": "true",
"strategy": "any_tag",
"conditions_list": "nil",
"name": "no daytime disk usage",
"time_restriction_ical": "DTSTART;TZID=CET:20130201T080000\\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\\nDTEND;TZID=CET:20130201T180000"
}
]
}' \
http://localhost:3081/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: blackhole, enabled, strategy
# optional: conditions_list, id, name, time_restriction_ical
Flapjack::Diner.create_rules({
:id => 'f85db541-f294-4d83-829b-c27b171cead4',
:blackhole => false,
:enabled => true,
:strategy => 'global',
:conditions_list => 'critical',
:name => 'all critical',
:time_restriction_ical => 'nil'
}, {
:id => 'b712205c-ed6a-4d5b-9690-52956963de18',
:blackhole => true,
:enabled => true,
:strategy => 'any_tag',
:conditions_list => 'nil',
:name => 'no daytime disk usage',
:time_restriction_ical => 'DTSTART;TZID=CET:20130201T080000\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\nDTEND;TZID=CET:20130201T180000'
})
Description
Create a notification rule.
Parameters
{
"data": {
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
rule to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
rule creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /rules/{rule_id}
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/rules/f85db541-f294-4d83-829b-c27b171cead4
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.rules(
:filter => {:id => 'f85db541-f294-4d83-829b-c27b171cead4'}
)
Description
Get data for a notification rule.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET rule response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /rules
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.rules(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get data for multiple notification rules.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of rules per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"contact": {
"data": {
"id": "<String(uuid)>",
"type": "contact"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET rules success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
PATCH /rules/{rule_id}
# required: id
# optional: blackhole, conditions_list, enabled, name, strategy, time_restriction_ical
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "rule",
"id": "f85db541-f294-4d83-829b-c27b171cead4",
"blackhole": "false",
"conditions_list": "critical",
"enabled": "true",
"name": "all critical",
"strategy": "global",
"time_restriction_ical": "nil"
}
]
}' \
http://localhost:3081/rules/f85db541-f294-4d83-829b-c27b171cead4
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: blackhole, conditions_list, enabled, name, strategy, time_restriction_ical
Flapjack::Diner.update_rules(
:id => 'f85db541-f294-4d83-829b-c27b171cead4',
:blackhole => false,
:conditions_list => 'critical',
:enabled => true,
:name => 'all critical',
:strategy => 'global',
:time_restriction_ical => 'nil'
)
Description
Update a notification rule.
Parameters
{
"data": {
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
uuid
|
data |
body |
|
yes |
Rule to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Rule update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
PATCH /rules
# required: id
# optional: blackhole, conditions_list, enabled, name, strategy, time_restriction_ical
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "rule",
"id": "f85db541-f294-4d83-829b-c27b171cead4",
"blackhole": "false",
"conditions_list": "critical",
"enabled": "true",
"name": "all critical",
"strategy": "global",
"time_restriction_ical": "nil"
}, {
"type": "rule",
"id": "b712205c-ed6a-4d5b-9690-52956963de18",
"blackhole": "true",
"conditions_list": "nil",
"enabled": "true",
"name": "no daytime disk usage",
"strategy": "any_tag",
"time_restriction_ical": "DTSTART;TZID=CET:20130201T080000\\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\\nDTEND;TZID=CET:20130201T180000"
}
]
}' \
http://localhost:3081/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: blackhole, conditions_list, enabled, name, strategy, time_restriction_ical
Flapjack::Diner.update_rules({
:id => 'f85db541-f294-4d83-829b-c27b171cead4',
:blackhole => false,
:conditions_list => 'critical',
:enabled => true,
:name => 'all critical',
:strategy => 'global',
:time_restriction_ical => 'nil'
}, {
:id => 'b712205c-ed6a-4d5b-9690-52956963de18',
:blackhole => true,
:conditions_list => 'nil',
:enabled => true,
:name => 'no daytime disk usage',
:strategy => 'any_tag',
:time_restriction_ical => 'DTSTART;TZID=CET:20130201T080000\nRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR\nDTEND;TZID=CET:20130201T180000'
})
Description
Update notification rules.
Parameters
{
"data": [{
"blackhole": true,
"conditions_list": "<String>",
"enabled": true,
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"media": {
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
},
"tags": {
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
}
},
"strategy": "<global|any_tag|all_tags|no_tag>",
"time_restriction_ical": "<String>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
rules to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; rules update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
DELETE /rules/{rule_id}
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "rule",
"id": "f85db541-f294-4d83-829b-c27b171cead4",
}
]
}' \
http://localhost:3081/rules/f85db541-f294-4d83-829b-c27b171cead4
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_rules(
'f85db541-f294-4d83-829b-c27b171cead4'
)
Description
Delete a notification rule.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Rule deletion success |
404 |
Not Found |
DELETE /rules
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "rule",
"id": "f85db541-f294-4d83-829b-c27b171cead4",
}, {
"type": "rule",
"id": "b712205c-ed6a-4d5b-9690-52956963de18",
}
]
}' \
http://localhost:3081/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_rules(
'f85db541-f294-4d83-829b-c27b171cead4',
'b712205c-ed6a-4d5b-9690-52956963de18'
)
Description
Delete notification rules.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
rules to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; rules deletion succeeded |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.rule_link_contact(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get the contact a rule belongs to.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "contact"
}
200 |
GET rules contact success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /rules/{rule_id}/relationships/media
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_rule_link_media({
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # medium
'92aabf63-c77e-46c8-afff-1386fef23c56' # medium
)
Description
Associate this rule with media on rule creation.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
media to associate with the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.rule_link_media(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get the media this rule is associated with.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "medium"
} ]
200 |
GET rules response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_rule_link_media({
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # medium
'92aabf63-c77e-46c8-afff-1386fef23c56' # medium
)
Description
Update the media this rule is associated with.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
media associations to replace for the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_rule_link_media(
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # medium
'92aabf63-c77e-46c8-afff-1386fef23c56' # medium
)
Description
Delete associations between this rule and media.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "medium"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
media to remove from the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
POST /rules/{rule_id}/relationships/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_rule_link_tags({
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # tag
'92aabf63-c77e-46c8-afff-1386fef23c56' # tag
)
Description
Associate tags with this rule.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
tags to associate with the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.rule_link_tags(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all tags linked to this rule.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "tag"
} ]
200 |
GET rules response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_rule_link_tags({
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # tag
'92aabf63-c77e-46c8-afff-1386fef23c56' # tag
)
Description
Update the tags associated with this rule.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
tags associations to replace for the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_rule_link_tags(
'f85db541-f294-4d83-829b-c27b171cead4', # rule
'b712205c-ed6a-4d5b-9690-52956963de18', # tag
'92aabf63-c77e-46c8-afff-1386fef23c56' # tag
)
Description
Delete associations between tags and this rule.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
rule_id |
path |
string |
yes |
Id of a rule |
|
data |
body |
|
yes |
tags to remove from the rule |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
Scheduled maintenances
POST /scheduled_maintenances
# required: end_time, start_time
# optional: id
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "scheduled_maintenance",
"id": "75a764f1-b8d1-437c-ad48-69ba8e00cdfc",
"end_time": "2025-03-01T00:00:00+00:00",
"start_time": "2015-12-10T15:02:56+10:30"
}, {
"type": "scheduled_maintenance",
"id": "45b8d83c-5a93-462c-bf5e-fdd4613cd845",
"end_time": "2025-03-01T00:00:00+00:00",
"start_time": "2025-02-01T00:00:00+00:00"
}
]
}' \
http://localhost:3081/scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: end_time, start_time
# optional: id
Flapjack::Diner.create_scheduled_maintenances({
:id => '75a764f1-b8d1-437c-ad48-69ba8e00cdfc',
:end_time => DateTime.parse('2025-03-01T00:00:00+00:00'),
:start_time => DateTime.parse('2015-12-10T15:02:56+10:30')
}, {
:id => '45b8d83c-5a93-462c-bf5e-fdd4613cd845',
:end_time => DateTime.parse('2025-03-01T00:00:00+00:00'),
:start_time => DateTime.parse('2025-02-01T00:00:00+00:00')
})
Description
Create a scheduled maintenance period for a check, or checks associated with a tag.
Parameters
{
"data": {
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
}
}
},
"start_time": "<String(date-time)>",
"type": "scheduled_maintenance"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
scheduled_maintenance to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"start_time": "<String(date-time)>",
"type": "scheduled_maintenance"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
scheduled_maintenance creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
PATCH /scheduled_maintenances/{scheduled_maintenance_id}
# required: end_time, id, start_time
# optional:
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "scheduled_maintenance",
"id": "75a764f1-b8d1-437c-ad48-69ba8e00cdfc",
"end_time": "2025-03-01T00:00:00+00:00",
"start_time": "2015-12-10T15:02:56+10:30"
}
]
}' \
http://localhost:3081/scheduled_maintenances/75a764f1-b8d1-437c-ad48-69ba8e00cdfc
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: end_time, id, start_time
# optional:
Flapjack::Diner.update_scheduled_maintenances(
:id => '75a764f1-b8d1-437c-ad48-69ba8e00cdfc',
:end_time => DateTime.parse('2025-03-01T00:00:00+00:00'),
:start_time => DateTime.parse('2015-12-10T15:02:56+10:30')
)
Description
Update data for a scheduled maintenance period.
Parameters
{
"data": {
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"start_time": "<String(date-time)>",
"type": "scheduled_maintenance"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
scheduled_maintenance_id |
path |
string |
yes |
Id of a scheduled_maintenance |
uuid
|
data |
body |
|
yes |
ScheduledMaintenance to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; ScheduledMaintenance update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
PATCH /scheduled_maintenances
# required: end_time, id, start_time
# optional:
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "scheduled_maintenance",
"id": "75a764f1-b8d1-437c-ad48-69ba8e00cdfc",
"end_time": "2025-03-01T00:00:00+00:00",
"start_time": "2015-12-10T15:02:56+10:30"
}, {
"type": "scheduled_maintenance",
"id": "45b8d83c-5a93-462c-bf5e-fdd4613cd845",
"end_time": "2025-03-01T00:00:00+00:00",
"start_time": "2025-02-01T00:00:00+00:00"
}
]
}' \
http://localhost:3081/scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: end_time, id, start_time
# optional:
Flapjack::Diner.update_scheduled_maintenances({
:id => '75a764f1-b8d1-437c-ad48-69ba8e00cdfc',
:end_time => DateTime.parse('2025-03-01T00:00:00+00:00'),
:start_time => DateTime.parse('2015-12-10T15:02:56+10:30')
}, {
:id => '45b8d83c-5a93-462c-bf5e-fdd4613cd845',
:end_time => DateTime.parse('2025-03-01T00:00:00+00:00'),
:start_time => DateTime.parse('2025-02-01T00:00:00+00:00')
})
Description
Update data for scheduled maintenance periods.
Parameters
{
"data": [{
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"start_time": "<String(date-time)>",
"type": "scheduled_maintenance"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
scheduled_maintenances to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; scheduled_maintenances update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
DELETE /scheduled_maintenances/{scheduled_maintenance_id}
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "scheduled_maintenance",
"id": "75a764f1-b8d1-437c-ad48-69ba8e00cdfc",
}
]
}' \
http://localhost:3081/scheduled_maintenances/75a764f1-b8d1-437c-ad48-69ba8e00cdfc
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_scheduled_maintenances(
'75a764f1-b8d1-437c-ad48-69ba8e00cdfc'
)
Description
Delete a scheduled maintenance period.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
scheduled_maintenance_id |
path |
string |
yes |
Id of a scheduled_maintenance |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; ScheduledMaintenance deletion success |
404 |
Not Found |
DELETE /scheduled_maintenances
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "scheduled_maintenance",
"id": "75a764f1-b8d1-437c-ad48-69ba8e00cdfc",
}, {
"type": "scheduled_maintenance",
"id": "45b8d83c-5a93-462c-bf5e-fdd4613cd845",
}
]
}' \
http://localhost:3081/scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_scheduled_maintenances(
'75a764f1-b8d1-437c-ad48-69ba8e00cdfc',
'45b8d83c-5a93-462c-bf5e-fdd4613cd845'
)
Description
Delete scheduled maintenance periods.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
scheduled_maintenances to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; scheduled_maintenances deletion succeeded |
404 |
Not Found |
GET /scheduled_maintenances/{scheduled_maintenance_id}/check
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.scheduled_maintenance_link_check(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns the check a scheduled maintenance period applies to.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
scheduled_maintenance_id |
path |
string |
yes |
Id of a scheduled_maintenance |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "check"
}
200 |
GET scheduled_maintenances check success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
States
GET /states/{state_id}
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/states/7cd8bba9-dd32-4c6d-8e33-569e0e40390f
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.states(
:filter => {:id => '7cd8bba9-dd32-4c6d-8e33-569e0e40390f'}
)
Description
Get data for a single check state record.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
state_id |
path |
string |
yes |
Id of a state |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"action": "<acknowledgement|test_notifications>",
"condition": "<ok|critical|warning|unknown>",
"created_at": "<String(date-time)>",
"details": "<String>",
"id": "<String(uuid)>",
"perfdata": "<String>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"summary": "<String>",
"type": "state",
"updated_at": "<String(date-time)>"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET state response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /states
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/states
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.states(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Get data for check state records.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of states per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"action": "<acknowledgement|test_notifications>",
"condition": "<ok|critical|warning|unknown>",
"created_at": "<String(date-time)>",
"details": "<String>",
"id": "<String(uuid)>",
"perfdata": "<String>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"summary": "<String>",
"type": "state",
"updated_at": "<String(date-time)>"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET states success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /states/{state_id}/check
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.state_link_check(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns the check the state data describes.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
state_id |
path |
string |
yes |
Id of a state |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"id": "<String(uuid)>",
"type": "check"
}
200 |
GET states check success |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
Statistics
GET /statistics/{statistic_id}
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/statistics/5a42774b-1dc1-484c-9618-5e0edaea12a7
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.statistics(
:filter => {:id => '5a42774b-1dc1-484c-9618-5e0edaea12a7'}
)
Description
Returns a single event statistics data object.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
statistic_id |
path |
string |
yes |
Id of a statistic |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"action_events": 1,
"all_events": 1,
"created_at": "<String(date-time)>",
"failure_events": 1,
"id": "<String(uuid)>",
"instance_name": "<String>",
"invalid_events": 1,
"ok_events": 1,
"type": "statistic"
},
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET statistic response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /statistics
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/statistics
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.statistics(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns global or per-instance event statistics.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of statistics per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"action_events": 1,
"all_events": 1,
"created_at": "<String(date-time)>",
"failure_events": 1,
"id": "<String(uuid)>",
"instance_name": "<String>",
"invalid_events": 1,
"ok_events": 1,
"type": "statistic"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET statistics success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
POST /tags
# required: name
# optional:
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "tag",
"id": "6de3c340-9a60-42c4-86f1-bdc4ec8bc95a",
"name": "database"
}, {
"type": "tag",
"id": "a353e758-556f-4ef7-8f0b-97538b477e10",
"name": "remove_next_january"
}
]
}' \
http://localhost:3081/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: name
# optional:
Flapjack::Diner.create_tags({
:id => '6de3c340-9a60-42c4-86f1-bdc4ec8bc95a',
:name => 'database'
}, {
:id => 'a353e758-556f-4ef7-8f0b-97538b477e10',
:name => 'remove_next_january'
})
Description
Create a tag.
Parameters
{
"data": {
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"type": "tag"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
tag to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"type": "tag"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
tag creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/tags/6de3c340-9a60-42c4-86f1-bdc4ec8bc95a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tags(
:filter => {:id => '6de3c340-9a60-42c4-86f1-bdc4ec8bc95a'}
)
Description
Returns data for a tag.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
uuid
|
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"type": "tag"
},
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
GET tag response |
See Responses tab
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
curl -w 'response: %{http_code} \n' -X GET \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
http://localhost:3081/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tags(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns data for tags.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
fields |
query |
string |
no |
Comma-separated list of fields to return |
|
sort |
query |
string |
no |
|
|
filter |
query |
array |
no |
|
|
include |
query |
string |
no |
|
|
page |
query |
integer |
no |
Page number |
|
per_page |
query |
integer |
no |
Number of tags per page |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": [{
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"scheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"states": {
"data": [{
"id": "<String(uuid)>",
"type": "state"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"unscheduled_maintenances": {
"data": [{
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}],
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"type": "tag"
}],
"included": [{
"id": "<String(uuid)>",
"type": "<check|contact|medium|rule|scheduled_maintenance|state|tag|unscheduled_maintenance>"
}],
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
},
"meta": {
"pagination": {
"page": 1,
"per_page": 1,
"total_count": 1,
"total_pages": 1
}
}
}
200 |
GET tags success |
See Responses tab
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
# required: id
# optional: name
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "tag",
"id": "6de3c340-9a60-42c4-86f1-bdc4ec8bc95a",
"name": "database"
}
]
}' \
http://localhost:3081/tags/6de3c340-9a60-42c4-86f1-bdc4ec8bc95a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: name
Flapjack::Diner.update_tags(
:id => '6de3c340-9a60-42c4-86f1-bdc4ec8bc95a',
:name => 'database'
)
Description
Update a tag.
Parameters
{
"data": {
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"type": "tag"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
uuid
|
data |
body |
|
yes |
Tag to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Tag update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
# required: id
# optional: name
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "tag",
"id": "6de3c340-9a60-42c4-86f1-bdc4ec8bc95a",
"name": "database"
}, {
"type": "tag",
"id": "a353e758-556f-4ef7-8f0b-97538b477e10",
"name": "remove_next_january"
}
]
}' \
http://localhost:3081/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: name
Flapjack::Diner.update_tags({
:id => '6de3c340-9a60-42c4-86f1-bdc4ec8bc95a',
:name => 'database'
}, {
:id => 'a353e758-556f-4ef7-8f0b-97538b477e10',
:name => 'remove_next_january'
})
Description
Update tags.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"name": "<String>",
"relationships": {
"checks": {
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
},
"contacts": {
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
},
"rules": {
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
}
},
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
tags to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; tags update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "tag",
"id": "6de3c340-9a60-42c4-86f1-bdc4ec8bc95a",
}
]
}' \
http://localhost:3081/tags/6de3c340-9a60-42c4-86f1-bdc4ec8bc95a
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_tags(
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a'
)
Description
Delete a tag.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
uuid
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; Tag deletion success |
404 |
Not Found |
curl -w 'response: %{http_code} \n' -X DELETE \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "tag",
"id": "6de3c340-9a60-42c4-86f1-bdc4ec8bc95a",
}, {
"type": "tag",
"id": "a353e758-556f-4ef7-8f0b-97538b477e10",
}
]
}' \
http://localhost:3081/tags
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_tags(
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a',
'a353e758-556f-4ef7-8f0b-97538b477e10'
)
Description
Delete tags.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "tag"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
tags to delete |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; tags deletion succeeded |
404 |
Not Found |
POST /tags/{tag_id}/relationships/checks
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_tag_link_checks({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # check
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # check
)
Description
Associate checks with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
checks to associate with the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_checks(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all checks linked to this tag.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "check"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_tag_link_checks({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # check
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # check
)
Description
Update the checks associated with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
checks associations to replace for the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_tag_link_checks(
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # check
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # check
)
Description
Delete associations between checks and this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "check"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
checks to remove from the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
POST /tags/{tag_id}/relationships/contacts
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_tag_link_contacts({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # contact
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # contact
)
Description
Associate contacts with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
contacts to associate with the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_contacts(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all contacts linked to this tag.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "contact"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_tag_link_contacts({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # contact
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # contact
)
Description
Update the contacts associated with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
contacts associations to replace for the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_tag_link_contacts(
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # contact
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # contact
)
Description
Delete associations between contacts and this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "contact"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
contacts to remove from the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
POST /tags/{tag_id}/relationships/rules
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.create_tag_link_rules({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # rule
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # rule
)
Description
Associate rules with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
rules to associate with the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link creation success |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_rules(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all rules linked to this tag.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "rule"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.update_tag_link_rules({
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # rule
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # rule
)
Description
Update the rules associated with this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
rules associations to replace for the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link update succeeded |
403 |
Forbidden; no link ids |
404 |
Not Found |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.delete_tag_link_rules(
'6de3c340-9a60-42c4-86f1-bdc4ec8bc95a', # tag
'a353e758-556f-4ef7-8f0b-97538b477e10', # rule
'ce71738f-e0ec-4b2e-8098-66f2c9ebd0cf' # rule
)
Description
Delete associations between rules and this tag.
Parameters
{
"data": [{
"id": "<String(uuid)>",
"type": "rule"
}]
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
data |
body |
|
yes |
rules to remove from the tag |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; link deletion success |
403 |
Forbidden; no link ids |
404 |
Not Found |
GET /tags/{tag_id}/scheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_scheduled_maintenances(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all scheduled maintenance periods for checks linked to this tag; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "scheduled_maintenance"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_states(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all state records for all checks linked to this tag; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "state"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
GET /tags/{tag_id}/unscheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
Flapjack::Diner.tag_link_unscheduled_maintenances(
:fields => [], # string, or an array of strings
:filter => {}, # hash of field values/regexes to match
:include => [], # string, or an array of strings
:sort => [], # string, or an array of strings
:page => 1, # defaults to 1
:per_page => 20 # defaults to 20
)
Description
Returns all unscheduled maintenance periods for checks linked to this tag; default sort order is newest first.
Parameters
Name |
In |
Type |
Required? |
Description |
Format |
tag_id |
path |
string |
yes |
Id of a tag |
|
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
[ {
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
} ]
200 |
GET tags response |
See Responses tab
|
403 |
Forbidden; invalid request |
|
404 |
Not Found |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
Test notifications
POST /test_notifications
# required: summary
# optional: condition, id
curl -w 'response: %{http_code} \n' -X POST \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "test_notification",
"id": "40d5d00c-060e-4123-8a5c-686457533665",
"summary": "",
"condition": '<String>'
}, {
"type": "test_notification",
"id": "5856b86e-0d7d-444e-87f1-f3cdaf8c744a",
"summary": "",
"condition": '<String>'
}
]
}' \
http://localhost:3081/test_notifications
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: summary
# optional: condition, id
Flapjack::Diner.create_test_notifications({
:id => '40d5d00c-060e-4123-8a5c-686457533665',
:summary => '',
:condition => '<String>'
}, {
:id => '5856b86e-0d7d-444e-87f1-f3cdaf8c744a',
:summary => '',
:condition => '<String>'
})
Description
Create a simulated event for a check, or checks linked to a tag.
Parameters
{
"data": {
"condition": "<critical|warning|unknown>",
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
}
},
"tag": {
"data": {
"id": "<String(uuid)>",
"type": "tag"
}
}
},
"summary": "<String>",
"type": "test_notification"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
test_notification to create |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes / Data Schema
Code |
Description |
Schema |
{
"data": {
"condition": "<critical|warning|unknown>",
"id": "<String(uuid)>",
"relationships": {
"check": {
"data": {
"id": "<String(uuid)>",
"type": "check"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
},
"tag": {
"data": {
"id": "<String(uuid)>",
"type": "tag"
},
"links": {
"related": "<String(url)>",
"self": "<String(url)>"
}
}
},
"summary": "<String>",
"type": "test_notification"
},
"links": {
"first": "<String(url)>",
"last": "<String(url)>",
"next": "<String(url)>",
"prev": "<String(url)>",
"self": "<String(url)>"
}
}
200 |
test_notification creation success |
See Responses tab
|
403 |
Forbidden; invalid data |
|
409 |
Conflict; bad request structure |
|
Returned MIME Types
Type |
application/vnd.api+json; supported-ext=bulk |
Unscheduled maintenances
PATCH /unscheduled_maintenances/{unscheduled_maintenance_id}
# required: id
# optional: end_time
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "unscheduled_maintenance",
"id": "186d75d2-f3f3-4374-b2b8-c77aef879493",
"end_time": "2015-12-10T15:02:57+10:30"
}
]
}' \
http://localhost:3081/unscheduled_maintenances/186d75d2-f3f3-4374-b2b8-c77aef879493
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: end_time
Flapjack::Diner.update_unscheduled_maintenances(
:id => '186d75d2-f3f3-4374-b2b8-c77aef879493',
:end_time => DateTime.parse('2015-12-10T15:02:57+10:30')
)
Description
Update data for an unscheduled maintenance period.
Parameters
{
"data": {
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}
}
Name |
In |
Type |
Required? |
Description |
Format |
unscheduled_maintenance_id |
path |
string |
yes |
Id of a unscheduled_maintenance |
uuid
|
data |
body |
|
yes |
UnscheduledMaintenance to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json |
HTTP Return Codes
Code |
Description |
204 |
No Content; UnscheduledMaintenance update success |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |
PATCH /unscheduled_maintenances
# required: id
# optional: end_time
curl -w 'response: %{http_code} \n' -X PATCH \
-H "Content-type: application/vnd.api+json; ext=bulk" -d \
'{
"data": [
{
"type": "unscheduled_maintenance",
"id": "186d75d2-f3f3-4374-b2b8-c77aef879493",
"end_time": "2015-12-10T15:02:57+10:30"
}, {
"type": "unscheduled_maintenance",
"id": "dd7b38d7-a678-4e41-9bbe-af962ced9843",
"end_time": "2050-01-01T00:00:00+00:00"
}
]
}' \
http://localhost:3081/unscheduled_maintenances
require 'flapjack-diner'
Flapjack::Diner.base_uri('localhost:3081')
# required: id
# optional: end_time
Flapjack::Diner.update_unscheduled_maintenances({
:id => '186d75d2-f3f3-4374-b2b8-c77aef879493',
:end_time => DateTime.parse('2015-12-10T15:02:57+10:30')
}, {
:id => 'dd7b38d7-a678-4e41-9bbe-af962ced9843',
:end_time => DateTime.parse('2050-01-01T00:00:00+00:00')
})
Description
Update data for unscheduled maintenance periods.
Parameters
{
"data": [{
"end_time": "<String(date-time)>",
"id": "<String(uuid)>",
"type": "unscheduled_maintenance"
}]
Name |
In |
Type |
Required? |
Description |
Format |
data |
body |
|
yes |
unscheduled_maintenances to update |
See Parameters tab
|
Accepted MIME Types
Type |
application/vnd.api+json; ext=bulk |
HTTP Return Codes
Code |
Description |
204 |
No Content; unscheduled_maintenances update succeeded |
403 |
Forbidden; invalid data |
404 |
Not Found |
409 |
Conflict; request id mismatch |