Project

General

Profile

API » History » Version 19

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