Commit 6185ceeba7d5793484f2946f8d88782150051542

Authored by Myriam Bouchemit
1 parent 7ac2915f

update for apidoc

php/rest/apidoc.json
... ... @@ -2,6 +2,6 @@
2 2 "name": "AMDA web-services Rest API",
3 3 "description": "The web-services provided by AMDA aim at giving to a user access public data as well as its private data. These data may be private or shared Time Tables, public or user-defined parameters. All these webservices are also available through a SOAP interface.",
4 4 "title": "AMDA Web-services Rest API documentation",
5   - "url": "{:REST_API_URL:}/php/rest/",
6   - "sampleUrl": "{:REST_API_URL:}/php/rest/"
  5 + "url": "http://amda.irap.omp.eu/php/rest/",
  6 + "sampleUrl": "http://amda.irap.omp.eu/php/rest/"
7 7 }
... ...
php/rest/auth.php
... ... @@ -2,7 +2,7 @@
2 2  
3 3 /**
4 4 * @api {get} auth.php auth
5   - * @apiDescription Returns a token to use as an API parameter for *getParameter*, *getOrbites* and *getTimeTable*.
  5 + * @apiDescription Returns a token to use as an API parameter for *getDataset*, *getOrbites* and *getParameter*.
6 6 * @apiName auth
7 7 * @apiGroup webservices
8 8 *
... ...
php/rest/getDataset.php
... ... @@ -2,9 +2,34 @@
2 2  
3 3 /**
4 4 * @api {get} getDataset.php getDataset
5   - * @apiDescription Returns a token to use as an API parameter for *getParameter*, *getOrbites* and *getTimeTable*.
  5 + * @apiDescription Provides data corresponding to a dataset chosen by the user among those available in AMDA
6 6 * @apiName getDataset
7 7 * @apiGroup webservices
  8 + *
  9 + * @apiParam {String} token The API token.
  10 + * @apiParam {String} startTime Beginning of the time interval (ISO 8601 or UNIXTIME format).
  11 + * @apiParam {String} stopTime End of the time interval (ISO 8601 or UNIXTIME format).
  12 + * @apiParam {String} datasetID Identifier of the dataset, as defined in the file returned by the *getObsDataTree* web-services.
  13 + * @apiParam {String} [sampling] Sampling of data (*in seconds*).
  14 + * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
  15 + * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
  16 + * @apiParam {String} [outputFormat] Format of the returned file. Two options: `VOTable` and `ASCII`.
  17 + * @apiParam {String} [timeFormat] Format of time in the data files. Two options: `ISO8601` and `UNIXTIME`.
  18 + * @apiParam {String} [gzip] `1` if the file must be compressed before delivery.
  19 + *
  20 + * @apiParamExample
  21 +
  22 + * @apiSuccess {String} success `true`
  23 + * @apiSuccess {String} dataFileURLs URL of the files matching the criteria. If the file is empty, there is no data
  24 + * matching these criteria.
  25 + *
  26 + * @apiSuccessExample
  27 + * HTTP/1.1 200 OK
  28 + * http://amda.irap.omp.eu/AMDA/data/WSRESULT/getdataset_ace-imf-all_20130923T090000_20130924T130000.txt
  29 + *
  30 + * @apiErrorExample
  31 + * {"error":"Cannot find info file for dataset ace-imf-any"}
  32 +
8 33 */
9 34  
10 35 //ini_set("allow_url_fopen", true);
... ...
php/rest/getObsDataTree.php
... ... @@ -7,19 +7,15 @@
7 7 * @apiGroup webservices
8 8 *
9 9 * @apiSuccess {String} success true.
10   - * @apiSuccess {String} workspace URLs of the XML files containing the list of "public" parameters in AMDA.
  10 + * @apiSuccess {String} workspace URL of the XML file containing the list of "public" parameters in AMDA.
  11 + *
11 12 *
12   - * @apiError {String} success false.
13   - * @apiError {String} faultcode The error code.
14   - * @apiError {String} faultstring The error message.
15   -
16 13 * @apiSuccessExample Success-Response:
17 14 * HTTP/1.1 200 OK
18 15 * http://amda.irap.omp.eu/AMDA/data/WSRESULT/obsdatatree_impex_20180727_AmdaLocalDataBaseParameters.xml
19 16 *
20 17 * @apiErrorExample
21   - * HTTP/1.1 200 OK
22   - * {"success":false,"faultcode":"server00","faultstring":"Server error"}
  18 + * {"error":"No Amda Local DataBase Parameters description file"}
23 19 */
24 20  
25 21 require_once '../config.php';
... ...
php/rest/getOrbites.php
... ... @@ -9,6 +9,7 @@
9 9 * @apiName getOrbites
10 10 * @apiGroup webservices
11 11 *
  12 + * @apiParam {String} token The API token.
