Base url is "http://localhost:9092"
POST http://localhost:9092/api/v1/replay?name=cpu_alert&id={record id}&clock=fast&rec-time=false
rec-time - mock the times
POST http://localhost:9092/api/v1/record?type=stream&name=cpu_alert&duration=10s
{
"RecordingID": "75df77ac-05fb-450e-89cf-e050ba8fba85"
}
Contents: tick script (of course "application/octetstream")
Response:
{ "Error": "Some error" }
POST http://localhost:9092/api/v1/disable?name=cpu_alert
POST http://localhost:9092/api/v1/enable?name=cpu_alert
GET http://localhost:9092/task?name=cpu_alert
{
"Name": "cpu_alert",
"Type": 0,
"DBRPs": [
{
"db": "kapacitor_example",
"rp": "default"
}
],
"TICKscript": "stream\n // Select just the cpu_usage_idle measurement from our example database.\n\t\t.from().measurement('cpu_usage_idle')\n .alert()\n .crit(lambda: \"value\" \u003c 20)\n\t\t\t\t.log('/tmp/alerts.log')\n\n",
"Dot": "digraph cpu_alert {\nstream0 -\u003e stream1;\nstream1 -\u003e alert2;\n}",
"Enabled": true,
"Error": ""
}
http://localhost:9092/api/v1/tasks
{
"Tasks": [
{
"Name": "cpu_alert",
"Type": 0,
"DBRPs": [
{
"db": "kapacitor_example",
"rp": "default"
}
],
"Enabled": true
}
]
}
http://localhost:9092/api/v1/recordings
{
"Recordings": [
{
"ID": "52925c3f-105e-4cbe-b958-de063dbe7dc6",
"Type": 0,
"Size": 1580,
"Created": "2016-01-28T21:03:29Z"
},
{
"ID": "8944ac7c-76ad-4329-ad9e-6cf00d1fd629",
"Type": 0,
"Size": 4520,
"Created": "2016-01-30T13:21:22Z"
},
{
"ID": "bb03d8f8-0946-4fb0-b0b5-bb2576aa4dca",
"Type": 0,
"Size": 2900,
"Created": "2016-01-26T17:22:11Z"
}
]
}