4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA agINFRA A data infrastructure for agriculture Basic RESTApi tutorial 4th agINFRA Project Meeting 27th - 29th of October, th - 29th of October, 2013 Budapest, Hungary G. Hermann MTA SZTAKI
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA Goal Reach the Aginfra Web Service as a job submission from the WS-PGRADE portal. The API of the Aginfra WEB service is defined here:
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA Solution A special Aginfra related DCI kind („rest”) will be defined in the WS- PGRADE. The URL of the web service call, the name of service (GET,PUT,POST…) and the eventual content type (MIME type) of the input will be defined on the JobConfiguration/Job_Executable/Service page. Eventual extensions of the URL and the input/output files are defined in the JobConfiguration/Job_I/O page where real input files are associated by the „STREAM” and the url extensions by the „URL PATH” tag and there is the possibility to define a form by qualifying each of its input value by a „FORM” tag.
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA Example 1 API to be mapped TimestampHarvesterDatasets Description This resource contains all produced datasets for a particular harvesting target and particular timestamp. URI p} Method – GET - lists all produced datasets for a particular harvesting target and particular timestamp. Example – GET – curl
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA WS Pgrade mapping of TimestampHarvesterDatasets Job Executable part URI {harvtrgid}/{timestamp} Method GET - lists all produced datasets for a particular harvesting target and particular timestamp.
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA WS Pgrade mapping of TimestampHarvesterDatasets Job I/O part URI Example GET curl aset/2/ Note that „URL PATH” tags are ordered according the associated „Port Number”
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA Example 2 API to be mapped HarvesterTarget Description This resource gives information of particular harvesting target and allows update of these information. URI Method – GET - gives information of particular harvesting target. – POST - updates information of particular harvesting target. Example – GET – curl [output.json]output.json – POST – curl -X POST -H "Content-Type: application/json"
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA WS Pgrade mapping of HarvesterTarget Job Executable part URI Method GET - gives information of particular harvesting target. POST - updates information of particular harvesting target. ExampleGET curl [output.json] output.json POST curl -X POST -H "Content-Type: application/json" ginfra/harvtrg/7
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA WS Pgrade mapping of HarvesterTarget Job I/O part URI Method GET - gives information of particular harvesting target. POST - updates information of particular harvesting target. ExampleGET curl [output.json] output.json POST curl -X POST -H "Content-Type: application/json" ginfra/harvtrg/7
4th project meeting 27-29/05/2013, Budapest, Hungary FP 7-INFRASTRUCTURES programme agINFRA Thank you !