mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2024-12-18 20:57:56 +00:00
update swagger for recover stats, fix station parsing errors
This commit is contained in:
parent
6522af876c
commit
f97ed9ee56
@ -51,7 +51,10 @@ def lambda_handler(event, context):
|
||||
).total_seconds()
|
||||
except:
|
||||
pass
|
||||
payload = json.loads(event["body"])
|
||||
try:
|
||||
payload = json.loads(event["body"])
|
||||
except:
|
||||
return {"statusCode": 400, "body": "JSON decode issue"}
|
||||
print(payload)
|
||||
if "user-agent" in event["headers"]:
|
||||
event["time_server"] = datetime.datetime.now().isoformat()
|
||||
@ -63,7 +66,7 @@ def lambda_handler(event, context):
|
||||
|
||||
# clean up None reports
|
||||
|
||||
if "uploader_position" in payload and None in payload["uploader_position"]:
|
||||
if "uploader_position" in payload and None == payload["uploader_position"]:
|
||||
payload.pop("uploader_position", None)
|
||||
|
||||
if "uploader_position" in payload:
|
||||
@ -137,19 +140,7 @@ if __name__ == "__main__":
|
||||
"timeEpoch": 1612051825409,
|
||||
},
|
||||
"body": """
|
||||
{
|
||||
"software_name": "radiosonde_auto_rx",
|
||||
"software_version": "1.5.5",
|
||||
"uploader_callsign": "mwheeler",
|
||||
"uploader_position": [
|
||||
-37.8136,
|
||||
144.9631,
|
||||
90
|
||||
],
|
||||
"uploader_antenna": "mwheeler",
|
||||
"uploader_contact_email": "none@none.com",
|
||||
"mobile": false
|
||||
}
|
||||
{"software_name": "radiosonde_auto_rx", "software_version": "1.5.8-beta2", "uploader_callsign": "LZ3DJ-18", "uploader_position": null, "uploader_antenna": "Dipole", "uploader_contact_email": "none@none.com", "mobile": false}
|
||||
""",
|
||||
"isBase64Encoded": False,
|
||||
}
|
||||
|
58
swagger.yaml
58
swagger.yaml
@ -279,6 +279,40 @@ paths:
|
||||
description: Returns a list of recovery objects
|
||||
schema:
|
||||
$ref: "#/definitions/recovery_results_format"
|
||||
/recovered/stats:
|
||||
get:
|
||||
summary: Request Recovery Stats
|
||||
description: >
|
||||
Use this to get the recovery stats
|
||||
produces:
|
||||
- "application/json"
|
||||
parameters:
|
||||
- in: query
|
||||
name: lat
|
||||
type: number
|
||||
description: "Latitude - if specified, lon and distance are required. Eg: -34.9285"
|
||||
- in: query
|
||||
name: lon
|
||||
description: "Longitude - if specified, lat and distance are required Eg: 138.6007"
|
||||
type: number
|
||||
- in: query
|
||||
name: distance
|
||||
description: "Distance in meters - if specified, lat and lon are required"
|
||||
type: number
|
||||
- in: query
|
||||
name: duration
|
||||
description: "How far back to search in seconds. Defaults to foreverl"
|
||||
type: number
|
||||
- in: query
|
||||
name: datetime
|
||||
description: "End time to query as an ISO-8601 time string. Defaults to now. Example: `2021-02-02T11:27:38.634Z`"
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
200:
|
||||
description: Returns a list of recovery objects
|
||||
schema:
|
||||
$ref: "#/definitions/recovery_stats"
|
||||
/sites:
|
||||
get:
|
||||
description: Radiosonde launch sites
|
||||
@ -423,6 +457,30 @@ definitions:
|
||||
description:
|
||||
description: Description of the recovery effort
|
||||
type: string
|
||||
recovery_stats:
|
||||
type: object
|
||||
required:
|
||||
- total
|
||||
- recovered
|
||||
- failed
|
||||
- chaser_count
|
||||
- top_chasers
|
||||
properties:
|
||||
total:
|
||||
type: number
|
||||
description: Total number of serial numbers that have had at least one attempt
|
||||
recovered:
|
||||
description: Total number of serial numbers that have been recovered
|
||||
type: number
|
||||
failed:
|
||||
description: Total number of serial numbers that have a failed recovered attempt
|
||||
type: number
|
||||
chaser_count:
|
||||
description: Total number of unique recovery names
|
||||
type: number
|
||||
top_chasers:
|
||||
description: "chaser name : number of attempted recoveries"
|
||||
type: object
|
||||
sonde_query_results_format:
|
||||
type: object
|
||||
properties:
|
||||
|
Loading…
Reference in New Issue
Block a user