-
Notifications
You must be signed in to change notification settings - Fork 2
API
Return a list of all requests. No pagination is provided at present.
- Admins can see all requests.
- Users can only see their own.
- 200
- 401
[{
"bag_id": "a5180fb4-c64e-4a85-8a2f-abe25b0a0c79",
"user": "[email protected]",
"content_type": "fake",
"upload_link": "[email protected]:/vel/path",
"mirlyn_id": "5f585466-318b-4fd9-a7d3-7e2839588c68",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 18:49:08 -0500"
}]
Return a specific request.
- Admins can see any requests.
- Users can only see their own.
- 200
- 403 - User wanted a request they do not own, and is not admin.
- 404
- 401
{
"bag_id": "a5180fb4-c64e-4a85-8a2f-abe25b0a0c79",
"user": "[email protected]",
"content_type": "fake",
"upload_link": "[email protected]:/vel/path",
"mirlyn_id": "5f585466-318b-4fd9-a7d3-7e2839588c68",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 18:49:08 -0500"
}
Create a new request
- Admins can specify the user.
- Users cannot specify user (field is ignored).
- 201 - Will include Location header with full url to resource, /v1/requests/<bag_id>.
- 303 - The result of a duplicate request. Includes Location header as with 201.
- 401
- 422 - Malformed post body
None.
Notify the server that upload has completed for the request.
- Admins can post for any request.
- Users can only post if they own the request at /v1/requests/:bag_id
- 201 - Will include Location header with full url to resource, e.g. /v1/queue/5
- 303 - The result of a duplicate request. Includes Location header as with 201.
- 401
- 422 - Malformed post body
None.
Return a specific queue item. While the task the queue item represents is still processing, its status will be "PENDING". Completed, successful tasks will have status "DONE", and will have a reference to the created bag. Unsuccessful tasks will have status "FAILED", and an array of errors.
- Admins can see any queue_item.
- Users can only see their own.
- 200
- 403 - User wanted a request they do not own, and is not admin.
- 404
- 401
With 200 responses:
{
"id": 1,
"request": "/v1/requests/20d76061-b761-438f-a996-17893001fd34",
"status": "PENDING",
"created_at": "2017-05-18 00:03:04 UTC",
"updated_at": "2017-05-18 00:03:04 UTC"
}
{
"id": 2,
"request": "/v1/requests/30d76061-b761-438f-a996-17893001fd35",
"status": "DONE",
"bag": "/v1/bags/30d76061-b761-438f-a996-17893001fd35"
"created_at": "2017-05-18 00:03:04 UTC",
"updated_at": "2017-05-18 00:03:04 UTC"
}
{
"id": 3,
"request": "/v1/requests/40d76061-b761-438f-a996-17893001fd36",
"status": "FAILED",
"error": [
"error the first",
"another error",
"third error"
],
"created_at": "2017-05-18 00:03:04 UTC",
"updated_at": "2017-05-18 00:03:04 UTC"
}
With 303 responses:
None.
Return a list of all bags. No pagination is provided at present. Additionally, the storage_location is only shown to admin users.
- Admins can see all bags.
- Users can only see their own.
- 200
- 401
For admins:
[{
"bag_id": "ea704c01-8cba-4497-bd4d-ca1d70119ec6",
"user": "[email protected]",
"content_type": "fake",
"mirlyn_id": "4daccb0e-d30a-4d70-8494-393d8c55de5a",
"storage_location": "excepturi/path",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 19:07:42 -0500"
}]
For underpriviledged users:
[{
"bag_id": "ea704c01-8cba-4497-bd4d-ca1d70119ec6",
"user": "[email protected]",
"content_type": "fake",
"mirlyn_id": "4daccb0e-d30a-4d70-8494-393d8c55de5a",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 19:07:42 -0500"
}]
Return a specific bag. Additionally, storage_location is only shown to admin users.
- Admins can see any bag.
- Users can only see their own.
- 200
- 403 - User wanted a bag they do not own, and is not admin.
- 404
- 401
For admins:
{
"bag_id": "ea704c01-8cba-4497-bd4d-ca1d70119ec6",
"user": "[email protected]",
"content_type": "fake",
"mirlyn_id": "4daccb0e-d30a-4d70-8494-393d8c55de5a",
"storage_location": "excepturi/path",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 19:07:42 -0500"
}
For underpriviledged users:
{
"bag_id": "ea704c01-8cba-4497-bd4d-ca1d70119ec6",
"user": "[email protected]",
"content_type": "fake",
"mirlyn_id": "4daccb0e-d30a-4d70-8494-393d8c55de5a",
"created_at": "1969-12-31 18:00:00 -0600",
"updated_at": "2017-05-17 19:07:42 -0500"
}