12 13 * @apiParam {String} startTime Beginning of the time interval (ISO 8601 or UNIXTIME format).
13 14 * @apiParam {String} stopTime End of the time interval (ISO 8601 or UNIXTIME format)
14 15 * @apiParam {String} spacecraft Name of the spacecraft. Possible values: "ACE", "CASSINI", "CLUSTER1", "CLUSTER2",
... ... @@ -24,24 +25,20 @@
24 25 * "Rga", "Rio", "Reu", "Rv", "Rm", "Re", "AU".
25 26 * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
26 27 * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
27   - * @apiParam {String} [gzip] "1" if the file must be compressed before delivery
28 28 * @apiParam {String} [outputFormat] Format of the returned file. Two options: "VOTable", "ASCII".
29 29 * @apiParam {String} [timeFormat] Format of time in the data files. Two options: "ISO8601", "UNIXTIME".
  30 + * @apiParam {String} [gzip] "1" if the file must be compressed before delivery
30 31 *
31 32 * @apiSuccess {String} success `true`
32 33 * @apiSuccess {String} url_XYZ URL of the file containing the points.
33 34 *
34   - * @apiError {String} success `false`
35   - * @apiError {String} faultcode The error code.
36   - * @apiError {String} faultstring The error message.
37 35  
38 36 * @apiSuccessExample Success-Response:
39 37 * HTTP/1.1 200 OK
40   - * http://amda.irap.omp.eu/AMDA/data/WSRESULT/obsdatatree_impex_20180727_AmdaLocalDataBaseParameters.xml
  38 + * http://amda.irap.omp.eu/AMDA//data/WSRESULT/getorbites_ace_xyz_gse_km_20130923T090000_20130924T130000.txt
41 39 *
42 40 * @apiErrorExample
43   - * HTTP/1.1 4xx OK
44   - * {"success":false,"faultcode":"server00","faultstring":"Server error"}
  41 + * {"error":"Cannot find orbit data for ACE1 for 2013-09-23T09:00-2013-09-24T13:00 in km GSE( - )"}
45 42 */
46 43  
47 44 require_once '../config.php';
... ...
php/rest/getParameter.php
... ... @@ -7,6 +7,7 @@
7 7 * @apiName getParameter
8 8 * @apiGroup webservices
9 9 *
  10 + * @apiParam {String} token The API token.
10 11 * @apiParam {String} startTime Beginning of the time interval (ISO 8601 or UNIXTIME format).
11 12 * @apiParam {String} stopTime End of the time interval (ISO 8601 or UNIXTIME format).
12 13 * @apiParam {String} parameterID Identifier of the parameter, as defined in the file returned by the *getParameterList*
... ... @@ -14,9 +15,9 @@
14 15 * @apiParam {String} [sampling] Sampling of data (*in seconds*).
15 16 * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
16 17 * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
17   - * @apiParam {String} [gzip] `1` if the file must be compressed before delivery.
18 18 * @apiParam {String} [outputFormat] Format of the returned file. Two options: `VOTable` and `ASCII`.
19 19 * @apiParam {String} [timeFormat] Format of time in the data files. Two options: `ISO8601` and `UNIXTIME`.
  20 + * @apiParam {String} [gzip] `1` if the file must be compressed before delivery.
20 21 *
21 22 * @apiParamExample
22 23  
... ... @@ -24,17 +25,12 @@
24 25 * @apiSuccess {String} dataFileURLs URL of the files matching the criteria. If the file is empty, there is no data
25 26 * matching these criteria.
26 27 *
27   - * @apiError {String} success `false`
28   - * @apiError {String} faultcode The error code.
29   - * @apiError {String} faultstring The error message.
30   - *
31 28 * @apiSuccessExample
32 29 * HTTP/1.1 200 OK
33   - * http://cdpp1.cesr.fr/AMDA/data/WSRESULT/b_it-821664000-821750400-.xml
  30 + * http://amda.irap.omp.eu/AMDA/data/WSRESULT/getparameter_c1_hia_dens_20130923T090000_20130924T130000.txt
34 31 *
35 32 * @apiErrorExample
36   - * HTTP/1.1 4xx OK
37   - * {"success":false,"faultcode":"server00","faultstring":"Server error"}
  33 + * {"error":"Exception detected : Cannot find parameter local file c1_hia_dens1"}
