Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 3.02 KB

2021-08-11.md

File metadata and controls

73 lines (53 loc) · 3.02 KB

11 August 2021

or, …

  • Zen Desk for hello@nextstrain.org?

  • API and CLI for upload (and how it relates to download interfaces)

    • User specifies the URL they want; JSON/Markdown filenames don't matter (except maybe for sidecar identification; see below).

    • Server stores files on the backend (S3) with the necessary names, but this is an internal implementation detail and something a Groups user doesn't need to worry about. They just specify where they want the dataset or narrative to appear.

    • Sidecars are identified client-side by one of or some combination of:

      • Filename suffixes (_tip-frequencies, _root-sequence, etc)
      • Content inspection (contains expected keys for a given sidecar type; not full validation)
      • Schema validation
    • Clients (e.g. the CLI or even curl) can upload a single dataset with multiple PUTs of individual files:

      curl https://nextstrain.org/groups/blab/some/name \
        -H 'Content-Type: application/json' \
        -T auspice/foo.json
      
      curl https://nextstrain.org/groups/blab/some/name?root-sequence \
        -H 'Content-Type: application/json' \
        -T auspice/foo_root-sequence.json
      
      curl https://nextstrain.org/groups/blab/some/name?tip-frequencies \
        -H 'Content-Type: application/json' \
        -T auspice/foo_tip-frequencies.json
      

      or maybe

      curl https://nextstrain.org/groups/blab/some/name \
        -H 'Content-Type: application/vnd.nextstrain.v2.main+json' \
        -T auspice/foo.json
      
      curl https://nextstrain.org/groups/blab/some/name \
        -H 'Content-Type: application/vnd.nextstrain.v2.root-sequence+json' \
        -T auspice/foo_root-sequence.json
      
      curl https://nextstrain.org/groups/blab/some/name \
        -H 'Content-Type: application/vnd.nextstrain.v2.tip-frequencies+json' \
        -T auspice/foo_tip-frequencies.json
      

      (These same endpoints would support GET and DELETE requests.)

      or with a single POST of multiple files:

      curl https://nextstrain.org/groups/blab/some/name \
        -F main=@auspice/foo.json \
        -F root-sequence=@auspice/foo_root-sequence.json \
        -F tip-frequencies=@auspice/foo_tip-frequencies.json
      
    • Clients can support upload of multiple datasets by organizing local files by their common prefix and doing the conventional filename → desired URL transformation.

      Contrary to some previous thinking, this responsibility of handling filenames seems best left with the clients, as clients have direct interaction with the user and can better provide options or interactive prompts to nail down the user's intent.

    • By decoupling local filenames from the determination of nextstrain.org URL, the ability of downloaded files to round-trip no longer matters as much.

    See also my additional notes the following week.