Project

General

Profile

API » History » Version 24

Maarten Plieger, 10/23/2015 08:10 AM

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