Project

General

Profile

API » History » Version 28

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

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