1
0
Fork 0
Commit Graph

48 Commits (5e03f7c759983c168331c99396163fed60fe533f)

Author SHA1 Message Date
Corey Shields 5e03f7c759 Epic API (doc) changes for SatNOGS DB
I've decided to change things up in API schema and doc generation.

Work is not quite complete but its enough for testing in dev and feedback.

Major changes:
* Renaming of api.view classes to match ViewSet inheritance (minor annoyance)
* Introduce drf-spectacular for schema generation and doc UI via swagger-ui
* lots of doc changes for the API to provide a good experience with the above.

New schema generation should work seamlessly in gitlab ci, as well as via /api/schema dynamically.

The new swagger ui view is available via /api/schema/docs/

Signed-off-by: Corey Shields <cshields@gmail.com>
2021-01-09 20:44:19 -05:00
Corey Shields 0fc7107172 Tighter exception handling
Removed most of the bare Exception catches and put proper errors to catch in their place.

Reworked a bit of the gridsquare calculation, any exceptions raised should now be handled within the function.

I am purposefully leaving the 2 W0703's we have for data demodulation alone for now, as that will be quite a rabbit hole. Otherwise,

fixes #316

Signed-off-by: Corey Shields <cshields@gmail.com>
2020-12-29 14:13:12 -05:00
Corey Shields 83f9b07e21 Updates for newer API / django rest framework
Update to Django Rest Framework 3.12.2 with improved schema generation.

However, it is still not quite complete for what we need (and what we currently postprocess for). Instead of postprocessing, this commit introduces our own extended generator to add the missing fields.

Once this is vetted good, we can remove contrib/postprocess-openapi-schema.py 

Also added better comments to api/views.py which will end up in schema docs

Signed-off-by: Corey Shields <cshields@gmail.com>
2020-12-29 07:48:58 -05:00
Vasilis Tsiligiannis f85273a592 isort: Fix line length configuration
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2020-09-29 00:19:55 +03:00
Alfredos-Panagiotis Damkalis f53d240f5b Generate observer in DemodData object in api/view
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-09-28 12:08:21 +03:00
Alfredos-Panagiotis Damkalis 6a12f76a26 Remove LatestTle model and introduce LatestTleSet model
LatestTle model was a proxy model on Tle one, using it for API adds a
significant delay to respond on the API requests. For this reason
LatestTle model is removed and LatestTleSet model takes its place.

LatestTleSet is updated asynchronously and keeping references to
latest TLE sets of Tle model. This allows to retrieve the TLE sets
faster.

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-09-22 17:37:55 +03:00
Alfredos-Panagiotis Damkalis dd10892eaf Use new model for TLE sets
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-09-15 21:05:43 +03:00
Corey Shields 3af17917ba docstring fix
small docstring fix, we are not moving toward any 'purchases' :)

Signed-off-by: Corey Shields <cshields@gmail.com>
2020-09-12 13:16:52 -04:00
Alfredos-Panagiotis Damkalis f18140e153 Add distribution logic on TLE model and API endpoint
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-08-11 15:11:51 +03:00
Alfredos-Panagiotis Damkalis e1b859887f Add API endpoint for TLE
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-08-11 15:11:51 +03:00
Corey Shields 07a4904ff8 Move recent_decoded_cnt to ajax view
Move the new recent_decoded_cnt out of api and into the base view

fixes #398

Signed-off-by: Corey Shields <cshields@gmail.com>
2020-08-06 18:14:08 -04:00
Corey Shields 3149c91e56 Add decoded data recent history chart to satellite view
Adds a chart card showing the last month of decoded data as currently stored in influxdb.

Unfortunately there's no native way to count the number of 'entries' for a measurement across a given time, so we have to do a count(*) across all points. This returns a blob of <timestamp>, <count(pointa)>, <count(pointb)>, <...> and in almost (but not all) cases those counts will be identical but we have to account for it not, so I iterate over each timestamp (client side) and take the max count to assign to that point in time. Since we are doing a 30d query from influx with 1d aggregation this should not be too intensive.

Also cleaned up the coloring of the profile link buttons.

Signed-off-by: Corey Shields <cshields@gmail.com>
2020-08-04 08:33:22 -04:00
Alfredos-Panagiotis Damkalis 8c319bfe62 Add browsable API for jsonld format
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-07-16 06:26:23 +03:00
Alfredos-Panagiotis Damkalis 6094847432 Fix python warnings
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-07-13 13:32:45 +03:00
Alfredos-Panagiotis Damkalis 67f229d2ed Add json-ld format on API endpoints
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-07-01 17:14:46 +03:00
deckbsd ef1c4313aa Remove python3 migration remnants
Signed-off-by: Julien Flawinne <jf.satnogs at protonmail dot com>
2020-05-27 20:54:39 +02:00
Pierros Papadeas d8aef58025 Add artifact model and API endpoint for new waterfall artifacts
Signed-off-by: Pierros Papadeas <pierros@papadeas.gr>
2020-05-20 19:42:31 +03:00
Alfredos-Panagiotis Damkalis 4b721a4488 Use API Key for accessing telemetry API endpoint
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-14 03:45:31 +02:00
Corey Shields f80f207c78 Flake and isort fixes
Fix some spacing issues and import syntax introduced by my linting changes.

