Project

General

Profile

API » History » Version 29

Version 28 (Maarten Plieger, 10/23/2015 08:26 AM) → Version 29/72 (Maarten Plieger, 10/23/2015 08:26 AM)

h1. API

h2. Access token API - service "account"

*1). Generate a token for the current user which can be used to access C4I services by using "generatetoken":*
* https://climate4impact.eu/impactportal/tokenapi?service=account&request=generatetoken

The token has the following structure:
<pre><code class="json">
{
"creationdate" : "2015-10-23T09:50:05Z",
"notafter" : "2015-10-30T09:50:05Z",
"notbefore" : "2015-10-23T09:50:05Z",
"openid" : "https://esg-dn1.nsc.liu.se/esgf-idp/openid/<identifier>",
"token" : "daad2944-1def-4bee-b032-b08048f88302",
"userid" : "esg-dn1.nsc.liu.se.esgf-idp.openid.<identifier>"
}
</code></pre>

*2). List all tokens available for the current user by using "listtokens":*
* https://climate4impact.eu/impactportal/tokenapi?service=account&request=listtokens

*Service endpoints which can be used with a token:*
* WMS can be used via <pre>https://climate4impact.eu/impactportal/adagucserver/<accesstoken>/?</pre>
* WCS can be used via <pre>https://climate4impact.eu/impactportal/adagucserver/<accesstoken>/?</pre>
* WPS can be used via <pre>https://climate4impact.eu/impactportal/WPS/<accesstoken>/?</pre>
* File download requests and OpenDAP requests from the basket can be done via <pre>https://climate4impact.eu/impactportal/DAP/<accesstoken>/<userid>/<file>"</pre>
* Basket requests can be done via <pre>https://climate4impact.eu/impactportal/basket/<accesstoken>?&service=basket&request=getoverview&</pre>

h2. Basket requests

* Get overview of all files in the users basket: service=basket&request=getoverview,
** e.g. <pre>https://climate4impact.eu/impactportal/basket?&service=basket&request=getoverview&</pre>
** For commandline access with an access token: <pre>https://climate4impact.eu/impactportal/basket/<accesstoken>/?&service=basket&request=getoverview&</pre>

The result is a json file with nested childs representing te directory structure at C4I
<pre><code class="json">
{ "browser" : "/impactportal/data/catalogbrowser.jsp?",
"children" : [ { "children" : [ ],
"date" : "",
"expanded" : true,
"iconCls" : "typeFolder",
"leaf" : false,
"text" : "Remote data"
},
{ "children" : [ { "dapurl" : "https://localhost/impactportal/DAP/<userid>/INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
"date" : "2014-06-06 14:31:23Z",
"filesize" : "611.573K",
"hasdap" : true,
"hashttp" : true,
"httpurl" : "https://localhost/impactportal/DAP/<userid>/INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
"iconCls" : "typeOF",
"id" : "INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
"index" : 1,
"leaf" : true,
"text" : "INTER_OPER_R___RD3_____L3__20100101T000000_20100201T000000_0004.nc",
"type" : "file"
},
{ "dapurl" : "https://localhost/impactportal/DAP/<userid>/tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
"date" : "2015-10-23 09:37:33Z",
"filesize" : "47.867M",
"hasdap" : true,
"hashttp" : true,
"httpurl" : "https://localhost/impactportal/DAP/<userid>/tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
"iconCls" : "typeOF",
"id" : "tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
"index" : 2,
"leaf" : true,
"text" : "tasmax_day_CNRM-CM5_historical_r1i1p1_1890.nc",
"type" : "file"
}
],
"date" : "",
"expanded" : true,
"iconCls" : "typeFolder",
"leaf" : false,
"text" : "My data"
}
],
"leaf" : false,
"text" : "https://esg-dn1.nsc.liu.se/esgf-idp/openid/<openid>",
"viewer" : "/impactportal/data/datasetviewer.jsp?"
}
</code>
</pre>