38 34  
39 35 */
40 36  
... ...
php/rest/getParameterList.php
... ... @@ -2,7 +2,7 @@
2 2  
3 3 /**
4 4 * @api {get} getParameterList.php getParameterList
5   - * @apiDescription Provides the hierarchy of parameters belonging to a user in AMDA.
  5 + * @apiDescription Provides the hierarchy of derived parameters belonging to a user and parameters in AMDA.
6 6 * @apiName getParameterList
7 7 * @apiGroup webservices
8 8 *
... ... @@ -10,19 +10,15 @@
10 10 * @apiParam {String} password password of the user in AMDA.
11 11 *
12 12 * @apiSuccess {String} success `true`
13   - * @apiSuccess {String} url_XYZ URL of the file containing the points.
  13 + * @apiSuccess {String} URL of the XML file, which contains the list of derived parameters and parameters in AMDA
14 14 *
15   - * @apiError {String} success `false`
16   - * @apiError {String} faultcode The error code.
17   - * @apiError {String} faultstring The error message.
18 15  
19 16 * @apiSuccessExample Success-Response:
20 17 * HTTP/1.1 200 OK
21   - * http://amda.irap.omp.eu/AMDA/data/WSRESULT/obsdatatree_impex_20180727_AmdaLocalDataBaseParameters.xml
  18 + * http://amda.irap.omp.eu/AMDA//data/WSRESULT/parameterlist_impex_20180912_AmdaLocalDataBaseParameters.xml
22 19 *
23 20 * @apiErrorExample
24   - * HTTP/1.1 4xx OK
25   - * {"success":false,"faultcode":"server00","faultstring":"Server error"}
  21 + * {"error":"Login procedure failed for impex1 : Check your password"}
26 22 */
27 23  
28 24 require_once '../config.php';
... ...
php/rest/getStatus.php
... ... @@ -11,16 +11,14 @@
11 11 * @apiSuccess {String} success `true`
12 12 * @apiSuccess {String} [dataFileURLs] URLs of results data files. If no URLs - no data for required parameters.
13 13 * @apiSuccess {String} [plotURL] URLs of results plot files. If no URLs - no data for required parameters.
14   - * @apiSuccess {String} [status] The status code. Possible values: "in progress, "error".
15   - *
16   - * @apiError {String} success `false`
  14 + * @apiSuccess {String} [status] The status code. Possible values: "in progress, done, error".
17 15 *
18 16 * @apiSuccessExample Success-Response:
19 17 * HTTP/1.1 200 OK
20   - * {"success":true,"status":"done","dataFileURLs":"http:\/\/amda.irap.omp.eu\/AMDA\/\/data\/WSRESULT\/"}
  18 + * {"success":true,"status":"in progress"}
  19 + * {"success":true,"status":"done","dataFileURLs":"http://amda.irap.omp.eu/AMDA/data/WSRESULT/getparameter_c1_hia_dens_20010923T090000_20130924T130000.txt"}
21 20 *
22 21 * @apiErrorExample
23   - * HTTP/1.1 200 OK
24 22 * {"success":false,"message":"You must provide a job id"}
25 23 */
26 24  
... ...
php/rest/getTimeTable.php
... ... @@ -6,7 +6,7 @@
6 6 * @apiName getTimeTable
7 7 * @apiGroup webservices
8 8 *
9   - * @apiParam {String} ttID Identifier of the Time Table, the « getTimeTableList » service.
  9 + * @apiParam {String} ttID Identifier of the Time Table, as defined in the file returned by the « getTimeTableList » service.
10 10 * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
11 11 * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
12 12 *
... ... @@ -15,15 +15,10 @@
15 15 *
16 16 * @apiSuccessExample Success-Response:
17 17 * HTTP/1.1 200 OK
18   - * http://cdpp1.cesr.fr/AMDA/data/WSRESULT/getTimeTable_impex_sharedtt_0.xml
  18 + * http://amda.irap.omp.eu/AMDA/data/WSRESULT/timetable_impex_20180912_sharedtimeTable_0.xml
19 19 *
20   - * @apiError {String} success `false`
21   - * @apiError {String} faultcode The error code.
22   - * @apiError {String} faultstring The error message.
23   - *
24   - * @apiErrorExample getTimeTable(ttID=sharedtt_0)
25   - * HTTP/1.1 4xx OK
26   - * {"success":false,"faultcode":"server00","faultstring":"Server error"}
  20 + * @apiErrorExample
  21 + * {"error":"No such table sharedtimeTable_100 for user impex"}
27 22 */
28 23  
29 24 require_once '../config.php';
... ...
php/rest/getTimeTablesList.php
... ... @@ -14,17 +14,12 @@
14 14 * @apiSuccess {String} success `true`
15 15 * @apiSuccess {String} TimeTablesList URL of the XML file, which contains the list of Time Tables.
16 16 *
17   - * @apiError {String} success `false`
18   - * @apiError {String} faultcode The error code.
19   - * @apiError {String} faultcode The error message.
20   - *
21 17 * @apiSuccessExample Success-Response:
22 18 * HTTP/1.1 200 OK
23   - * http://cdpp1.cesr.fr/AMDA/data/WSRESULT/getTimeTablesList_gangloff.xml
  19 + * http://amda.irap.omp.eu/data/WSRESULT/timetables_impex_20180905.xml
24 20 *
25 21 * @apiErrorExample
26   - * HTTP/1.1 4xx OK
27   - * {"success":false,"faultcode":"server00","faultstring":"Server Error: AMDA Login procedure failed"}
  22 + * {"error": "Workspace Error : Cannot load TimeTable list for userID"}
28 23 */
29 24  
30 25 require_once '../config.php';
... ...
php/rest/isAlive.php
1 1 <?php
2 2  
3 3 /**
4   - * @api {get} isalive.php isAlive
  4 + * @api {get} isAlive.php isAlive
5 5 * @apiDescription Used to check whether AMDA services are available or not.
6 6 * @apiName isAlive
7 7 * @apiGroup webservices
8 8 *
9   - * @apiParam {Number} id Users unique ID.
10   - *
11 9 * @apiSuccess {Boolean} always `true`.
12 10 *
13 11 * @apiSuccessExample Success-Response:
... ...