Data Object Service Demonstration Server

DOS Demonstration Server

Running this server will start an ephemeral Data Object Service (its registry contents won’t be saved after exiting). It uses the connexion module to translate the OpenAPI schema into named controller functions.

These functions are described in ga4gh.dos.controllers and are meant to provide a simple implementation of DOS.

Data Object Service Controller Functions

These controller functions for the demo server implement an opinionated version of DOS by providing uuid’s to newly create objects, and using timestamp versions.

Initializes an in-memory dictionary for storing Data Objects.

ga4gh.dos.controllers.CreateDataBundle(**kwargs)[source]

Create a Data Bundle, issuing a new identifier if one is not provided.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.CreateDataObject(**kwargs)[source]

Creates a new Data Object by issuing an identifier if it is not provided.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.DeleteDataBundle(**kwargs)[source]

Deletes a Data Bundle by ID.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.DeleteDataObject(**kwargs)[source]

Delete a Data Object by data_object_id.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.GetDataBundle(**kwargs)[source]

Get a Data Bundle by identifier.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.GetDataBundleVersions(**kwargs)[source]

Get all versions of a Data Bundle.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.GetDataObject(**kwargs)[source]

Get a Data Object by data_object_id. :param kwargs: :return:

ga4gh.dos.controllers.GetDataObjectVersions(**kwargs)[source]

Returns all versions of a Data Object. :param kwargs: :return:

ga4gh.dos.controllers.ListDataBundles(**kwargs)[source]

Takes a ListDataBundles request and returns the bundles that match that request. Possible kwargs: alias, url, checksum, checksum_type, page_size, page_token

Parameters:kwargs – ListDataBundles request.
Returns:
ga4gh.dos.controllers.ListDataObjects(**kwargs)[source]

Returns a list of Data Objects matching a ListDataObjectsRequest.

Parameters:kwargs – alias, url, checksum, checksum_type, page_size, page_token
Returns:
ga4gh.dos.controllers.UpdateDataBundle(**kwargs)[source]

Updates a Data Bundle to include new metadata by upserting the new bundle.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.UpdateDataObject(**kwargs)[source]

Update a Data Object by creating a new version.

Parameters:kwargs
Returns:
ga4gh.dos.controllers.add_created_timestamps(doc)[source]

Adds created and updated timestamps to the document. :param doc: A document to be timestamped :return doc: The timestamped document

ga4gh.dos.controllers.add_updated_timestamps(doc)[source]

Adds created and updated timestamps to the document.

ga4gh.dos.controllers.create(body, key)[source]

Creates a new document at the given key by adding necessary metadata and storing in the in-memory store. :param body: :param key: :return:

ga4gh.dos.controllers.filter_data_bundles(predicate)[source]

Filters data bundles according to a function that acts on each item returning either True or False per item. :param predicate: A function used to test items :return: List of Data Bundles

ga4gh.dos.controllers.filter_data_objects(predicate)[source]

Filters data objects according to a function that acts on each item returning either True or False per item.

ga4gh.dos.controllers.get_most_recent(key)[source]

Gets the most recent Data Object for a key. :param key: :return:

ga4gh.dos.controllers.get_most_recent_bundle(key)[source]

Returns the most recent bundle for the given key.

Parameters:key
Returns:
ga4gh.dos.controllers.now()[source]

Returns the current time in string format. :return: Current ISO time.