Feat/monitor endpoint refactor (#463)
* Moved all methods to modules * removed old mongoDB file * Refactored endpoints to take query params, removed duplicate methods, updated routes, updated Client queries * Added comment * Add model differentiation * Add sort order, fix minor bug, add validation for query params
This commit is contained in:
1 parent
e47d3685ce
commit
477cad7cc9
11 files changed
+132
-166
No files matched your search
@@ -6,16 +6,12 @@
|
||||

|
||||

|
||||
|
||||
|
||||
<h1 align="center"><a href="https://bluewavelabs.ca" target="_blank">BlueWave Uptime</a></h1>
|
||||
|
||||
<p align="center"><strong>An open source server monitoring application</strong></p>
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
BlueWave Uptime is an open source server monitoring application used to track the operational status and performance of servers and websites. It regularly checks whether a server/website is accessible and performs optimally, providing real-time alerts and reports on the monitored services' availability, downtime, and response time.
|
||||
|
||||
## Contributing
|
||||
@@ -776,7 +772,7 @@ curl --request GET \
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary id='get-monitor-id'><code>GET</code> <b>/api/v1/monitor/{id}</b></summary>
|
||||
<summary id='get-monitor-id'><code>GET</code> <b>/api/v1/monitor/{id}?status</b></summary>
|
||||
|
||||
###### Method/Headers
|
||||
|
||||
@@ -785,6 +781,14 @@ curl --request GET \
|
||||
> | Method | GET |
|
||||
> | content-type | application/json |
|
||||
|
||||
###### Query Params
|
||||
|
||||
> | Name | Type | Required | Notes |
|
||||
> | --------- | --------- | -------- | ------------------------------------------------ |
|
||||
> | status | `boolean` | Optional | Check status |
|
||||
> | limit | `number` | Optional | Number of checks to return |
|
||||
> | sortOrder | `string` | Optional | `desc`:Newest -> Oldest, `asc`: Oldest -> Newest |
|
||||
|
||||
###### Response Payload
|
||||
|
||||
> | Type | Notes |
|
||||
@@ -795,7 +799,7 @@ curl --request GET \
|
||||
|
||||
```
|
||||
curl --request GET \
|
||||
--url http://localhost:5000/api/v1/monitors/664d070786e62625ac612ca1 \
|
||||
--url http://localhost:5000/api/v1/monitors/664d070786e62625ac612ca1?status=true?limit=0 \
|
||||
--header '<bearer_token>' \
|
||||
```
|
||||
|
||||
@@ -857,6 +861,15 @@ curl --request GET \
|
||||
> | Method | GET |
|
||||
> | content-type | application/json |
|
||||
|
||||
###### Query Params
|
||||
|
||||
> | Name | Type | Required | Notes |
|
||||
> | --------- | --------- | -------- | ------------------------------------------------- |
|
||||
> | status | `boolean` | Optional | Check status |
|
||||
> | type | `string` | Optional | Multiple allowed: `http` \| `ping` \| `pagespeed` |
|
||||
> | limit | `number` | Optional | Monitor status |
|
||||
> | sortOrder | `string` | Optional | `desc`:Newest -> Oldest, `asc`: Oldest -> Newest |
|
||||
|
||||
###### Response Payload
|
||||
|
||||
> | Type | Notes |
|
||||
|
||||
Reference in new issue
Block a user