getStatus.php
1.18 KB
<?php
/**
* @api {get} getStatus.php getStatus
* @apiDescription Get the current status of the request according to a process ID.
* @apiName getStatus
* @apiGroup webservices
*
* @apiParam {String} id process ID.
*
* @apiSuccess {String} success `true`
* @apiSuccess {String} [dataFileURLs] URLs of results data files. If no URLs - no data for required parameters.
* @apiSuccess {String} [plotURL] URLs of results plot files. If no URLs - no data for required parameters.
* @apiSuccess {String} [status] The status code. Possible values: "in progress, done, error".
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {"success":true,"status":"in progress"}
* {"success":true,"status":"done","dataFileURLs":"http://amda.irap.omp.eu/AMDA/data/WSRESULT/getparameter_c1_hia_dens_20010923T090000_20130924T130000.txt"}
*
* @apiErrorExample Error-Response:
* {"success":false,"message":"You must provide a job id"}
*/
require_once '../config.php';
if (!key_exists("id", $_GET)) {
$result = array('success' => false, 'message' => "You must provide a job id");
} else {
$amda_ws = new WebServer();
$result = $amda_ws->getStatus($_GET);
}
echo json_encode($result);