-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature/issue 334 drs bulk requests #365
Changes from 12 commits
0e4abfa
a35aedd
e7fcf31
ac3e6ea
7df1396
f1734ab
1898a0f
982ea08
b5806c6
e9285af
c1d72ce
a6c268c
ba1ba6b
a0f9f33
264bf07
39a4fb4
d7ccae7
0fad71e
0a84ce2
ddcf7c6
3dbcc96
a9de009
efeca29
5938922
0414c4e
6baeb80
d9e643e
10d627e
815f7df
d3b09b4
f604464
4a71e69
9bf5892
bd79805
e1ea19c
22c5a82
b511345
5ccf068
783ef68
affde66
19a815b
7e607d3
6f29332
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: bulk_object_id | ||
required: true | ||
description: '`DrsObject` identifier' | ||
schema: | ||
type: string |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
description: The `AccessURL` was found successfully | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
access_urls: | ||
type: array | ||
items: | ||
$ref: '../schemas/BulkAccessURL.yaml' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
description: The `DrsObjects` were found successfully | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
drsobjects: | ||
type: array | ||
items: | ||
$ref: '../schemas/DrsObject.yaml' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
type: object | ||
required: | ||
- url | ||
properties: | ||
object_id: | ||
$ref: '../components/parameters/BulkObjectId.yaml' | ||
url: | ||
type: string | ||
description: A fully resolvable URL that can be used to fetch the actual object bytes. | ||
headers: | ||
type: array | ||
items: | ||
type: string | ||
description: >- | ||
An optional list of headers to include in the HTTP request to `url`. | ||
These headers can be used to provide auth tokens required to fetch the object bytes. | ||
example: 'Authorization: Basic Z2E0Z2g6ZHJz' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ servers: | |
serverURL: | ||
default: drs.example.org | ||
description: > | ||
DRS server endpoints MUST be prefixed by the '/ga4gh/drs/v1' endpoint | ||
DRS server endpoints MUST be prefixed by the '/ga4gh/drs/v1' endpoint | ||
path | ||
security: | ||
- {} | ||
|
@@ -103,8 +103,12 @@ x-tagGroups: | |
paths: | ||
/objects/{object_id}: | ||
$ref: ./paths/objects@{object_id}.yaml | ||
/bulk/objects: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about making this endpoint at just There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I'll make that change. We do need to figure out how to enable multi-part POST here so it can be used with Passports. this is a TODO |
||
$ref: ./paths/bulkobjects@{object_id}.yaml | ||
/objects/{object_id}/access/{access_id}: | ||
$ref: ./paths/objects@{object_id}@access@{access_id}.yaml | ||
/bulk/objects/access/{access_id}: | ||
$ref: ./paths/bulkobjects@access@{access_id}.yaml | ||
components: | ||
securitySchemes: | ||
BasicAuth: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
post: | ||
summary: Get URLs for fetching bytes from multiple objects | ||
description: >- | ||
Returns an array of URL objects that can be used to fetch the bytes of multiple `DrsObject`s. | ||
|
||
This method only needs to be called when using an `AccessMethod` that contains an `access_id` | ||
(e.g., for servers that use signed URLs for fetching object bytes). | ||
operationId: GetBulkAccessURL | ||
parameters: | ||
- $ref: '../components/parameters/AccessId.yaml' | ||
responses: | ||
200: | ||
$ref: '../components/responses/200OkAccesses.yaml' | ||
202: | ||
$ref: '../components/responses/202Accepted.yaml' | ||
400: | ||
$ref: '../components/responses/400BadRequest.yaml' | ||
401: | ||
$ref: '../components/responses/401Unauthorized.yaml' | ||
403: | ||
$ref: '../components/responses/403Forbidden.yaml' | ||
404: | ||
$ref: '../components/responses/404NotFoundAccess.yaml' | ||
500: | ||
$ref: '../components/responses/500InternalServerError.yaml' | ||
tags: | ||
- Objects | ||
x-swagger-router-controller: ga4gh.drs.server | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
object_ids: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about renaming this property to @kwrodarmer @mbarkley WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So "object_ids" --> "selection"? I'm fine with that... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It started as selection and, with some discussion, we consciously went to object_ids as there may be other use cases than "selection" for how you get to a list of ids that you want to request. object_ids is neutral as to use case, rather than projecting a particular use case on to DRS which has some generality. |
||
type: array | ||
items: | ||
$ref: '../components/parameters/BulkObjectId.yaml' | ||
description: An array of ObjectIDs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
post: | ||
summary: Get info about multiple DrsObjects. | ||
description: >- | ||
Returns an array of object metadata, and a list of access methods that can be used to fetch objects' bytes. | ||
operationId: GetBulkObjects | ||
parameters: | ||
- $ref: '../components/parameters/Expand.yaml' | ||
responses: | ||
200: | ||
$ref: '../components/responses/200OkDrsObjects.yaml' | ||
202: | ||
$ref: '../components/responses/202Accepted.yaml' | ||
400: | ||
$ref: '../components/responses/400BadRequest.yaml' | ||
401: | ||
$ref: '../components/responses/401Unauthorized.yaml' | ||
403: | ||
$ref: '../components/responses/403Forbidden.yaml' | ||
404: | ||
$ref: '../components/responses/404NotFoundDrsObject.yaml' | ||
500: | ||
$ref: '../components/responses/500InternalServerError.yaml' | ||
tags: | ||
- Objects | ||
x-swagger-router-controller: ga4gh.drs.server | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
object_ids: | ||
type: array | ||
items: | ||
$ref: '../components/parameters/BulkObjectId.yaml' | ||
description: An array of ObjectIds |
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.
Some thoughts on the response payload of a bulk DRS request:
drsobjects
is a flat list, would it be advantageous to make it an object with the supplied IDs as keys, and the corresponding DRS Object as the value?Taking the above points together, here is a proposed example response payload:
In the above example, the response payload summarizes how many IDs were passed, how many DRS Objects were successfully retrieved, and how many were unsuccessful. Each retrieved DRS Object can be referenced by its ID. Each non-retrieved DRS Object comes with an explanation (in the form of HTTP code) why it wasn't retrieved.
It's a more complex payload overall, but provides more information to the client about how the request was processed.
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.
Let's discuss on today's call
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.
A few comments on the proposed format:
Summary
Depending on the number of items that are requested and where we end up falling on pagination in a bulk request, the summary information may not be known ahead of time when the initial response is sent. Its possible this number may be per page, instead of in total.
Results Format
It may be nice to return the objects as an array with the ordering mirroring the order of the requested Id's This leads to less surprises and allows the client to iterate over the objects in the order they expect. Additionally, since this is a bulk operation we could interleave the errors that are encountered directly in the array at the appropriate index. (this is using the error message format from beacon here
for example, if I request both
[456,457]
the following may be a valid response