getObsDataTree.php 1.04 KB
<?php
  
/**
 * @api {get} getObsDataTree.php getObsDataTree
 * @apiDescription Provides the hierarchy of public access data in AMDA.
 * @apiName getObsDataTree
 * @apiGroup webservices
 *
 * @apiSuccess {String} success true.
 * @apiSuccess {String} workspace URLs of the XML files containing the list of "public" parameters in AMDA.
 *
 * @apiError {String} success false.
 * @apiError {String} faultcode The error code.
 * @apiError {String} faultstring The error message.

 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
 *     http://amda.irap.omp.eu/AMDA/data/WSRESULT/obsdatatree_impex_20180727_AmdaLocalDataBaseParameters.xml
 *
 * @apiErrorExample
 *     HTTP/1.1 200 OK
 *     {"success":false,"faultcode":"server00","faultstring":"Server error"}
 */

  require_once '../config.php';

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

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