Blame view

php/rest/getObsDataTree.php 1.3 KB
16035364   Benjamin Renard   First commit
1
2
<?php
  
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
3
4
5
6
7
/**
 * @api {get} getObsDataTree.php getObsDataTree
 * @apiDescription Provides the hierarchy of public access data in AMDA.
 * @apiName getObsDataTree
 * @apiGroup webservices
641a1a72   Benjamin Renard   Add the possibili...
8
9
10
11
 * 
 * @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 {Boolean} [templateInfo] `1` to include info about templated parameters - Default `0`.
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
12
13
 *
 * @apiSuccess {String} success true.
6185ceeb   Myriam Bouchemit   update for apidoc
14
15
 * @apiSuccess {String} workspace URL of the XML file containing the list of "public" parameters in AMDA.
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
16
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
17
18
 * @apiSuccessExample Success-Response:
 *     HTTP/1.1 200 OK
0cb6a7aa   Myriam Bouchemit   add info for apidoc
19
20
21
22
23
24
 *     [success] => 1
 *         [WorkSpace] => stdClass Object
 *      (
 *          [LocalDataBaseParameters] => http://amda.irap.omp.eu/AMDA/data/WSRESULT/obsdatatree_impex_20180919_AmdaLocalDataBaseParameters.xml
 *      )
 *
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
25
 *
ddedb507   Myriam Bouchemit   layout for apidoc
26
 * @apiErrorExample Error-Response:
6185ceeb   Myriam Bouchemit   update for apidoc
27
 *     {"error":"No Amda Local DataBase Parameters description file"}
d8f6b7eb   Nathanaël Jourdane   Add API documenta...
28
 */
16035364   Benjamin Renard   First commit
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

  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']; 
    }
?>