getParameterList.php 1.53 KB
<?php

/**
 * @api {get} getParameterList.php getParameterList
 * @apiDescription Provides the hierarchy of derived parameters belonging to a user and parameters in AMDA.
 * @apiName getParameterList
 * @apiGroup webservices
 *
 * @apiParam {String} userID Identifier of the user in AMDA.
 * @apiParam {String} password password of the user in AMDA.
 *
 * @apiSuccess {String} success `true`
 * @apiSuccess {String} URL of the XML file, which contains the list of derived parameters and parameters in AMDA
 *

 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     [success] => 1
 *         [ParameterList] => stdClass Object
 *      (
 *          [LocalDataBaseParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_impex_20180919_AmdaLocalDataBaseParameters.xml
 *      )
 *      or with userID
 *      (
 *          [UserDefinedParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_userID_20180919_UserDefinedParameters.xml
 *          [LocalDataBaseParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/parameterlist_userID_20180919_AmdaLocalDataBaseParameters.xml
 *      )
 *
 *
 *
 * @apiErrorExample Error-Response:
 *     {"error":"Login procedure failed for impex1 : Check your password"}
 */

  require_once '../config.php';

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

    if ($result['ParameterList']){
      foreach($result['ParameterList'] as $key => $value) {
	echo "<$key>$value</$key><br/>";
      }
    }
    else {
     echo $result['message'];  
    }
?>