3428 lines
94 KiB
JSON
3428 lines
94 KiB
JSON
{
|
|
"info": {
|
|
"_postman_id": "94807b85-ef65-4370-9144-b1a74e04cb0e",
|
|
"name": "Statping",
|
|
"description": "Statping API Requests",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "Miscellaneous",
|
|
"item": [
|
|
{
|
|
"name": "Statping Setup",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "08b8f487-2318-44b9-bdb8-f1f1041e9462",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Check Core API Route\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.config.connection).to.eql(\"sqlite3\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/x-www-form-urlencoded",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "urlencoded",
|
|
"urlencoded": [
|
|
{
|
|
"key": "db_host",
|
|
"value": "localhost",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "db_user",
|
|
"value": "root",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "db_password",
|
|
"value": "password123",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "db_database",
|
|
"value": "statping",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "db_connection",
|
|
"value": "sqlite",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "db_port",
|
|
"value": "3306",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "project",
|
|
"value": "Statping Monitoring Sample Data",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "description",
|
|
"value": "View All Example Services",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "username",
|
|
"value": "admin",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "password",
|
|
"value": "admin",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "domain",
|
|
"value": "http://localhost:8080",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "email",
|
|
"value": "info@domain.com",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "sample_data",
|
|
"value": "true",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"options": {
|
|
"urlencoded": {}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/setup",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"setup"
|
|
]
|
|
},
|
|
"description": "The root API endpoint to view basic Statping configuration including Name, URL, database type, and other useful fields."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Statping Details",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "08b8f487-2318-44b9-bdb8-f1f1041e9462",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Check Core API Route\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.name).to.eql(\"Statping Monitoring Sample Data\");",
|
|
" pm.expect(jsonData.using_cdn).to.eql(false);",
|
|
" pm.expect(jsonData.admin).to.eql(false);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api"
|
|
]
|
|
},
|
|
"description": "The root API endpoint to view basic Statping configuration including Name, URL, database type, and other useful fields."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Statping Clear Cache",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "08b8f487-2318-44b9-bdb8-f1f1041e9462",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/clear_cache",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"clear_cache"
|
|
]
|
|
},
|
|
"description": "This endpoint will clear all the cache files in your Statping instance. This includes chart data and service views."
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "This is for Statping's miscellaneous API endpoints that aren't a part of another category.",
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "883519e8-7c7d-49c0-9812-d988d0179907",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "7a0738e6-2fc4-45cb-9f1a-1cd57fb76b66",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Services",
|
|
"item": [
|
|
{
|
|
"name": "All Services",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d87f8a4e-7640-45b8-9d45-4f6e6f2463ee",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View All Services\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.eql(5);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services"
|
|
]
|
|
},
|
|
"description": "View an array of all Services added to your Statping instance."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Service",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View Service\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.name).to.eql(\"Google\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1"
|
|
]
|
|
},
|
|
"description": "View a specific service, this will include the service's failures and checkins."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View Service",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:31:19 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "482"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"id\": 1,\n \"name\": \"Google\",\n \"domain\": \"https://google.com\",\n \"expected\": null,\n \"expected_status\": 200,\n \"check_interval\": 10,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": null,\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 1,\n \"allow_notifications\": false,\n \"created_at\": \"2018-12-10T11:15:42.24769-08:00\",\n \"updated_at\": \"2018-12-10T11:15:42.247837-08:00\",\n \"online\": true,\n \"latency\": 0.190599816,\n \"ping_time\": 0.00476598,\n \"online_24_hours\": 0,\n \"avg_response\": \"\",\n \"status_code\": 200,\n \"last_success\": \"2018-12-10T11:31:13.511139-08:00\"\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "View Service Chart Data",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1/hits_data?start=0&end=5973064434&group=12h",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1",
|
|
"hits_data"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "start",
|
|
"value": "0",
|
|
"description": "Starting from time (unix timestamp)"
|
|
},
|
|
{
|
|
"key": "end",
|
|
"value": "5973064434",
|
|
"description": "End on time (unix timestamp)"
|
|
},
|
|
{
|
|
"key": "group",
|
|
"value": "12h",
|
|
"description": "Increment grouping (minute, hour, day)"
|
|
}
|
|
]
|
|
},
|
|
"description": "View the chart data for the service's latency. The response returns an array of objects as `x` for timestamp, and `y` for value in ascending order."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Service Ping Data",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1/ping_data?start=0&end=9973064434&group=12h",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1",
|
|
"ping_data"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "start",
|
|
"value": "0",
|
|
"description": "Starting from time (unix timestamp)"
|
|
},
|
|
{
|
|
"key": "end",
|
|
"value": "9973064434",
|
|
"description": "End on time (unix timestamp)"
|
|
},
|
|
{
|
|
"key": "group",
|
|
"value": "12h",
|
|
"description": "Increment grouping (minute, hour, day)"
|
|
}
|
|
]
|
|
},
|
|
"description": "View the chart data for the service's ping response time. The response returns an array of objects as `x` for timestamp, and `y` for value in ascending order."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Service Failure Data",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1/failure_data?start=0&end=2973064434&group=12h",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1",
|
|
"failure_data"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "start",
|
|
"value": "0"
|
|
},
|
|
{
|
|
"key": "end",
|
|
"value": "2973064434"
|
|
},
|
|
{
|
|
"key": "group",
|
|
"value": "12h"
|
|
}
|
|
]
|
|
},
|
|
"description": "View the data service failures in a heatmap. The field `x` is the day of the month, and `y` is the amount of failures the service had."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Service Failures",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1/failures?start=0&end=99999999999",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1",
|
|
"failures"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "start",
|
|
"value": "0"
|
|
},
|
|
{
|
|
"key": "end",
|
|
"value": "99999999999"
|
|
}
|
|
]
|
|
},
|
|
"description": "Returns an array of failures for this service. It includes the error message, http status code, and the ping response time."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Service Hits",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Service Successful Hits\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.be.at.least(100);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/1/hits?start=0&end=99999999999",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"1",
|
|
"hits"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "start",
|
|
"value": "0"
|
|
},
|
|
{
|
|
"key": "end",
|
|
"value": "99999999999"
|
|
}
|
|
]
|
|
},
|
|
"description": "Returns on array of all the successful hits for this service."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Reorder Services",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "b5a67a19-fd08-40b0-a961-3e9474ab78c6",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "[{\"service\":1,\"order\":1},{\"service\":2,\"order\":3},{\"service\":3,\"order\":4},{\"service\":4,\"order\":5}]",
|
|
"options": {
|
|
"raw": {}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/reorder/services",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"reorder",
|
|
"services"
|
|
]
|
|
},
|
|
"description": "Reorder services in a specific order for the index page."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Reorder Services",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "[{\"service\":1,\"order\":1},{\"service\":5,\"order\":2},{\"service\":2,\"order\":3},{\"service\":3,\"order\":4},{\"service\":4,\"order\":5}]"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/reorder",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"reorder"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:31:40 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "122"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "[\n {\n \"service\": 1,\n \"order\": 1\n },\n {\n \"service\": 5,\n \"order\": 2\n },\n {\n \"service\": 2,\n \"order\": 3\n },\n {\n \"service\": 3,\n \"order\": 4\n },\n {\n \"service\": 4,\n \"order\": 5\n }\n]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Create Service",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d4eb16fe-8495-40e5-9ca3-be20951e5133",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Create Service\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.output.name).to.eql(\"New Service\");",
|
|
" pm.expect(jsonData.output.domain).to.eql(\"https://statping.com\");",
|
|
" pm.expect(jsonData.output.type).to.eql(\"http\");",
|
|
" pm.expect(jsonData.output.method).to.eql(\"GET\");",
|
|
" pm.expect(jsonData.output.expected_status).to.eql(200);",
|
|
" pm.globals.set(\"service_id\", jsonData.output.id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"New Service\",\n \"domain\": \"https://statping.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services"
|
|
]
|
|
},
|
|
"description": "Create a new service and begin monitoring."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Create Service",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"New Service\",\n \"domain\": \"https://statping.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:31:47 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "528"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"service\",\n \"method\": \"create\",\n \"id\": 10,\n \"output\": {\n \"id\": 10,\n \"name\": \"New Service\",\n \"domain\": \"https://statping.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0,\n \"allow_notifications\": false,\n \"created_at\": \"2018-12-10T11:31:47.535086-08:00\",\n \"updated_at\": \"2018-12-10T11:31:47.535184-08:00\",\n \"online\": false,\n \"latency\": 0,\n \"ping_time\": 0,\n \"online_24_hours\": 0,\n \"avg_response\": \"\",\n \"status_code\": 0,\n \"last_success\": \"0001-01-01T00:00:00Z\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Update Service",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "b5a67a19-fd08-40b0-a961-3e9474ab78c6",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Update Service\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.output.name).to.eql(\"Brand New Service\");",
|
|
" pm.expect(jsonData.output.domain).to.eql(\"https://google.net\");",
|
|
" pm.expect(jsonData.output.type).to.eql(\"http\");",
|
|
" pm.expect(jsonData.output.method).to.eql(\"GET\");",
|
|
" pm.expect(jsonData.output.expected_status).to.eql(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"Brand New Service\",\n \"domain\": \"https://google.net\",\n \"expected\": \"heyyyy\",\n \"expected_status\": 200,\n \"check_interval\": 20,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 0\n}",
|
|
"options": {
|
|
"raw": {}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/{{service_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"{{service_id}}"
|
|
]
|
|
},
|
|
"description": "Update a service with new values and begin monitoring."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Update Service",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"Updated New Service\",\n \"domain\": \"https://google.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 60,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 0\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/{{service_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"{{service_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:31:54 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "567"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"service\",\n \"method\": \"update\",\n \"id\": 10,\n \"output\": {\n \"id\": 10,\n \"name\": \"Updated New Service\",\n \"domain\": \"https://google.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 60,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 0,\n \"allow_notifications\": false,\n \"created_at\": \"2018-12-10T11:31:47.535086-08:00\",\n \"updated_at\": \"2018-12-10T11:31:47.535184-08:00\",\n \"online\": true,\n \"latency\": 0.550636193,\n \"ping_time\": 0.073339805,\n \"online_24_hours\": 0,\n \"avg_response\": \"\",\n \"status_code\": 200,\n \"last_success\": \"2018-12-10T11:31:49.161389-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Delete Service Failures",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "dd4d721d-d874-448b-abc9-59c1afceb58e",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/{{service_id}}/failures",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"{{service_id}}",
|
|
"failures"
|
|
]
|
|
},
|
|
"description": "Delete all the service failures."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Service",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "dd4d721d-d874-448b-abc9-59c1afceb58e",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Delete Service\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"service\");",
|
|
" pm.expect(jsonData.method).to.eql(\"delete\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/{{service_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"{{service_id}}"
|
|
]
|
|
},
|
|
"description": "Delete a service and stops monitoring."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Delete Service",
|
|
"originalRequest": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/services/{{service_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"services",
|
|
"{{service_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:32:06 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "567"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"service\",\n \"method\": \"delete\",\n \"id\": 10,\n \"output\": {\n \"id\": 10,\n \"name\": \"Updated New Service\",\n \"domain\": \"https://google.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 60,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 0,\n \"allow_notifications\": false,\n \"created_at\": \"2018-12-10T11:31:47.535086-08:00\",\n \"updated_at\": \"2018-12-10T11:31:47.535184-08:00\",\n \"online\": true,\n \"latency\": 0.203382878,\n \"ping_time\": 0.001664491,\n \"online_24_hours\": 0,\n \"avg_response\": \"\",\n \"status_code\": 200,\n \"last_success\": \"2018-12-10T11:31:55.455091-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "With the Statping API, you can add, remove, edit all your services fields from the API directly. This includes viewing Service chart data for latency/up-time, and even viewing a log of failures. ",
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "4cd2ab82-e60d-45cd-9b74-cb4b5d893f4d",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "c7cb2b6d-289a-4073-b291-202bbec8cb44",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Groups",
|
|
"item": [
|
|
{
|
|
"name": "All Groups",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d87f8a4e-7640-45b8-9d45-4f6e6f2463ee",
|
|
"exec": [
|
|
"pm.test(\"View All Groups\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.eql(2);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups"
|
|
]
|
|
},
|
|
"description": "View an array of all Groups added to your Statping instance."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "All Groups",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Thu, 03 Jan 2019 21:48:40 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "301"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "[\n {\n \"id\": 1,\n \"name\": \"Main Services\",\n \"public\": true,\n \"created_at\": \"2019-01-03T13:48:23.488553261-08:00\",\n \"updated_at\": \"2019-01-03T13:48:23.488614502-08:00\"\n },\n {\n \"id\": 2,\n \"name\": \"Linked Services\",\n \"public\": false,\n \"created_at\": \"2019-01-03T13:48:23.489693923-08:00\",\n \"updated_at\": \"2019-01-03T13:48:23.489719447-08:00\"\n }\n]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "View Group",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View Group\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.name).to.eql(\"Main Services\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups/1",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups",
|
|
"1"
|
|
]
|
|
},
|
|
"description": "View a specific group"
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View Group",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups/1",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups",
|
|
"1"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Thu, 03 Jan 2019 21:48:58 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "148"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"id\": 1,\n \"name\": \"Main Services\",\n \"public\": true,\n \"created_at\": \"2019-01-03T13:48:23.488553261-08:00\",\n \"updated_at\": \"2019-01-03T13:48:23.488614502-08:00\"\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Create Group",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d4eb16fe-8495-40e5-9ca3-be20951e5133",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Create Group\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.output.name).to.eql(\"New Group\");",
|
|
" pm.globals.set(\"group_id\", jsonData.output.id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups"
|
|
]
|
|
},
|
|
"description": "Create a new Group to organize services."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Create Group",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"name\": \"New Group\",\n \"public\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Thu, 03 Jan 2019 21:49:25 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "214"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"group\",\n \"method\": \"create\",\n \"id\": 3,\n \"output\": {\n \"id\": 3,\n \"name\": \"New Group\",\n \"public\": true,\n \"created_at\": \"2019-01-03T13:49:25.947069211-08:00\",\n \"updated_at\": \"2019-01-03T13:49:25.947120276-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Reorder Groups",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "b5a67a19-fd08-40b0-a961-3e9474ab78c6",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "[{\"group\":1,\"order\":1},{\"group\":2,\"order\":2}]"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/reorder/groups",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"reorder",
|
|
"groups"
|
|
]
|
|
},
|
|
"description": "Reorder services in a specific order for the index page."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Delete Group",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "dd4d721d-d874-448b-abc9-59c1afceb58e",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Delete Service\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"group\");",
|
|
" pm.expect(jsonData.method).to.eql(\"delete\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups/{{group_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups",
|
|
"{{group_id}}"
|
|
]
|
|
},
|
|
"description": "Delete a group and removes all services attached to this group."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Delete Group",
|
|
"originalRequest": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/groups/{{group_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"groups",
|
|
"{{group_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Thu, 03 Jan 2019 21:49:49 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "214"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"group\",\n \"method\": \"delete\",\n \"id\": 3,\n \"output\": {\n \"id\": 3,\n \"name\": \"New Group\",\n \"public\": true,\n \"created_at\": \"2019-01-03T13:49:25.947069211-08:00\",\n \"updated_at\": \"2019-01-03T13:49:25.947120276-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "Statping allows you to group multiple services with a unique name for better viewablity. You can reorder the groups to make your status page a little more organized if you have tons of services.",
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "4cd2ab82-e60d-45cd-9b74-cb4b5d893f4d",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "c7cb2b6d-289a-4073-b291-202bbec8cb44",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Users",
|
|
"item": [
|
|
{
|
|
"name": "Statping Login",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "08b8f487-2318-44b9-bdb8-f1f1041e9462",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Check Login JWT Token\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData).to.have.property('token');",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"type": "text",
|
|
"value": "application/x-www-form-urlencoded"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "urlencoded",
|
|
"urlencoded": [
|
|
{
|
|
"key": "username",
|
|
"value": "admin",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "password",
|
|
"value": "admin",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"options": {
|
|
"urlencoded": {}
|
|
}
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/login",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"login"
|
|
]
|
|
},
|
|
"description": "The root API endpoint to view basic Statping configuration including Name, URL, database type, and other useful fields."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View All Users",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "9a2977fe-9689-4039-bdcb-eaa34abee958",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View All Users\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.eql(1);",
|
|
" var user = jsonData[0];",
|
|
" pm.expect(user.id).to.eql(1);",
|
|
" pm.expect(user.username).to.eql(\"admin\");",
|
|
" pm.expect(user.email).to.eql(\"info@admin.com\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users"
|
|
]
|
|
},
|
|
"description": "View all users on your Statping instance."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View All Users",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:32:23 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "701"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "[\n {\n \"id\": 1,\n \"username\": \"admin\",\n \"password\": \"$2a$14$KtPUxcclSu/DTwVCJ1uez.KbrQcGxWK8CKnvlXe1E8rbpALrR5IPi\",\n \"email\": \"info@admin.com\",\n \"api_key\": \"0a7181be6ce703851c59dcb8a4e47090f585d3de\",\n \"api_secret\": \"5fe0e1982f1669ed004ab59d5dc73a5ec375ae31\",\n \"admin\": true,\n \"created_at\": \"2018-12-10T11:15:41.12715-08:00\",\n \"updated_at\": \"2018-12-10T11:15:42.245315-08:00\"\n },\n {\n \"id\": 6,\n \"username\": \"adminuser2\",\n \"password\": \"$2a$14$T45y.jRn58G./bLIHO7enOl2c7Xhom9pGVuAo8.3hIPcH66.8ZwCq\",\n \"email\": \"info@adminemail.com\",\n \"api_key\": \"373b493a54c0dc8ce6f710e0b99c1fc968d691bb\",\n \"api_secret\": \"4f7c0469cf8c57032d7693edc8665379274e1f6f\",\n \"admin\": true,\n \"created_at\": \"2018-12-10T11:30:17.654832-08:00\",\n \"updated_at\": \"2018-12-10T11:30:18.699416-08:00\"\n }\n]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Create User",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "1913466d-83b2-4d5b-ac48-89c9abdd0c8d",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Create User\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"user\");",
|
|
" pm.expect(jsonData.method).to.eql(\"create\");",
|
|
" pm.globals.set(\"user_id\", jsonData.output.id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"username\": \"adminuser2\",\n \"email\": \"info@adminemail.com\",\n \"password\": \"passsword123\",\n \"admin\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users"
|
|
]
|
|
},
|
|
"description": "Create a new Statping user"
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View User",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "555b7ba4-bb36-4e86-a541-fa5a5008f951",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View User\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var id = pm.globals.get(\"user_id\");",
|
|
" pm.expect(jsonData.id).to.eql(id);",
|
|
" pm.expect(jsonData.username).to.eql(\"adminuser2\");",
|
|
" pm.expect(jsonData.email).to.eql(\"info@adminemail.com\");",
|
|
" pm.expect(jsonData.admin).to.eql(true);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
}
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View User",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:32:50 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "281"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"id\": 6,\n \"username\": \"adminuser2\",\n \"email\": \"info@adminemail.com\",\n \"api_key\": \"373b493a54c0dc8ce6f710e0b99c1fc968d691bb\",\n \"api_secret\": \"4f7c0469cf8c57032d7693edc8665379274e1f6f\",\n \"admin\": true,\n \"created_at\": \"2018-12-10T11:30:17.654832-08:00\",\n \"updated_at\": \"2018-12-10T11:30:18.699416-08:00\"\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Update User",
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "d23b1822-d1de-4545-9a82-3cf4719a7e82",
|
|
"exec": [
|
|
""
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "b0d22bbd-a428-4df3-8295-b40542bfa21f",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Update User\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"username\": \"adminupdated\",\n \"email\": \"info@email.com\",\n \"password\": \"password12345\",\n \"admin\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
},
|
|
"description": "Update a user's information including username, email, password, and if they are an admin or not."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Update User",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"username\": \"adminupdated\",\n \"email\": \"info@email.com\",\n \"password\": \"password12345\",\n \"admin\": true\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:32:58 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "421"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"user\",\n \"method\": \"update\",\n \"id\": 6,\n \"output\": {\n \"id\": 6,\n \"username\": \"adminupdated\",\n \"password\": \"$2a$14$fAUBFWOYtEjj/rhVkGop/Os9OPwCzNOw0ZW7naSSyAs4J7KQeZFCe\",\n \"email\": \"info@email.com\",\n \"api_key\": \"c9a5d9cba5a0062812be9d080a54080397b41058\",\n \"api_secret\": \"e81a58e019c8ce88f3272057ba67c7ab52b4a988\",\n \"admin\": true,\n \"created_at\": \"2018-12-10T11:30:17.654832-08:00\",\n \"updated_at\": \"2018-12-10T11:30:18.699416-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Delete User",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "bd8c3425-a97f-4f8c-b849-71b65dd543ee",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Delete User\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var id = pm.globals.get(\"user_id\");",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"user\");",
|
|
" pm.expect(jsonData.id).to.eql(id);",
|
|
" pm.expect(jsonData.method).to.eql(\"delete\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
},
|
|
"description": "Delete a specific user from the database."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Delete User",
|
|
"originalRequest": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/users/{{user_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"users",
|
|
"{{user_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:06 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "421"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"user\",\n \"method\": \"delete\",\n \"id\": 6,\n \"output\": {\n \"id\": 6,\n \"username\": \"adminupdated\",\n \"password\": \"$2a$14$fAUBFWOYtEjj/rhVkGop/Os9OPwCzNOw0ZW7naSSyAs4J7KQeZFCe\",\n \"email\": \"info@email.com\",\n \"api_key\": \"c9a5d9cba5a0062812be9d080a54080397b41058\",\n \"api_secret\": \"e81a58e019c8ce88f3272057ba67c7ab52b4a988\",\n \"admin\": true,\n \"created_at\": \"2018-12-10T11:30:17.654832-08:00\",\n \"updated_at\": \"2018-12-10T11:32:58.602809-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "You can create new users with different permissions to allow for read only API access, and super admin abilities. ",
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "9720db1a-bc4c-4e05-94ea-2782aaafb793",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "c667ae2d-41f3-4dea-ab62-3b544e2bc8f9",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Notifiers",
|
|
"item": [
|
|
{
|
|
"name": "All Notifiers",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "e9105618-6db8-4a57-ae7f-782989842f4a",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View All Notifiers\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.eql(10);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "R1T2Cyugjjzw63km",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/notifiers",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"notifiers"
|
|
]
|
|
},
|
|
"description": "View an array of all the Notifiers including all details about the notifier."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "View Notifier",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "acac30b6-3caa-46c9-89be-1efbadf89f22",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/notifier/slack",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"notifier",
|
|
"slack"
|
|
]
|
|
},
|
|
"description": "View a specific notifier and it's details."
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "Update Notifier",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d714d71d-4d6a-4b2e-a6ea-16c34dec3041",
|
|
"exec": [
|
|
"pm.test(\"Update Notifier\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.output).to.eql(\"slack\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"method\": \"slack\",\n \"host\": \"https://hooks.slack.com/services/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\",\n \"enabled\": true,\n \"limits\": 55\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/notifier/slack",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"notifier",
|
|
"slack"
|
|
]
|
|
},
|
|
"description": "Update a notifier to change it's values."
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"description": "Statping contains multiple notifiers that will send you a notification whenever a service become offline, or online. You can create your own 3rd party notifier by reading more on the [Notifiers Wiki](https://github.com/hunterlong/statping/wiki/Notifiers) on the Github repo.",
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "bd5d8232-7ed7-4607-ab7c-14de85c3a033",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "ef420ba0-37dc-4ffc-b38f-a43ccca76606",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Messages",
|
|
"item": [
|
|
{
|
|
"name": "All Messages",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "3c484d1b-6e77-4084-b844-3ca77dc50108",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View All Messages\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.length).to.be.at.least(2);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages"
|
|
]
|
|
},
|
|
"description": "View an array of all messages inserted into the database."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "All Messages",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:17 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "1169"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "[\n {\n \"id\": 1,\n \"title\": \"Routine Downtime\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2018-12-10T11:30:42.259843-08:00\",\n \"end_on\": \"2018-12-10T13:15:42.259844-08:00\",\n \"service\": 1,\n \"notify_users\": null,\n \"notify_method\": \"\",\n \"notify_before\": null,\n \"notify_before_scale\": \"\",\n \"created_at\": \"2018-12-10T11:15:42.259845-08:00\",\n \"updated_at\": \"2018-12-10T11:15:42.260024-08:00\"\n },\n {\n \"id\": 2,\n \"title\": \"Server Reboot\",\n \"description\": \"This is another example a upcoming message for a service!\",\n \"start_on\": \"2018-12-10T11:30:42.261412-08:00\",\n \"end_on\": \"2018-12-10T13:15:42.261413-08:00\",\n \"service\": 3,\n \"notify_users\": null,\n \"notify_method\": \"\",\n \"notify_before\": null,\n \"notify_before_scale\": \"\",\n \"created_at\": \"2018-12-10T11:15:42.261414-08:00\",\n \"updated_at\": \"2018-12-10T11:15:42.261494-08:00\"\n },\n {\n \"id\": 4,\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\",\n \"created_at\": \"2018-12-10T11:16:42.658695-08:00\",\n \"updated_at\": \"2018-12-10T11:16:42.658771-08:00\"\n }\n]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Create Message",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "12caf74a-61d7-4f6e-89b5-fca2f65464c4",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Create Message\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var object = jsonData.output;",
|
|
" pm.expect(object.title).to.eql(\"API Message\");",
|
|
" pm.expect(object.description).to.eql(\"This is an example a upcoming message for a service!\");",
|
|
" pm.expect(object.service).to.eql(1);",
|
|
" pm.expect(object.notify_before).to.eql(6);",
|
|
" pm.expect(object.notify_before_scale).to.eql(\"hour\");",
|
|
" pm.globals.set(\"message_id\", object.id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages"
|
|
]
|
|
},
|
|
"description": "Create a new message show show on index page, or on a service."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Create Message",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:25 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "456"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"message\",\n \"method\": \"create\",\n \"id\": 8,\n \"output\": {\n \"id\": 8,\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\",\n \"created_at\": \"2018-12-10T19:33:25.875858Z\",\n \"updated_at\": \"2018-12-10T11:33:25.875947-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "View Message",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "c30cc333-53f4-4e9a-9c32-958c905ec163",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View Message\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.title).to.eql(\"API Message\");",
|
|
" pm.expect(jsonData.service).to.eql(1);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
},
|
|
"description": "View a specific message and it's details."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View Message",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:33 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "389"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"id\": 8,\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 6,\n \"notify_before_scale\": \"hour\",\n \"created_at\": \"2018-12-10T11:33:25.875858-08:00\",\n \"updated_at\": \"2018-12-10T11:33:25.875947-08:00\"\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Update Message",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "e9dd78cc-0f38-4516-bf82-38dd3451b2e7",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Update Message\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var object = jsonData.output;",
|
|
" pm.expect(object.title).to.eql(\"Updated Message\");",
|
|
" pm.expect(object.description).to.eql(\"This message was updated\");",
|
|
" pm.expect(object.service).to.eql(1);",
|
|
" pm.expect(object.notify_before).to.eql(3);",
|
|
" pm.expect(object.notify_before_scale).to.eql(\"hour\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"title\": \"Updated Message\",\n \"description\": \"This message was updated\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 3,\n \"notify_before_scale\": \"hour\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
},
|
|
"description": "Update a specific message with new details."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Update Message",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"title\": \"Updated Message\",\n \"description\": \"This message was updated\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 3,\n \"notify_before_scale\": \"hour\"\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:39 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "437"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"message\",\n \"method\": \"update\",\n \"id\": 8,\n \"output\": {\n \"id\": 8,\n \"title\": \"Updated Message\",\n \"description\": \"This message was updated\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 3,\n \"notify_before_scale\": \"hour\",\n \"created_at\": \"2018-12-10T11:33:25.875858-08:00\",\n \"updated_at\": \"2018-12-10T11:33:25.875947-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Delete Message",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "6cb2527f-41c2-4feb-9573-1e4d59efa116",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Delete Message\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var id = pm.globals.get(\"message_id\");",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.method).to.eql(\"delete\");",
|
|
" pm.expect(jsonData.type).to.eql(\"message\");",
|
|
" pm.expect(jsonData.id).to.eql(id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
},
|
|
"description": "Delete a specific message from the database."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Delete Message",
|
|
"originalRequest": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/messages/{{message_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"messages",
|
|
"{{message_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:33:47 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "437"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"message\",\n \"method\": \"delete\",\n \"id\": 8,\n \"output\": {\n \"id\": 8,\n \"title\": \"Updated Message\",\n \"description\": \"This message was updated\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 3,\n \"notify_before_scale\": \"hour\",\n \"created_at\": \"2018-12-10T11:33:25.875858-08:00\",\n \"updated_at\": \"2018-12-10T11:33:39.797941-08:00\"\n }\n}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "Messages allows you to create an alert for a service for a scheduled downtime, or a simple message letting users know a service might be having internal issues. ",
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "8d24599b-f157-475b-9e30-06c1171c85bc",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "497c2428-fe8a-42c2-bf6f-8f2cdf959771",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Checkins",
|
|
"item": [
|
|
{
|
|
"name": "View All Checkin's",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "54bded63-de27-4839-8783-25874c35c3ea",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View All Checkins\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var first = jsonData[0];",
|
|
" var id = pm.globals.get(\"checkin_id\");",
|
|
" pm.expect(first.name).to.eql(\"Demo Checkin 1\");",
|
|
" pm.expect(first.grace).to.eql(300);",
|
|
" pm.expect(first.interval).to.eql(300);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkins",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkins"
|
|
]
|
|
},
|
|
"description": "View an array of all the Checkin's inserted into the system."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View All Checkin's",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkins",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkins"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:34:16 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "268"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "[\n {\n \"id\": 5,\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60,\n \"api_key\": \"1emn9ha\",\n \"created_at\": \"2018-12-10T11:34:10.991372-08:00\",\n \"updated_at\": \"2018-12-10T11:34:10.991372-08:00\",\n \"failing\": false,\n \"last_hit\": \"0001-01-01T00:00:00Z\",\n \"hits\": [],\n \"failures\": null\n }\n]"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Create Checkin",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "af07a95b-1bf5-42c7-bd3f-a32f3ab2a264",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Create Checkin\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"checkin\");",
|
|
" pm.expect(jsonData.output.name).to.eql(\"Server Checkin\");",
|
|
" pm.expect(jsonData.output.grace).to.eql(60);",
|
|
" pm.expect(jsonData.output.interval).to.eql(900);",
|
|
" var id = jsonData.output.api_key;",
|
|
" pm.globals.set(\"checkin_id\", id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkins",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkins"
|
|
]
|
|
},
|
|
"description": "Create a new Checkin."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Create Checkin",
|
|
"originalRequest": {
|
|
"method": "POST",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"name": "Content-Type",
|
|
"value": "application/json",
|
|
"type": "text"
|
|
}
|
|
],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": "{\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60\n}"
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkin",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkin"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:34:10 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "330"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"checkin\",\n \"method\": \"create\",\n \"id\": 5,\n \"output\": {\n \"id\": 5,\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60,\n \"api_key\": \"1emn9ha\",\n \"created_at\": \"2018-12-10T19:34:10.991372Z\",\n \"updated_at\": \"2018-12-10T19:34:10.991372Z\",\n \"failing\": false,\n \"last_hit\": \"0001-01-01T00:00:00Z\",\n \"hits\": null,\n \"failures\": null\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Run Checkin",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "652a1c5b-5379-43c2-9cd8-ebd8f8dad0f6",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Hit the Checkin API Endpoint\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.method).to.eql(\"update\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/checkin/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"checkin",
|
|
"{{checkin_id}}"
|
|
]
|
|
},
|
|
"description": "Initiate the Checkin request to your Statping instance. This request will come from your service and will trigger a failure if your service does not hit this URL in the routine interval set.\n\n- `checkin_id` is the ID for the checkin"
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Run Checkin",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/checkin/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"checkin",
|
|
"{{checkin_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:34:23 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "147"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"checkin_hit\",\n \"method\": \"update\",\n \"id\": 5,\n \"output\": {\n \"id\": 5,\n \"from\": \"127.0.0.1\",\n \"created_at\": \"2018-12-10T19:34:23.442087Z\"\n }\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "View Checkin",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "93ff6b86-368b-406f-9d75-07338714ebca",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"View Checkin\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var id = pm.globals.get(\"checkin_id\");",
|
|
" pm.expect(jsonData.name).to.eql(\"Server Checkin\");",
|
|
" pm.expect(jsonData.api_key).to.eql(id);",
|
|
" pm.expect(jsonData.grace).to.eql(60);",
|
|
" pm.expect(jsonData.interval).to.eql(900);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkins/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkins",
|
|
"{{checkin_id}}"
|
|
]
|
|
},
|
|
"description": "View a specific checkin and it's details."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "View Checkin",
|
|
"originalRequest": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkin/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkin",
|
|
"{{checkin_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:34:29 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "338"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"id\": 5,\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60,\n \"api_key\": \"1emn9ha\",\n \"created_at\": \"2018-12-10T19:34:10.991372Z\",\n \"updated_at\": \"2018-12-10T19:34:10.991372Z\",\n \"failing\": false,\n \"last_hit\": \"2018-12-10T11:34:23.443663-08:00\",\n \"hits\": [\n {\n \"id\": 5,\n \"from\": \"127.0.0.1\",\n \"created_at\": \"2018-12-10T19:34:23.442087Z\"\n }\n ],\n \"failures\": null\n}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "Delete Checkin",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "d3fdc6b9-d8ca-4634-a735-af8db0f31cef",
|
|
"exec": [
|
|
"pm.test(\"Response is ok\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Delete Checkin\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" var id = pm.globals.get(\"checkin_id\");",
|
|
" pm.expect(jsonData.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.type).to.eql(\"checkin\");",
|
|
" pm.expect(jsonData.method).to.eql(\"delete\");",
|
|
" pm.expect(jsonData.output.api_key).to.eql(id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"auth": {
|
|
"type": "bearer",
|
|
"bearer": [
|
|
{
|
|
"key": "token",
|
|
"value": "{{api_key}}",
|
|
"type": "string"
|
|
}
|
|
]
|
|
},
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkins/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkins",
|
|
"{{checkin_id}}"
|
|
]
|
|
},
|
|
"description": "Delete a checkin from database and stop failures from service not hitting the checkin URL."
|
|
},
|
|
"response": [
|
|
{
|
|
"name": "Delete Checkin",
|
|
"originalRequest": {
|
|
"method": "DELETE",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "raw",
|
|
"raw": ""
|
|
},
|
|
"url": {
|
|
"raw": "{{endpoint}}/api/checkin/{{checkin_id}}",
|
|
"host": [
|
|
"{{endpoint}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"checkin",
|
|
"{{checkin_id}}"
|
|
]
|
|
}
|
|
},
|
|
"status": "OK",
|
|
"code": 200,
|
|
"_postman_previewlanguage": "json",
|
|
"header": [
|
|
{
|
|
"key": "Content-Type",
|
|
"value": "application/json"
|
|
},
|
|
{
|
|
"key": "Date",
|
|
"value": "Mon, 10 Dec 2018 19:34:35 GMT"
|
|
},
|
|
{
|
|
"key": "Content-Length",
|
|
"value": "410"
|
|
}
|
|
],
|
|
"cookie": [],
|
|
"body": "{\n \"status\": \"success\",\n \"type\": \"checkin\",\n \"method\": \"delete\",\n \"id\": 5,\n \"output\": {\n \"id\": 5,\n \"service_id\": 2,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60,\n \"api_key\": \"1emn9ha\",\n \"created_at\": \"2018-12-10T19:34:10.991372Z\",\n \"updated_at\": \"2018-12-10T19:34:10.991372Z\",\n \"failing\": false,\n \"last_hit\": \"2018-12-10T11:34:23.443663-08:00\",\n \"hits\": [\n {\n \"id\": 5,\n \"from\": \"127.0.0.1\",\n \"created_at\": \"2018-12-10T19:34:23.442087Z\"\n }\n ],\n \"failures\": null\n }\n}"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "A Checkin is when a service communicates to your Statping instance rather than Statping attempting to hit your service. Checkin's have a scheduled interval that waits for your service to notify Statping, if your service does not hit the Checkin URL during the interval you set, it will result in a service failing notification.",
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "fefe9fc9-8020-41ec-b20f-dd2c5ad951e9",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "4a611b52-8ec2-4e26-8ed8-51f2729f93a1",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|