Skip to content
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

Merged
merged 43 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0e4abfa
first attempt to add bulk operations
Aug 16, 2021
a35aedd
bulk operations prototyping
Aug 16, 2021
e7fcf31
bulk operations prototyping
Aug 16, 2021
ac3e6ea
bulk operations prototyping
Aug 16, 2021
7df1396
bulk operations prototyping
Aug 16, 2021
f1734ab
bulk operations prototyping
Aug 16, 2021
1898a0f
bulk operations prototyping
Aug 16, 2021
982ea08
bulk operations prototyping
Aug 16, 2021
b5806c6
bulk operations prototyping
Aug 16, 2021
e9285af
bulk operations prototyping
Aug 16, 2021
c1d72ce
bulk operations prototyping
Aug 16, 2021
a6c268c
bulk operations prototyping
Aug 16, 2021
ba1ba6b
responding to comments on PR#365
briandoconnor Jan 10, 2022
a0f9f33
Create summary.yaml
briandoconnor Feb 4, 2022
264bf07
Create unresolved.yaml
briandoconnor Feb 4, 2022
39a4fb4
Update 200OkDrsObjects.yaml
briandoconnor Feb 4, 2022
d7ccae7
working on bulk schema changes
Feb 7, 2022
0fad71e
updates
Feb 7, 2022
0a84ce2
updates
Feb 7, 2022
ddcf7c6
fixed 200 return object for objects endpoint
briandoconnor Mar 14, 2022
3dbcc96
fixed 200 return object for objects endpoint
briandoconnor Mar 14, 2022
a9de009
Merge branch 'develop' into feature/issue-334-drs-bulk-requests
briandoconnor Sep 22, 2022
efeca29
trying to include passports as a parameter in the bulk body request
briandoconnor Sep 22, 2022
5938922
updating the build badge, trying to get passport to show up on bulk
briandoconnor Sep 22, 2022
0414c4e
working to get passports
briandoconnor Sep 22, 2022
6baeb80
trying to get passport field to show up
briandoconnor Sep 22, 2022
d9e643e
trying to figure out adding passports
briandoconnor Sep 22, 2022
10d627e
trying to get this to build the docs
briandoconnor Sep 22, 2022
815f7df
adding passports
briandoconnor Mar 27, 2023
d3b09b4
working on bulk method for access URLs
briandoconnor Mar 27, 2023
f604464
resolved conflicts in merge of v2 of this feature branch
briandoconnor Mar 27, 2023
4a71e69
added 413 error
briandoconnor Mar 27, 2023
9bf5892
working on adding bulk options endpoint
briandoconnor May 22, 2023
bd79805
adding error 413 for the bulk options request
briandoconnor May 22, 2023
e1ea19c
updated logo and version string
briandoconnor Jul 11, 2023
22c5a82
removing passport from bulk opts endpoint since it does not make sens…
briandoconnor Jul 11, 2023
b511345
adding new yaml
briandoconnor Jul 11, 2023
5ccf068
updating travis URL
briandoconnor Jul 11, 2023
783ef68
updated the security to PassportAuth
briandoconnor Jul 11, 2023
affde66
merged in develop into my feature branch
briandoconnor Jul 11, 2023
19a815b
adding a maxBulkRequestLength variable to service info
briandoconnor Sep 19, 2023
7e607d3
adding better description of variables
briandoconnor Sep 19, 2023
6f29332
adding better description of variables
briandoconnor Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ this will not automatically be built from our Travis. However, if you
are a developer and have created a feature branch following the naming
convention above, you should see automated builds.

Check https://travis-ci.com/ga4gh/data-repository-service-schemas/builds to see the status of the builds.
Check https://app.travis-ci.com/github/ga4gh/data-repository-service-schemas to see the status of the builds.

Pull Request Voting Process
===========================
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<img src="https://www.ga4gh.org/wp-content/themes/ga4gh-theme/gfx/GA-logo-horizontal-tag-RGB.svg" alt="GA4GH Logo" style="width: 400px;"/>
<img src="https://www.ga4gh.org/wp-content/themes/ga4gh/dist/assets/svg/logos/logo-full-color.svg" alt="GA4GH Logo" style="width: 400px;"/>

# Data Repository Service (DRS) API

