-
Notifications
You must be signed in to change notification settings - Fork 44
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
API: add location create endpoint #368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Confirmed that it works as advertised in the PR description.
@sevein should merging this PR also involve adding to https://wiki.archivematica.org/Storage_Service_API? (This touches on the issue 369 which PR 370 aims to solve, but that's not ready so it's not entirely relevant yet.) |
Add new `POST /api/v2/location/` endpoint to enable creation of Location instances given a known space and pipeline. The following is an example on how it could be used: Find a pipeline: ```shell curl -s \ -H "Authorization: ApiKey test:test" \ -H "Content-Type: application/json" \ "http://127.0.0.1:62081/api/v2/pipeline/" | \ jq -r ".objects | .[0] | .resource_uri" ``` /api/v2/pipeline/90707555-244f-47af-8271-66496a6a965b/ Find a space: ```shell curl -s \ -H "Authorization: ApiKey test:test" \ -H "Content-Type: application/json" \ "http://127.0.0.1:62081/api/v2/space/" | \ jq -r ".objects | .[0] | .resource_uri" ``` /api/v2/space/141593ff-2a27-44a1-9de1-917573fa0f4a/ Create new location: ```shell curl -s -d '{ "pipeline": ["/api/v2/pipeline/90707555-244f-47af-8271-66496a6a965b/"], "purpose": "TS", "relative_path": "automated-workflow/foo/bar", "description": "automated workflow", "space": "/api/v2/space/141593ff-2a27-44a1-9de1-917573fa0f4a/" }' \ -X POST \ -H "Authorization: ApiKey test:test" \ -H "Content-Type: application/json" \ "http://127.0.0.1:62081/api/v2/location/" | \ jq -r ".resource_uri" ``` /api/v2/location/693f8fa4-744a-4c8f-9e1f-275d422e3bad/ Inspect location: ```shell curl -s \ -H "Authorization: ApiKey test:test" \ -H "Content-Type: application/json" \ "http://127.0.0.1:62081/api/v2/location/693f8fa4-744a-4c8f-9e1f-275d422e3bad/" | jq ``` ```json { "description": "automated workflow", "enabled": true, "path": "/automated-workflow/foo/bar", "pipeline": [ "/api/v2/pipeline/90707555-244f-47af-8271-66496a6a965b/" ], "purpose": "TS", "quota": null, "relative_path": "automated-workflow/foo/bar", "resource_uri": "/api/v2/location/693f8fa4-744a-4c8f-9e1f-275d422e3bad/", "space": "/api/v2/space/141593ff-2a27-44a1-9de1-917573fa0f4a/", "used": "0", "uuid": "693f8fa4-744a-4c8f-9e1f-275d422e3bad" } ``` This closes #367.
3737682
to
9f813d7
Compare
Add new
POST /api/v2/location/
endpoint to enable creation of Locationinstances given a known space and pipeline. The following is an example on how
it could be used:
Find a pipeline:
Find a space:
Create new location:
Inspect location:
This is connected to #367.