Closed patrickkaleta closed 5 years ago
@humerh since we don't have the initial trigger yet and there is only one study available, you can test this by using this URL: https://csis.myclimateservice.eu/rest/emikat/study/1
If you need additional fields (or would like to rename some of the fields or use different formats e.g. for the study_area) in one of the endpoints or complete new endpoints, please write them as comments here in this issue.
@humerh as was just discussed I changed the study_area
field in the response body, so that it now shows to coordinates for left, top, right and bottom. For that I had to split the original field into 4 new fields.
@patrickkaleta additionally I need the list of ressources in the data package. For each ressource I need at least following fields:
@patrickkaleta additionally I need the list of ressources in the data package. For each ressource I need at least following fields:
- description
- format
- url
I created a new REST endpoint (accessible by the Emikat-user in the CSIS) at the following URL-pattern: .../rest/emikat/dp/[DatapackageID]/resources
@humerh That link is now included in the "Initial Study information" endpoint (described on top in the first comment), so Emikat should have no trouble getting to it.
@humerh be aware that in the data package resources, the "path" property can be either a url or an array of urls
@humerh be aware that in the data package resources, the "path" property can be either a url or an array of urls
Interesting! In that case I believe that the path field in Drupal should be allowed to contain unlimited values and not just one. @fgeyer16 since we already have data in that field, can we change the settings from "limited to 1" to "unlimited" without running into problems?
@fgeyer16 since we already have data in that field, can we change the settings from "limited to 1" to "unlimited" without running into problems?
As far as I experienced making a single value field to a multi value works and does not cause problems. Only the other direction does not work
@fgeyer16 since we already have data in that field, can we change the settings from "limited to 1" to "unlimited" without running into problems?
As far as I experienced making a single value field to a multi value works and does not cause problems. Only the other direction does not work
That was also my believe. I tested changing the field's cardinality locally and it worked without problems. I will now apply this in the CSIS.
Closing this, since basic communication between Emikat and Drupal is already implemented by now and working. For reference purposes I'll keep this issue pinned to the top.
Overview
In this issue we will describe the flow of individual REST calls between Emikat and CSIS, how to access the endpoints on Drupal-side and what content(-fields) should be expected in each response.
General procedure
Individual REST endpoints
1) Initial Study information
Link: csis.myclimateservice.eu/rest/emikat/study/[StudyID] This link will be given to Emikat in the initial trigger event from the CSIS. BasicAuth is used as authentication. Emikat can use the "Emikat" user in the CSIS, which was created for this purpose. This endpoint uses the REST Group View and displays the following properties:
2) Data package information
Link: csis.myclimateservice.eu/node/[DatapackageID]?_format=hal_json This endpoint is currently not implemented as a view, so the complete data package is displayed. This can be changed if necessary, so that only relevant fields are displayed.
3) Resources information
Link: csis.myclimateservice.eu/rest/emikat/dp[DatapackageID]/resources This endpoint uses the REST Node View and displays the following properties:
additional REST endpoints ???