<sup>`develop` branch status: </sup>[![Build Status](https://travis-ci.org/ga4gh/data-repository-service-schemas.svg?branch=develop)](https://travis-ci.org/ga4gh/data-repository-service-schemas?branch=develop)
<sup>`develop` branch status: </sup>[![Build Status](https://app.travis-ci.com/ga4gh/data-repository-service-schemas.svg?branch=develop)](https://app.travis-ci.com/ga4gh/data-repository-service-schemas.svg?branch=develop)
<a href="https://ga4gh.github.io/data-repository-service-schemas/preview/develop/swagger.yaml"><img src="http://online.swagger.io/validator?url=https://ga4gh.github.io/data-repository-service-schemas/preview/develop/swagger.yaml" alt="Swagger Validator" height="20em" width="72em"></A> [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1405753.svg)](https://doi.org/10.5281/zenodo.1405753)

The [Global Alliance for Genomics and Health](http://genomicsandhealth.org/) (GA4GH) is an international coalition, formed to enable the sharing of genomic and clinical data.
Expand Down
20 changes: 20 additions & 0 deletions openapi/components/parameters/BulkObjectAccessId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
type: object
description: The object that contains object_id/access_id tuples
properties:
passports:
type: array
items:
type: string
bulk_object_access_ids:
type: array
items:
type: object
properties:
bulk_object_id:
type: string
description: DRS object ID
bulk_access_ids:
type: array
description: DRS object access ID
items:
type: string
14 changes: 14 additions & 0 deletions openapi/components/parameters/BulkObjectId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
description: The object that contains the DRS object IDs array
properties:
passports:
type: array
items:
type: string
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJnYTRnaF9wYXNzcG9ydF92MSI6W119.JJ5rN0ktP0qwyZmIPpxmF_p7JsxAZH6L6brUxtad3CM
description: the encoded JWT GA4GH Passport that contains embedded Visas. The overall JWT is signed as are the individual Passport Visas.
bulk_object_ids:
type: array
items:
type: string
description: An array of ObjectIDs.
9 changes: 9 additions & 0 deletions openapi/components/parameters/BulkObjectIdNoPassport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
description: The object that contains the DRS object IDs array
properties:
bulk_object_ids:
type: array
description: DRS object IDs
items:
type: string
description: An array of ObjectIDs.
7 changes: 7 additions & 0 deletions openapi/components/parameters/BulkObjectSingleAccessId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
description: The object that contains an object_id/access_id tuple
properties:
bulk_object_id:
type: string
bulk_object_access_id:
type: string
14 changes: 14 additions & 0 deletions openapi/components/responses/200OkAccesses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: The `AccessURL` was found successfully
content:
application/json:
schema:
type: object
properties:
summary:
$ref: '../schemas/summary.yaml'
unresolved_drs_objects:
$ref: '../schemas/unresolved.yaml'
resolved_drs_object_access_urls:
type: array
items:
$ref: '../schemas/BulkAccessURL.yaml'
14 changes: 14 additions & 0 deletions openapi/components/responses/200OkBulkAuthorizations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: "`Authorizations` were found successfully"
content:
application/json:
schema:
type: object
properties:
summary:
$ref: '../schemas/summary.yaml'
unresolved_drs_objects:
$ref: '../schemas/unresolved.yaml'
resolved_drs_object:
type: array
items:
$ref: '../schemas/Authorizations.yaml'
14 changes: 14 additions & 0 deletions openapi/components/responses/200OkDrsObjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: The `DrsObjects` were found successfully
content:
application/json:
schema:
type: object
properties:
summary:
$ref: '../schemas/summary.yaml'
unresolved_drs_objects:
$ref: '../schemas/unresolved.yaml'
resolved_drs_object:
type: array
items:
$ref: '../schemas/DrsObject.yaml'
2 changes: 1 addition & 1 deletion openapi/components/responses/404NotFoundDrsObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ description: The requested `DrsObject` wasn't found.
content:
application/json:
schema:
$ref: '../schemas/Error.yaml'
$ref: '../schemas/Error.yaml'
5 changes: 5 additions & 0 deletions openapi/components/responses/413RequestTooLarge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: The bulk request is too large.
content:
application/json:
schema:
$ref: '../schemas/Error.yaml'
2 changes: 2 additions & 0 deletions openapi/components/schemas/Authorizations.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
type: object
properties:
drs_object_id:
type: string
supported_types:
type: array
items:
Expand Down
19 changes: 19 additions & 0 deletions openapi/components/schemas/BulkAccessURL.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
type: object
required:
- url
properties:
drs_object_id:
type: string
drs_access_id:
type: string
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'
4 changes: 4 additions & 0 deletions openapi/components/schemas/DrsService.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ type: object
required:
- type
properties:
maxBulkRequestLength:
type: integer
required: true
description: The max length the bullk request endpoints can handle (>= 1) before generating a 413 error e.g. how long can the arrays bulk_object_ids and bulk_object_access_ids be for this server.
type:
type: object
required:
Expand Down
12 changes: 12 additions & 0 deletions openapi/components/schemas/summary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
description: A summary of what was resolved.
properties:
requested:
type: integer
description: Number of items requested.
resolved:
type: integer
description: Number of objects resolved.
unresolved:
type: integer
description: Number of objects not resolved.
11 changes: 11 additions & 0 deletions openapi/components/schemas/unresolved.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: array
description: Error codes for each unresolved drs objects.
items:
type: object
properties:
error_code:
type: integer
object_ids:
type: array
items:
type: string
8 changes: 6 additions & 2 deletions openapi/data_repository_service.openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
openapi: 3.0.3
info:
title: Data Repository Service
version: 1.3.0
version: 1.4.0
x-logo:
url: 'https://www.ga4gh.org/wp-content/themes/ga4gh-theme/gfx/GA-logo-horizontal-tag-RGB.svg'
url: 'https://www.ga4gh.org/wp-content/themes/ga4gh/dist/assets/svg/logos/logo-full-color.svg'
termsOfService: 'https://www.ga4gh.org/terms-and-conditions/'
contact:
name: GA4GH Cloud Work Stream
Expand Down Expand Up @@ -115,8 +115,12 @@ paths:
$ref: ./paths/service-info.yaml
/objects/{object_id}:
$ref: ./paths/objects@{object_id}.yaml
/objects:
$ref: ./paths/bulkobjects@{object_id}.yaml
/objects/{object_id}/access/{access_id}:
$ref: ./paths/objects@{object_id}@access@{access_id}.yaml
/objects/access:
$ref: ./paths/bulkobjects@access@{access_id}.yaml
components:
securitySchemes:
BasicAuth:
Expand Down
38 changes: 38 additions & 0 deletions openapi/paths/bulkobjects@access@{access_id}.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
post:
summary: Get URLs for fetching bytes from multiple objects with an optional Passport(s).
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).

Currently this is limited to use passports (one or more) or a single bearer token, so make sure your bulk request is for objects that all use the same passports/token.
operationId: GetBulkAccessURL
security:
- PassportAuth: []
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'
413:
$ref: '../components/responses/413RequestTooLarge.yaml'
500:
$ref: '../components/responses/500InternalServerError.yaml'
tags:
- Objects
x-swagger-router-controller: ga4gh.drs.server
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/parameters/BulkObjectAccessId.yaml'
67 changes: 67 additions & 0 deletions openapi/paths/bulkobjects@{object_id}.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
options:
summary: Get Authorization info about multiple DrsObjects.
security:
- {}
description: >-
Returns a structure that contains for each DrsObjects a list of `Authorizations` that can be used to determine how to authorize requests to `GetObject` or `PostObject` (or bulk equivalents).
operationId: OptionsBulkObject
responses:
200:
$ref: '../components/responses/200OkBulkAuthorizations.yaml'
204:
$ref: '../components/responses/AuthorizationsNotSupported.yaml'
400:
$ref: '../components/responses/400BadRequest.yaml'
404:
$ref: '../components/responses/404NotFoundDrsObject.yaml'
405:
$ref: '../components/responses/AuthorizationsNotSupported.yaml'
413:
$ref: '../components/responses/413RequestTooLarge.yaml'
500:
$ref: '../components/responses/500InternalServerError.yaml'
tags:
- Objects
x-swagger-router-controller: ga4gh.drs.server
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/parameters/BulkObjectIdNoPassport.yaml'

post:
summary: Get info about multiple DrsObjects with an optional Passport(s).
description: >-
Returns an array of object metadata, and a list of access methods that can be used to fetch objects' bytes. Currently this is limited to use passports (one or more) or a single bearer token, so make sure your bulk request is for objects that all use the same passports/token.
operationId: GetBulkObjects
security:
- PassportAuth: []
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'
413:
$ref: '../components/responses/413RequestTooLarge.yaml'
500:
$ref: '../components/responses/500InternalServerError.yaml'
tags:
- Objects
x-swagger-router-controller: ga4gh.drs.server
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/parameters/BulkObjectId.yaml'
2 changes: 1 addition & 1 deletion openapi/tags/ServiceRegistry.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Example listing of a DRS API registration from a service registry's `/services`
"type": {
"group": "org.ga4gh",
"artifact": "drs",
"version": "1.3.0"
"version": "1.4.0"
},
"description": "The Data Repository Service (DRS) API ...",
"organization": {
Expand Down
4 changes: 2 additions & 2 deletions pages/more-background-on-compact-identifiers/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
openapi: 3.0.3
info:
title: More Background on Compact Identifiers
version: 1.3.0
version: 1.4.0
x-logo:
url: 'https://www.ga4gh.org/wp-content/themes/ga4gh-theme/gfx/GA-logo-horizontal-tag-RGB.svg'
url: 'https://www.ga4gh.org/wp-content/themes/ga4gh/dist/assets/svg/logos/logo-full-color.svg'
termsOfService: 'https://www.ga4gh.org/terms-and-conditions/'
contact:
name: GA4GH Cloud Work Stream
Expand Down