Blame view

php/rest/getGranule.php 1.83 KB
b2b3cdea   Benjamin Renard   Add script to bui...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

/**
 * @api {get} getDataset.php getDataset
 * @apiDescription  Provides data corresponding to a dataset chosen by the user among those available in AMDA
 * @apiName getDataset
 * @apiGroup webservices
 *
 * @apiParam {String} token The API token.
 * @apiParam {String} startTime Beginning of the time interval (ISO 8601 or UNIXTIME format).
 * @apiParam {String} stopTime End of the time interval (ISO 8601 or UNIXTIME format).
 * @apiParam {String} datasetID Identifier of the dataset, as defined in the file returned by the  *getObsDataTree* web-services.
 * @apiParam {String} [sampling] Sampling of data (*in seconds*).
 * @apiParam {String} [userID] Identifier of the user in AMDA (*mandatory for user owned data*)
 * @apiParam {String} [password] Password of the user in AMDA (*mandatory for user owned data*)
 * @apiParam {String} [outputFormat] Format of the returned file. Two options: `VOTable` and `ASCII`.
 * @apiParam {String} [timeFormat] Format of time in the data files. Two options: `ISO8601` and `UNIXTIME`.
 * @apiParam {Boolean} [gzip] `1` if the file must be compressed before delivery.
 *
 * @apiSuccess {String} success `true`
 * @apiSuccess {String} dataFileURLs URL of the files matching the criteria. If the file is empty, there is no data
 * matching these criteria.
 * @apiSuccess {String} status status of the job ( done | in_progress )
 *
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *     http://amda.irap.omp.eu/AMDA/data/WSRESULT/getdataset_ace-imf-all_20130923T090000_20130924T130000.txt
 *     [status] => done
 *
 * @apiErrorExample Error-Response:
 * {"error":"Cannot find info file for dataset ace-imf-any"}

 */
 
//ini_set("allow_url_fopen", true);
	require_once '../config.php';

	$amda_ws = new WebServer();
	
	$result = $amda_ws->getGranule($_GET);

	echo json_encode($result);
?>