-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequests.http
More file actions
68 lines (58 loc) · 1.35 KB
/
requests.http
File metadata and controls
68 lines (58 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
### Get Health
GET http://localhost:8080/actuator/health
Content-Type: application/json
### Retrieve Stats
POST http://localhost:8080/v1/weather/stats
Content-Type: application/json
{
"metrics" : ["TEMPERATURE", "WINDSPEED"],
"statType" : "AVG",
"searchAllSensors" : true,
"startDate" : "2023-06-01",
"endDate" : "2023-06-09"
}
### Create a metric sample
POST http://localhost:8080/v1/weather/metrics
Content-Type: application/json
{
"sampleId": 3,
"sensorId": 2,
"metrics": [{
"metricType": "HUMIDITY",
"metricValue": 14.0
}, {
"metricType": "RAINFALL",
"metricValue": 18.0
},
{
"metricType": "TEMPERATURE",
"metricValue": 22.0
},
{
"metricType": "WINDSPEED",
"metricValue": 10.0
}]
}
### Get a metric sample by its ID
GET http://localhost:8080/v1/weather/metrics/3
Content-Type: application/json
### Get all metric samples
GET http://localhost:8080/v1/weather/metrics
Content-Type: application/json
### Delete a metric sample by its ID
DELETE http://localhost:8080/v1/weather/metrics/2
Content-Type: application/json
### Update a metric sample
PATCH http://localhost:8080/v1/weather/metrics
Content-Type: application/json
{
"sampleId": 1,
"sensorId": 2,
"metrics": [{
"metricType": "HUMIDITY",
"metricValue": 300.0
}, {
"metricType": "RAINFALL",
"metricValue": 400.0
}]
}