getStatus.php
1.13 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, "error".
*
* @apiError {String} success `false`
*
* @apiSuccessExample Success-Response:
* HTTP/1.1 200 OK
* {"success":true,"status":"done","dataFileURLs":"http:\/\/amda.irap.omp.eu\/AMDA\/\/data\/WSRESULT\/"}
*
* @apiErrorExample
* HTTP/1.1 200 OK
* {"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);