-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add http-api endpoint to add datasets from scenario topic to scenario-bundles scenarios #1890
Closed
1 task done
Labels
Comments
jh-RLI
added a commit
that referenced
this issue
Oct 21, 2024
jh-RLI
added a commit
that referenced
this issue
Oct 21, 2024
…ets #1890 (remove would be part of the delete method).
jh-RLI
added a commit
that referenced
this issue
Oct 21, 2024
jh-RLI
added a commit
that referenced
this issue
Oct 21, 2024
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description of the issue
Currently, it is not possible to simply interact with the scenario bundles using http requests. Django requires users to send a CSRF token that is used to verify user actions done via a interface while the user is logged in.
To implement an actual WEB-API that enables users to manage scenario bundles using programmatic approaches, we need to create HTTP-api endpoints that enable the user to use the API token to send form data to the oeplatform.
Ideas of solution
Implement an api endpoint that enables http requests and requires a user token (users must be logged in).
There are several functions to open up like creating / editing bundles. To start of this issue is concerned with enabling users to add a single or a list of datasets from the scenario topic on the oeplatform to a specific scenario that is part of a specific scenario bundle.
We will implement an endpoint called "/api/v0/scenario-bundle/scenario/manage-datasets/".
This endpoint uses the unique UUID from a scenario to avoid complex sparql queries that retrieve the scenario. The user will be able to copy this scenario ID from the scenario bundle page that lists the scenarios. The table name is already unique and can be copied. Here we need the technical table name, not the title from the metadata.
AS we send an HTTP requests, we can specify the payload and send data to the oeplatform. I propose that the payload will have the following structure:
payload = {"scenario": "UUID", "dataset": [{"name":"table-name1", "type": "input|output"}, {"name":"table-name2", "type": "input|output"}]}
The request should be a post request type and the header must contain the token for authentication.
Using a delete request will remove the selection available in the payload.
Workflow checklist
The text was updated successfully, but these errors were encountered: