This document contains various proposals how the FLARECAST REST API could look like The idea is that all algorithms communicate through REST URLs with the databases.
URLs are used to create, read, update and delete records (CRUD). As data exchange format we propose to use JSON. JSON can be natively read by many programming languages, such as Python, IDL, Java, JavaScript, ...
This document does not contain a normative definition of the API, but rather examples that can be used for further discussions.
As illustrated in the Architecture overview the FLARECAST infrastructure consists of several databases. All of these databases store different types of resources.
Database | Resource |
---|---|
Data Archive | Observation (e.g. FITS-Files) |
Staging Table | Event, ... (e.g. Event lists) |
Feature Property Database | Feature (such as Active Regions), FeatureProperty (e.g. Area, Contour, Zurich-Class, ...) |
Predictions Config DB | Scalars, Vectors, Matrices (e.g. Algo-Configurations) |
Prediction DB | ? |
Infrastructure Configuration DB | Algorithm, Person, |
Resources
Anything accessible through the API is a "resource". All available resources can be listed.
Get list of observation types | ||||||
---|---|---|---|---|---|---|
Query | https://api.flarecast.eu/resources/list | |||||
Result |
|
File Archive (observations)
The file archive is basically a directory structure from where the files can be loaded either through the file:// protocol or (preferably) the http:// protocol.
Get list of observation types | ||||||
---|---|---|---|---|---|---|
Query | ||||||
Result |
|
Search for files | ||||||
---|---|---|---|---|---|---|
Query | https://api.flarecast.eu/observations/sdo/hmi/list?timerange=20150101T000000.0-20150101T120000.0 | |||||
Result |
|
Feature Properties
Get list of features | ||||||
---|---|---|---|---|---|---|
Query | https://api.flarecast.eu/features/list | |||||
Result |
|
Template | ||||||
---|---|---|---|---|---|---|
Query | https://api.flarecast.eu/features/query?time_begin=20150101T000000.0&time_end=20150101T000000.0&fields=id,timestamp,area,contour | |||||
Result |
|
Template
Template | ||||||
---|---|---|---|---|---|---|
Query | ||||||
Result |
|
Standards
The following standards should be considered.
- Dates should be in ISO 8601
- Date/Time formats should follow http://www.w3.org/TR/NOTE-datetime
- URI Templates: https://tools.ietf.org/html/rfc6570
- IANA link relations: http://www.iana.org/assignments/link-relations/link-relations.xhtml
Documentation
The current REST API is defined in Deliverables - 640216_Database schema for active region properties and associated flare events.pdf