REST API
The REST API lets you interact with the ASCOT backend. You can create and read datasets, create new dashboards and load data on them.
Create DataSets
There are two ways you can create new data sets:
-
Provide a list of records
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name": "Stars", "records": [{"ra":"132.82279455","dec":"11.75623274","modelMag_u":"16.483011"},{"objid":"1237671262272290962","ra":"132.84498644","dec":"11.80053042","modelMag_u":"15.75631"}]}' http://localhost/dataSet/
-
Provide a query to one of the data sources
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name": "Stars", "source": "sdss", "query":"SELECT TOP 500 ra, dec, modelMag_u, modelMag_g from Star where modelMag_g > -9999"}' http://{pathToASCOT}/dataSet/
Read DataSets
-
Request a data set in JSON format:
curl http://{pathToASCOT}/dataSet/{dataSetID#}
Create Dashboards
- Send a dashboard configuration to the server in JSON format: curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"gadgets": {"dataInquirer": {"number":1},"dataSetSelector": {"number":1},"histogramView": {"number":1}}}' http://localhost/dashboard/