You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

We have the initial version of the OSS Database REST API up and running and Daniel is populating the database with it from his VLA OSS data sender.  

The API will provide information about all upcoming observation sources (scans?)  It does this by fetching records from the database whose 'src_end_utc' > now().

The API also provides a mechanism for adding information to the database without having to know about the database itself.  

The API has not been exposed outside of NRAO networks yet.

The REST URLs for getting and putting data to the OSS are explained here:

Getting OSS Data from the database:

The data is sent from the database as an array of JSON objects where each object contains information about a single observation source.  Information from all sites is sent in the same response and the information is sorted by by 'src_start_utc'

To get all database entries with a src_end_utc greater than now:

http://wirth.aoc.nrao.edu:8191/oss_data

Example Response:

{"oss_data":[

{"notes":"inAdv:True","src_id":"3C147","src_ra":85.65057465,"site_id":"vla","src_dec":49.85200932222222,"freq_lower":4000000000,"freq_upper":8000000000,"src_end_utc":"2023-06-28T14:00:06.000103","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T13:51:09.000048","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115},

{"notes":"inAdv:True","src_id":"3C147","src_ra":85.65057465,"site_id":"vla","src_dec":49.85200932222222,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:01:05.000776","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:00:06.000103","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115},

{"notes":"inAdv:True","src_id":"3C147","src_ra":85.65057465,"site_id":"vla","src_dec":49.85200932222222,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:06:04.000140","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:01:05.000776","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115},

{"notes":"inAdv:True","src_id":"J0555+3948","src_ra":88.8783567,"site_id":"vla","src_dec":39.813656944444446,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:11:02.000504","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:06:04.000140","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115},

{"notes":"inAdv:True","src_id":"FRB121102A","src_ra":82.99458333333334,"site_id":"vla","src_dec":33.14791666666667,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:22:48.000632","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:11:02.000504","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115}

]}

If there is no data to fetch the response will be an empty array:

{"oss_data":[]}

Adding OSS data to the database

Data is added one row at a time; each row provides the antenna information for a single observation source.

There are two ways to add a row to the database.

1) HTTP GET where the JSON is in the URL:

http://wirth.aoc.nrao.edu:8191/oss_put?{"notes":"inAdv:True","src_id":"FRB121102A","src_ra":82.99458333333334,"site_id":"vla","src_dec":33.14791666666667,"freq_lower":1000000000,"freq_upper":2000000000,"src_end_utc":"2023-06-28T14:22:48.000632","trk_rate_ra":0,"trk_rate_dec":0,"src_start_utc":"2023-06-28T14:11:02.000504","site_lat":34.07861,"site_lon":-107.61806,"site_elev":2115}]}

You can enter that URL into a Web Browser and it will add the row to the database.  Note, if you send the URL from your own program, you'll likely have to URL Encode it.

2) HTTP POST where the JSON is in the HTTP Request body:

http://wirth.aoc.nrao.edu:8191/oss_put

If the PUTs worked properly, you should get the following JSON response:

{"oss_response":"INSERTed 1 row(s)"}

If not, you should get some sort of error message (in a JSON object).

  • No labels