mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2024-12-21 06:03:11 +00:00
add chase only
This commit is contained in:
parent
2f34d42df2
commit
4d8fda7441
@ -225,7 +225,8 @@ def datanew(event, context):
|
||||
else:
|
||||
lt = datetime.now(timezone.utc)
|
||||
gte = datetime.now(timezone.utc) - timedelta(0, duration)
|
||||
|
||||
output = {"positions": {"position": []}}
|
||||
if "chase_only" not in event["queryStringParameters"] or event["queryStringParameters"]["chase_only"] != "true":
|
||||
path = "telm-*/_search"
|
||||
payload = {
|
||||
"aggs": {
|
||||
@ -282,7 +283,7 @@ def datanew(event, context):
|
||||
)
|
||||
results = es_request(payload, path, "POST")
|
||||
|
||||
output = {"positions": {"position": []}}
|
||||
|
||||
|
||||
for sonde in results["aggregations"]["2"]["buckets"]:
|
||||
for frame in sonde["3"]["buckets"]:
|
||||
@ -569,12 +570,13 @@ if __name__ == "__main__":
|
||||
# position_id: 0
|
||||
# vehicles: RS_*;*chase
|
||||
print(
|
||||
get_listeners(
|
||||
datanew(
|
||||
{
|
||||
"queryStringParameters": {
|
||||
"type" : "positions",
|
||||
"mode": "1hour",
|
||||
"position_id": "0"
|
||||
"mode": "6hours",
|
||||
"position_id": "0",
|
||||
"chase_only": "true"
|
||||
}
|
||||
},
|
||||
{},
|
||||
|
@ -223,6 +223,13 @@ paths:
|
||||
- "6hours"
|
||||
- "3hours"
|
||||
- "1hour"
|
||||
- in: query
|
||||
name: chase_only
|
||||
type: string
|
||||
description: Return only chase cars
|
||||
enum:
|
||||
- "true"
|
||||
- "false"
|
||||
- in: query
|
||||
name: vehicles
|
||||
type: string
|
||||
|
Loading…
Reference in New Issue
Block a user