diff --git a/README.md b/README.md index 2e1022c31..dfc57064d 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ BlueWave uptime monitoring application - POST [/api/v1/checks/{monitorId}](#post-checks) - GET [/api/v1/checks/{monitorId}](#get-checks) - POST [/api/v1/checks/delete/{monitorId}](#delete-checks) + ###### Alerts + - POST [/api/v1/alerts/{monitorId}](#create-alert) + - GET [/api/v1/alerts/user/{userId}](#get-alerts-user-id) + - GET [/api/v1/alerts/monitor/{monitorId}](#get-alerts-monitor-id) + - GET [/api/v1/alerts/{alertId}](#get-alert-alert-id) + - POST [/api/v1/alerts/edit/{alertId}](#edit-alert) + - POST [/api/v1/alerts/delete/{alertId}](#delete-alert) 5. [Error Handling](#error-handling) 6. [Contributors](#contributors) @@ -333,9 +340,9 @@ curl --request POST \ ##### Response Payload -> | Type | Notes | -> | ---------------- | ----------------- | -> | `Array[Monitor]` | Array of monitors | +> | Type | Notes | +> | ---------------- | --------------------- | +> | `Array` | Array of all monitors | ###### Sample cURL Request @@ -439,9 +446,9 @@ curl --request GET \ ###### Response Payload -> | Type | Notes | -> | ---------------- | ------------------------------------------------------------------ | -> | `Array[Monitor]` | Array of monitors created by user with userId specified in request | +> | Type | Notes | +> | ---------------- | ------------------------------------------------------- | +> | `Array` | Array of monitors created by user with specified UserID | ###### Sample cURL Request @@ -499,9 +506,9 @@ curl --request GET \ ###### Response Payload -> | Type | Notes | -> | --------- | --------------------------------- | -> | `Monitor` | Newly created monitor is returned | +> | Type | Notes | +> | --------- | ------------------------------- | +> | `Monitor` | Returns newly created `Monitor` | ##### Sample CURL request @@ -681,7 +688,7 @@ curl --request POST \ > | Type | Notes | > | --------------- | ------------------------ | -> | `Array[Checks]` | Array of `Check` objects | +> | `Array` | Array of `Check` objects | ##### Sample CURL request @@ -730,6 +737,188 @@ curl --request POST \ --- +###### Alerts + +
+POST/api/v1/alerts/{monitorId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | POST | + +###### Response Payload + +> | Type | Notes | +> | ------- | ----------------------------- | +> | `Alert` | Returns newly created `Alert` | + +###### Body + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+ +
+GET/api/v1/alerts/user/{userId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | GET | + +###### Response Payload + +> | Type | Notes | +> | -------------- | --------------------------------------- | +> | `Array` | Returns all `Alert` created by a `User` | + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+
+GET/api/v1/alerts/monitor/{monitorId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | GET | + +###### Response Payload + +> | Type | Notes | +> | -------------- | -------------------------------------------------------------- | +> | `Array` | Returns an array of `Alert` belonging to a specified `Monitor` | + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+ +
+GET/api/v1/alerts/{alertId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | GET | + +###### Response Payload + +> | Type | Notes | +> | ------- | ------------------------- | +> | `Alert` | Returns specified `Alert` | + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+ +
+POST/api/v1/alerts/edit/{alertId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | POST | + +###### Response Payload + +> | Type | Notes | +> | ------- | -------------------- | +> | `Alert` | Returns edited alert | + +###### Body + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+
+POST/api/v1/alerts/delete/{alertId} + +###### Method/Headers + +> | Method/Headers | Value | +> | -------------- | ----- | +> | Method | POST | + +###### Response Payload + +> | Type | Notes | +> | ---- | ------------------- | +> | None | No payload returned | + +###### Body + +##### Sample CURL request + +``` + +``` + +###### Sample Response + +```json + +``` + +
+ +--- + ### Error handling {#error-handling} Errors are returned in a standard format: