Project

General

Profile

API » History » Version 16

Maarten Plieger, 10/23/2015 07:46 AM

1 1 Maarten Plieger
h1. API
2 1 Maarten Plieger
3 1 Maarten Plieger
h2. Access token API
4 1 Maarten Plieger
5 1 Maarten Plieger
Generate a token which can be used to access C4I services:
6 1 Maarten Plieger
* https://climate4impact.eu/impactportal/ImpactService?service=account&request=generatetoken
7 1 Maarten Plieger
8 1 Maarten Plieger
List all tokens available for the current user:
9 1 Maarten Plieger
* https://climate4impact.eu/impactportal/ImpactService?service=account&request=listtokens
10 1 Maarten Plieger
11 3 Maarten Plieger
* WMS can be used via <pre>https://climate4impact.eu/impactportal/WMS/<accesstoken>/?</pre>
12 4 Maarten Plieger
* WPS can be used via <pre>https://climate4impact.eu/impactportal/WPS/<accesstoken>/?</pre>
13 4 Maarten Plieger
* File download requests and OpenDAP requests from the basket can be done via <pre>https://climate4impact.eu/impactportal/DAP/<accesstoken>/<userid>/<file>"</pre>
14 1 Maarten Plieger
15 5 Maarten Plieger
h2. Basket requests
16 1 Maarten Plieger
17 2 Maarten Plieger
* Get overview of all files in the users basket: service=basket&request=getoverview, 
18 8 Maarten Plieger
** e.g. <pre>https://climate4impact.eu/impactportal/basket?&service=basket&request=getoverview&</pre>
19 8 Maarten Plieger
** For commandline access with an access token: <pre>https://climate4impact.eu/impactportal/basket/<accesstoken>/?&service=basket&request=getoverview&</pre>
20 7 Maarten Plieger
21 14 Maarten Plieger
The result is a json file with nested childs representing te directory structure at C4I
22 10 Maarten Plieger
<pre><code class="json">
23 12 Maarten Plieger
{ "browser" : "/impactportal/data/catalogbrowser.jsp?",
24 12 Maarten Plieger
  "children" : [ { "children" : [  ],
25 12 Maarten Plieger
        "date" : "",
26 12 Maarten Plieger
        "expanded" : true,
27 12 Maarten Plieger
        "iconCls" : "typeFolder",
28 12 Maarten Plieger
        "leaf" : false,
29 12 Maarten Plieger
        "text" : "Remote data"
30 1 Maarten Plieger
      },
31 13 Maarten Plieger
      { "children" : [ { "dapurl" : "https://localhost/impactportal/DAP/<userid>/INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
32 12 Maarten Plieger
              "date" : "2014-06-06 14:31:23Z",
33 12 Maarten Plieger
              "filesize" : "611.573K",
34 1 Maarten Plieger
              "hasdap" : true,
35 12 Maarten Plieger
              "hashttp" : true,
36 13 Maarten Plieger
              "httpurl" : "https://localhost/impactportal/DAP/<userid>/INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
37 12 Maarten Plieger
              "iconCls" : "typeOF",
38 12 Maarten Plieger
              "id" : "INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
39 12 Maarten Plieger
              "index" : 1,
40 12 Maarten Plieger
              "leaf" : true,
41 1 Maarten Plieger
              "text" : "INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
42 12 Maarten Plieger
              "type" : "file"
43 12 Maarten Plieger
            },
44 13 Maarten Plieger
            { "dapurl" : "https://localhost/impactportal/DAP/<userid>/tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
45 1 Maarten Plieger
              "date" : "2015-10-23 09:37:33Z",
46 12 Maarten Plieger
              "filesize" : "47.867M",
47 12 Maarten Plieger
              "hasdap" : true,
48 12 Maarten Plieger
              "hashttp" : true,
49 13 Maarten Plieger
              "httpurl" : "https://localhost/impactportal/DAP/<userid>/tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
50 12 Maarten Plieger
              "iconCls" : "typeOF",
51 12 Maarten Plieger
              "id" : "tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
52 12 Maarten Plieger
              "index" : 2,
53 12 Maarten Plieger
              "leaf" : true,
54 12 Maarten Plieger
              "text" : "tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
55 12 Maarten Plieger
              "type" : "file"
56 12 Maarten Plieger
            }
57 12 Maarten Plieger
          ],
58 12 Maarten Plieger
        "date" : "",
59 12 Maarten Plieger
        "expanded" : true,
60 12 Maarten Plieger
        "iconCls" : "typeFolder",
61 1 Maarten Plieger
        "leaf" : false,
62 12 Maarten Plieger
        "text" : "My data"
63 12 Maarten Plieger
      }
64 12 Maarten Plieger
    ],
65 12 Maarten Plieger
  "leaf" : false,
66 13 Maarten Plieger
  "text" : "https://esg-dn1.nsc.liu.se/esgf-idp/openid/<openid>",
67 11 Maarten Plieger
  "viewer" : "/impactportal/data/datasetviewer.jsp?"
68 11 Maarten Plieger
}
69 10 Maarten Plieger
</code>
70 9 Maarten Plieger
</pre>