Skip to content

R24 File Metadata API

Gene Hsu edited this page Feb 27, 2019 · 1 revision

File Metadata API

The R24 will implement an API so that BCDC may retrieve the download URL for a given file. The file is specified by its namespace and identifier.

GET <prefix>/<namespace>/files/<file identifier>

This is a proposed interface for file retrieval. An example request may be the following, where namespace is example and file identifier is foo/foo.fastq.gz.

GET <prefix>/example/files/foo%2Ffoo.fastq.gz

An example response may be the following

{
  "namespace": "example",
  "file_identifier": "foo/foo.fastq.gz",
  "URL": "http://biccn.r24.org/downloads/example/foo/foo.fastq.gz",
  "checksum": "22dbf4d138bebdbe1f4faff956e263f9",
  "checksum_type": "sha1",
  "file_type": "fastq.gz",
  "file_size": 12345678
}

GET <prefix>/<namespace>/files/?start_datetime=<datetime>

This is a proposed batch interface for file metadata retrieval. File metadata for files updated since the specified argument to start_datetime will be retrieved.

datetime should be formatted in ISO 8601 extended date time format, e.g. yyyy-mm-ddThh:mm:ss.nnnnnn[+-]hh:mm or use of Z instead of the [+-]hh:mm time zone specifier to indicate UTC.