Skip to content

Commit

Permalink
Merge branch 'release/drs-1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
briandoconnor committed Nov 27, 2023
2 parents 93d70b1 + 3de53f3 commit 7dcfab5
Show file tree
Hide file tree
Showing 23 changed files with 296 additions and 13 deletions.
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.org/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
7 changes: 4 additions & 3 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 All @@ -26,14 +26,15 @@ For more information see our HTML documentation links in the table below.
| **Branch** | **Reference Documentation** | Swagger Editor |
| --- | --- | --- |
| **develop**: the stable development branch, into which feature branches are merged | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/develop/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/develop/openapi.yaml) |
| **release 1.4.0**: The 1.4.0 release of DRS adds bulk operations. | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.4.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.4.0/openapi.yaml) |
| **release 1.3.0**: The 1.3.0 release of DRS adds the ability to use the options request method to return the auth issuers for a specific DRS object. | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.3.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.3.0/openapi.yaml) |
| **release 1.2.0**: The 1.2.0 release of DRS adds the standardized `/service-info` endpoint, and 2 `POST` endpoints that are functionally equivalent to the current `GET` endpoints, but they enable the submission of large passport tokens in the request body. | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.2.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.2.0/openapi.yaml) |
| **release 1.1.0**: The 1.1.0 release of DRS that includes *no* API changes only documentation changes. This introduces a new URI convention using compact identifiers along with clear directions on how to use identifiers.org/n2t.net to resolve them. | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.1.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.1.0/swagger.yaml) |
| **release 1.0.0**: The 1.0.0 release of DRS that is now an approved GA4GH standard | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.0.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-1.0.0/swagger.yaml) |
| **release 0.1**: Simplifying DRS to core functionality | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-0.1.0/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/drs-0.1.0/swagger.yaml) |
| **release 0.0.1**: The initial DRS after the rename from DOS | [HTML](https://ga4gh.github.io/data-repository-service-schemas/preview/release/0.0.1/docs/) | [Swagger Editor](https://editor.swagger.io?url=https://ga4gh.github.io/data-repository-service-schemas/preview/release/0.0.1/swagger.yaml) |

To monitor development work on various branches, add 'preview/\<branch-name\>' to the master URLs above (e.g., 'https://ga4gh.github.io/data-repository-service-schemas/preview/\<branch-name\>/docs').
To monitor development work on various branches, add 'preview/\<branch-name\>' to the master URLs above (e.g., `https://ga4gh.github.io/data-repository-service-schemas/preview/<branch-name>/docs`).

# How to Contribute Changes

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
12 changes: 10 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 @@ -69,6 +69,9 @@ tags:
- name: Motivation
description:
$ref: './tags/Motivation.md'
- name: Working With Compound Objects
description:
$ref: './tags/CompoundObjects.md'
- name: Background Notes on DRS URIs
description:
$ref: './tags/BackgroundNotesOnDRSURIs.md'
Expand Down Expand Up @@ -102,6 +105,7 @@ x-tagGroups:
- name: Appendices
tags:
- Motivation
- Working With Compound Objects
- Background Notes on DRS URIs
- Compact Identifier-Based URIs
- Hostname-Based URIs
Expand All @@ -111,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'
19 changes: 19 additions & 0 deletions openapi/tags/CompoundObjects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Compound Objects

The DRS API supports access to data objects, with each `DrsObject` representing a single opaque blob of bytes. Much content (e.g. VCF files) is well represented as a single atomic `DrsObject`. Some content, however (e.g. DICOM images) is best represented as a compound object consisting of a structured collection of atomic `DrsObject`s. In both cases, DRS isn't aware of the semantics of the objects it serves -- understanding those semantics is the responsibility of the applications that call DRS.

Common examples of compound objects in biomedicine include:
* BAM+BAI genomic reads, with a small index (the BAI object) to large data (the BAM object), each object using a well-defined file format.
* DICOM images, with a contents object pointing to one or more raw image objects, each containing pixels from different aspects of a single logical biomedical image (e.g. different z-coordinates)
* studies, with a single table of contents listing multiple objects of various types that were generated together and are meant to be processed together

## Best Practice: Manifests

As with atomic objects, DRS applications and servers are expected to agree on the semantics of compound objects using non-DRS mechanisms. The recommended best practice for representing a particular compound object type is:
1. Define a manifest file syntax, which contains the DRS IDs of the constituent atomic objects, plus type-specific information about the relationship between those constituents.
* Manifest file syntax isn't prescribed by the spec, but we expect they will often be JSON files.
* For example, for a BAM+BAI pair the manifest file could contain two key-value pairs mapping the type of each constituent file to its DRS ID.
3. Make manifest objects and their constituent objects available using standard DRS mechanisms -- each object is referenced via its own DRS ID, just like any other atomic object.
* For example, for a BAM+BAI pair, there would be three DRS IDs -- one for the manifest, one for the BAM, and one for the BAI.
5. Document the expected client logic for processing compound objects of interest. This logic typically consists of using standard DRS mechanisms to fetch the manifest, parsing its syntax, extracting the DRS IDs of constituent objects, and using standard DRS mechanisms to fetch the constituents as needed.
* In some cases the application will always want to fetch all of the constituents; in other cases it may want to initially fetch a subset, and only fetch the others on demand. For example, a DICOM image viewer may only want to fetch the layers that are being rendered.
Loading

0 comments on commit 7dcfab5

Please sign in to comment.