mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-02-21 09:21:46 +00:00
switch to reader endpoint for websockets, get_telem single point, update swagger
This commit is contained in:
parent
b64ee72dbd
commit
b14ea4754d
@ -98,7 +98,8 @@ def get_telem(event, context):
|
|||||||
"1h": (3600, 15),
|
"1h": (3600, 15),
|
||||||
"30m": (3600, 5),
|
"30m": (3600, 5),
|
||||||
"1m": (60, 1),
|
"1m": (60, 1),
|
||||||
"15s": (15, 1)
|
"15s": (15, 1),
|
||||||
|
"0": (0, 1) # for getting a single time point
|
||||||
}
|
}
|
||||||
duration_query = "3h"
|
duration_query = "3h"
|
||||||
requested_time = datetime.now(timezone.utc)
|
requested_time = datetime.now(timezone.utc)
|
||||||
@ -123,7 +124,7 @@ def get_telem(event, context):
|
|||||||
(duration, interval) = durations[duration_query]
|
(duration, interval) = durations[duration_query]
|
||||||
if "serial" in event["queryStringParameters"]:
|
if "serial" in event["queryStringParameters"]:
|
||||||
interval = 1
|
interval = 1
|
||||||
lt = requested_time
|
lt = requested_time + timedelta(0, 1)
|
||||||
gte = requested_time - timedelta(0, duration)
|
gte = requested_time - timedelta(0, duration)
|
||||||
|
|
||||||
path = "telm-*/_search"
|
path = "telm-*/_search"
|
||||||
@ -816,7 +817,9 @@ if __name__ == "__main__":
|
|||||||
get_telem(
|
get_telem(
|
||||||
{
|
{
|
||||||
"queryStringParameters":{
|
"queryStringParameters":{
|
||||||
"serial": "S2440723"
|
"serial": "S3210639",
|
||||||
|
"duration": "0",
|
||||||
|
"datetime": "2021-07-26T06:49:29.001000Z"
|
||||||
}
|
}
|
||||||
}, {}
|
}, {}
|
||||||
)
|
)
|
||||||
|
@ -7,7 +7,7 @@ import os
|
|||||||
|
|
||||||
def lambda_handler(event, context):
|
def lambda_handler(event, context):
|
||||||
|
|
||||||
return {"statusCode": 200, "body": "wss://ws.v2.sondehub.org/"}
|
return {"statusCode": 200, "body": "wss://ws-reader.v2.sondehub.org/"}
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(lambda_handler({}, {}))
|
print(lambda_handler({}, {}))
|
@ -54,6 +54,11 @@ paths:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
|
- "0"
|
||||||
|
- "15s"
|
||||||
|
- "1m"
|
||||||
|
- "30m"
|
||||||
|
- "1h"
|
||||||
- "3h"
|
- "3h"
|
||||||
- "6h"
|
- "6h"
|
||||||
- "1d"
|
- "1d"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user