The inline pylint disable for C0412 clashes with isort, there is no combination there that works for both.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:55:20 -04:00
Corey Shields 8271351729 Linting for R0901
Ignoring cases of too many ancestors in API views.py as these are upstream, not much we can do about it.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:22:41 -04:00
Corey Shields 2ec2fd2a4d pylint C0111 docstrings
phew, fixed all of the missing-docstring and found some other things along the way (for future changes)
2019-07-12 22:36:18 -04:00
Corey Shields d4fb5189d1 future imports and remove unicode strings
adds from __future__ import unicode_literals, absolute_import, division, print_function to all files, removes unicode strings from RTD conf.py (none other were found in our codebase)

See also https://docs.djangoproject.com/en/1.11/topics/python3/#unicode-literals

fixes #290

tested locally in docker
2019-06-30 19:23:55 -04:00
Vasilis Tsiligiannis 4bb87e2e6a isort: Do not skip install in order to correctly detect third-party imports
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-05-09 20:49:10 +03:00
Vasilis Tsiligiannis 655f98f39c Use 'isort' to fix order of imports
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-04-27 14:08:11 +03:00
Vasilis Tsiligiannis 140180b6b3 Reformat code with 'yapf', check format using 'tox'
Use configration based on Django coding style guidelines

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-04-27 12:32:33 +03:00
Corey Shields ff21847b52 rename demoddata.source to demoddata.app_source
We have a field in demoddata called "source" which stores the application source of the data (network, sids, manual). This causes a lot of confusion with the SiDS API format which has a "source" parameter (that we convert to "station")

As I'm working through documenting the API (and getting us ready for feature expansion), I'd like this field renamed to avoid future confusion.
2019-04-20 19:15:29 -04:00
Alfredos-Panagiotis Damkalis 5b7814000c Fix telemetry API methods 2019-04-19 18:53:21 +03:00
Corey Shields f43c387e2d fixing db api 2019-04-17 21:55:15 -07:00
Pierros Papadeas 6d5e1db09c
Add decayed field in Satellite model 2019-01-19 19:27:48 +02:00
Fabian P. Schmidt bfef1527de api/views: Use queryset exists syntax instead of exception handling 2019-01-01 22:03:55 +01:00
Corey Shields ccc18b6c29 fix for sentry 804899643
Signed-off-by: Corey Shields <cshields@gmail.com>
2018-12-12 13:09:27 -05:00
Fabian P. Schmidt c405f781c4 Add additional TLE sources via python-satellitetle 2018-11-29 20:04:19 +00:00
Corey Shields 9cc9c352f5 DB changes to allow for network-sourced sids submissions 2018-09-03 14:19:42 -04:00
Nikos Roussos fac8572c7b
Create missing Satellite on API call 2017-11-24 22:58:09 +01:00
Nikos Roussos 7521780bcb
Fix coordinates parsing on API 2017-11-13 12:33:17 +02:00
Nikos Roussos 28c80a2344
Fix location on Telemetry endpoint 2017-04-06 18:05:54 +03:00
Nikos Roussos 3da2647a0d
Limit API pagination to Telemetry endpoint 2017-03-26 17:07:54 +03:00
Nikos Roussos 0eeeb4cb88
Don't include posted data to API response 2017-03-25 18:30:42 +02:00
Nikos Roussos 74002958f2
API endpoint for SiDS submission 2017-03-02 19:56:42 +02:00
Nikos Roussos afcaf5493c Create API endpoint for decoded telemetry data 2016-05-08 18:44:22 +03:00
Nikos Roussos 473727e309 Add Modes to the API 2015-08-13 15:57:04 +03:00
Nikos Roussos b433bc6238 s/transponders/transmitters 2015-07-23 15:48:58 +03:00
Nikos Roussos 1424fd3a2b Use significant fields as API lookup detail fields 2015-07-20 21:21:45 +03:00
Nikos Roussos 34ba268e5b Add API filtering 2015-07-20 21:21:44 +03:00
Nikos Roussos 3f300c4fed Expose norad_cat_id to API for Transponders 2015-05-07 11:28:03 +03:00
Nikos Roussos 0350e464e4 Expose Satellites on API 2015-05-03 23:23:07 +02:00
Nikos Roussos 1befe28bb1 Expose Transponders only to API 2015-04-25 18:17:59 +03:00
Nikos Roussos 6828eb315b Initial commit 2015-04-22 18:10:13 +03:00