mytardisΒΆ

Command-line interface for MyTardis REST API.

usage: mytardis [-h] [--verbose]
                {api,config,version,facility,instrument,experiment,dataset,datafile,storagebox,schema}
                ...
Options:
--verbose=False
 More verbose output.
Sub-commands:
api

List models accessible via MyTardis’s REST API.

See mytardis api

usage: mytardis api [-h] {list,get} ...
Sub-commands:
list

List models accessible via MyTardis’s REST API.

usage: mytardis api list [-h] [--json]

  EXAMPLE

  $ mytardis api list

  API Endpoints
  +------------+---------------------+----------------------------+
  | Model      | List Endpoint       | Schema                     |
  +============+=====================+============================+
  | facility   | /api/v1/facility/   | /api/v1/facility/schema/   |
  +------------+---------------------+----------------------------+
  | instrument | /api/v1/instrument/ | /api/v1/instrument/schema/ |
  +------------+---------------------+----------------------------+
  | experiment | /api/v1/experiment/ | /api/v1/experiment/schema/ |
  +------------+---------------------+----------------------------+
  | dataset    | /api/v1/dataset/    | /api/v1/dataset/schema/    |
  +------------+---------------------+----------------------------+
   ...          ...                   ...
  +------------+---------------------+----------------------------+
Options:
--json=False Display results in JSON format.
get

Display the schema for a particular MyTardis API model, showing which fields are accesible via the API, which fields support filtering, and which fields support ordering.

usage: mytardis api get [-h] [--json] api_model

  EXAMPLE

  $ mytardis api get facility
  +------------------+------------------------------------------+
  | API Schema field |                   Value                  |
  +==================+==========================================+
  | Model            | facility                                 |
  +------------------+------------------------------------------+
  | Fields           | id                                       |
  |                  | manager_group                            |
  |                  | name                                     |
  |                  | resource_uri                             |
  +------------------+------------------------------------------+
  | Filtering        | {                                        |
  |                  |   "id": [                                |
  |                  |     "exact"                              |
  |                  |   ],                                     |
  |                  |   "manager_group": "ALL_WITH_RELATIONS", |
  |                  |   "name": [                              |
  |                  |     "exact"                              |
  |                  |   ]                                      |
  |                  | }                                        |
  +------------------+------------------------------------------+
  | Ordering         | {}                                       |
  +------------------+------------------------------------------+
Positional arguments:
api_model The model name.
Options:
--json=False Display results in JSON format.
config

Set MyTardis URL, username and API key.

See mytardis config

usage: mytardis config [-h] [--get KEY]

  EXAMPLE

  $ mytardis config
  MyTardis URL? http://mytardisdemo.erc.monash.edu.au
  MyTardis Username? demofacility
  MyTardis API key? 644be179cc6773c30fc471bad61b50c90897146c

  Wrote settings to /Users/wettenhj/.config/mytardisclient/mytardisclient.cfg

  $ mytardis config --get url
  http://mytardisdemo.erc.monash.edu.au

  $ mytardis config --get username
  demofacility

  $ mytardis config --get apikey
  644be179cc6773c30fc471bad61b50c90897146c

  $ mytardis config --get path
  /Users/wettenhj/.config/mytardisclient/mytardisclient.cfg

  $ mytardis config --get logging_config_path
  /Users/wettenhj/.config/mytardisclient/logging.cfg
Options:
--get Retrieve configuration value from ~/.config/mytardisclient/mytardisclient.cfg
version

Display the MyTardis Client version.

See mytardis version

usage: mytardis version [-h]

$ mytardis version
MyTardis Client v0.0.1
facility

Display a list of facility records or a single facility record.

See mytardis facility

usage: mytardis facility [-h] {list,get} ...
Sub-commands:
list

Display a list of facility records.

usage: mytardis facility list
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]

  EXAMPLE

  $ mytardis facility list

  Model: Facility
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/facility/?format=json
  Total Count: 2
  Limit: 20
  Offset: 0

  +----+---------------+------------------------+
  | ID |     Name      |     Manager Group      |
  +====+===============+========================+
  |  1 | Demo Facility | demo-facility-managers |
  +----+---------------+------------------------+
  |  2 | Test Facility | test-facility-managers |
  +----+---------------+------------------------+
Options:
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
get

Display a single facility record.

usage: mytardis facility get [-h] [--json] facility_id

  EXAMPLE

  $ mytardis facility get 1

  Model: Facility

  +----------------+------------------------+
  | Facility field |         Value          |
  +================+========================+
  | ID             | 1                      |
  +----------------+------------------------+
  | Name           | Demo Facility          |
  +----------------+------------------------+
  | Manager Group  | demo-facility-managers |
  +----------------+------------------------+

  Model: Instrument
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/instrument/?format=json&facility__id=1
  Total Count: 3
  Limit: 20
  Offset: 0

  +----+-------------------------+---------------+
  | ID |          Name           |   Facility    |
  +====+=========================+===============+
  |  3 | Test Instrument         | Demo Facility |
  +----+-------------------------+---------------+
  |  4 | Beamline                | Demo Facility |
  +----+-------------------------+---------------+
  |  8 | James Test Instrument   | Demo Facility |
  +----+-------------------------+---------------+
Positional arguments:
facility_id The facility ID.
Options:
--json=False Display results in JSON format.
instrument

Display a list of instrument records or a single instrument record.

See mytardis instrument

usage: mytardis instrument [-h] {list,get,create,update} ...
Sub-commands:
list

Display a list of instrument records.

usage: mytardis instrument list
    [--facility FACILITY] [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]

  EXAMPLE

  $ mytardis instrument list --facility 1

  Model: Instrument
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/instrument/?format=json&facility__id=1
  Total Count: 3
  Limit: 20
  Offset: 0

  +----+-------------------------+---------------+
  | ID |          Name           |   Facility    |
  +====+=========================+===============+
  |  3 | Test Instrument         | Demo Facility |
  +----+-------------------------+---------------+
  |  4 | Beamline                | Demo Facility |
  +----+-------------------------+---------------+
  |  8 | James Test Instrument   | Demo Facility |
  +----+-------------------------+---------------+
Options:
--facility The facility ID.
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
get

Display a single instrument record.

usage: mytardis instrument get [-h] [--json] instrument_id

  EXAMPLE

  $ mytardis instrument get 3

  +------------------+-----------------+
  | Instrument field |      Value      |
  +==================+=================+
  | ID               | 3               |
  +------------------+-----------------+
  | Name             | Test Instrument |
  +------------------+-----------------+
  | Facility         | Demo Facility   |
  +------------------+-----------------+
Positional arguments:
instrument_id The instrument ID.
Options:
--json=False Display results in JSON format.
create

Create an instrument record.

usage: mytardis instrument create [-h] facility_id name

  EXAMPLE

  $ mytardis instrument create 1 "New Instrument"
  +------------------+----------------+
  | Instrument field |     Value      |
  +==================+================+
  | ID               | 9              |
  +------------------+----------------+
  | Name             | New Instrument |
  +------------------+----------------+
  | Facility         | Demo Facility  |
  +------------------+----------------+

  Instrument created successfully.
Positional arguments:
facility_id The ID of the new instrument’s facility.
name The name of the instrument to create.
update

Update/rename an existing instrument record.

usage: mytardis instrument update [-h] [--name NAME] instrument_id

  EXAMPLE

  $ mytardis instrument update --name "Renamed New Instrument" 9

  +------------------+------------------------+
  | Instrument field |         Value          |
  +==================+========================+
  | ID               | 9                      |
  +------------------+------------------------+
  | Name             | Renamed New Instrument |
  +------------------+------------------------+
  | Facility         | Demo Facility          |
  +------------------+------------------------+

  Instrument updated successfully.
Positional arguments:
instrument_id The ID of the instrument to update.
Options:
--name The new name of the instrument.
experiment

Display a list of experiment records or a single experiment record.

See mytardis experiment

usage: mytardis experiment [-h] {list,get,create,update} ...
Sub-commands:
list

Display a list of experiment records.

usage: mytardis experiment list
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]
    [--filter FILTER]

  EXAMPLE

  $ mytardis experiment list

  Model: Experiment
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/experiment/?format=json
  Total Count: 4
  Limit: 20
  Offset: 0

  +----+-------------------+-----------------------------------+
  | ID |    Institution    |               Title               |
  +====+===================+===================================+
  | 20 | Monash University | James Exp 001                     |
  +----+-------------------+-----------------------------------+
  | 13 | Monash University | A's Test Instrument - Test User1  |
  +----+-------------------+-----------------------------------+
  | 22 | Monash University | James Test Exp 003                |
  +----+-------------------+-----------------------------------+
  | 14 | Monash University | A's Test Instrument - Test User2  |
  +----+-------------------+-----------------------------------+
Options:
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
--filter Filter on these fields, e.g. “title=Exp Title”.
get

Display a single experiment record.

usage: mytardis experiment get [-h] [--json] experiment_id

  EXAMPLE

  $ mytardis experiment get 20

  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 20                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | James Exp 001     |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  +------------+------------------------+------------------------+------------+
  | Dataset ID |     Experiment(s)      |      Description       | Instrument |
  +============+========================+========================+============+
  |         34 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
  |         33 | /api/v1/experiment/20/ | James Test Dataset 003 | None       |
  +------------+------------------------+------------------------+------------+
  |         32 | /api/v1/experiment/20/ | James Test Dataset 002 | None       |
  +------------+------------------------+------------------------+------------+
  |         31 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
Positional arguments:
experiment_id The experiment ID.
Options:
--json=False Display results in JSON format.
create

Create an experiment record.

usage: mytardis experiment create
    [--description DESCRIPTION] [--institution INSTITUTION] [--params PARAMS] title

  EXAMPLE

  First let's look up an experiment schema we can use to add some
  metadata to the new experiment record.

  $ mytardis schema list

  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | ID |           Name            |                         Namespace                         |       Type        | Subtype | Immutable | Hidden |
  +====+===========================+===========================================================+===================+=========+===========+========+
   ...  ...                         ...                                                         ...                 ...       ...         ...
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | 12 | Sample Experiment Schema  | https://mytardis.org/schemas/sample-experiment-schema     | Experiment schema |         | False     | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+

  "mytardis schema get <schema_id>" displays the parameters
  associated with this schema:

  $ mytardis schema get 12
  +--------------+-------------------------------------------------------+
  | Schema field |                         Value                         |
  +==============+=======================================================+
  | ID           | 12                                                    |
  +--------------+-------------------------------------------------------+
  | Name         | Sample Experiment Schema                              |
  +--------------+-------------------------------------------------------+
  | Namespace    | https://mytardis.org/schemas/sample-experiment-schema |
  +--------------+-------------------------------------------------------+
  | Type         | Experiment schema                                     |
  +--------------+-------------------------------------------------------+
  | Subtype      |                                                       |
  +--------------+-------------------------------------------------------+
  | Immutable    | False                                                 |
  +--------------+-------------------------------------------------------+
  | Hidden       | False                                                 |
  +--------------+-------------------------------------------------------+

  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+
  | ParameterName ID |       Full Name       |         Name          | Data Type | Units | Immutable | Is Searchable | Order | Choices | Comparison Type |
  +==================+=======================+=======================+===========+=======+===========+===============+=======+=========+=================+
  |               33 | Sample Parameter Name | sample_parameter_name | String    |       | False     | False         | 9999  |         | Exact value     |
  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+

  Now that we know the schema's namespace, the parameter name(s) and
  their data type(s), we can create some experiment metadata.

  Below we use cat to create the metadata file, but you can use
  any text editor.

  $ cat << EOF > params.json
  [
      {
          "schema": "https://mytardis.org/schemas/sample-experiment-schema",
          "parameters": [
              {
                  "name": "sample_parameter_name",
                  "value": "Sample Parameter Value"
              }
          ]
      }
  ]
  EOF

  Now we create the experiment record, using the metadata file
  we just created:

  $ mytardis experiment create --params params.json "Exp With Params"
  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 28                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | Exp With Params   |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  +------------------------+--------------------------+-----------------------+------------------------+-----------------+----------------+---------+
  | ExperimentParameter ID |          Schema          |    Parameter Name     |      String Value      | Numerical Value | Datetime Value | Link ID |
  +========================+==========================+=======================+========================+=================+================+=========+
  |                     35 | Sample Experiment Schema | Sample Parameter Name | Sample Parameter Value |                 |                |         |
  +------------------------+--------------------------+-----------------------+------------------------+-----------------+----------------+---------+

  Experiment created successfully.
Positional arguments:
title The experiment title to create.
Options:
--description A description of the experiment.
--institution The institution of the experiment.
--params A JSON file containing experiment parameters.
update

Update an experiment record.

usage: mytardis experiment update
    [--title TITLE] [--description DESCRIPTION] experiment_id

  EXAMPLE
  $ mytardis experiment update --title "Renamed Exp" 20
  +------------------+-------------------+
  | Experiment field |       Value       |
  +==================+===================+
  | ID               | 20                |
  +------------------+-------------------+
  | Institution      | Monash University |
  +------------------+-------------------+
  | Title            | Renamed Exp       |
  +------------------+-------------------+
  | Description      |                   |
  +------------------+-------------------+

  Experiment updated successfully.
Positional arguments:
experiment_id The ID of the experiment to update.
Options:
--title The new title of the experiment.
--description The new description of the experiment.
dataset

Display a list of dataset records or a single dataset record.

See mytardis dataset

usage: mytardis dataset [-h] {list,get,create,update} ...
Sub-commands:
list

Display a list of dataset records.

usage: mytardis dataset list
    [--exp EXP] [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]
    [--filter FILTER]

  EXAMPLE

  $ mytardis dataset list --exp 20

  Model: Dataset
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/dataset/?format=json&experiments__id=20
  Total Count: 4
  Limit: 20
  Offset: 0

  +------------+------------------------+------------------------+------------+
  | Dataset ID |     Experiment(s)      |      Description       | Instrument |
  +============+========================+========================+============+
  |         34 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
  |         33 | /api/v1/experiment/20/ | James Test Dataset 003 | None       |
  +------------+------------------------+------------------------+------------+
  |         32 | /api/v1/experiment/20/ | James Test Dataset 002 | None       |
  +------------+------------------------+------------------------+------------+
  |         31 | /api/v1/experiment/20/ | James Test Dataset 001 | None       |
  +------------+------------------------+------------------------+------------+
Options:
--exp The experiment ID.
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
--filter Filter on these fields, e.g. “description=Dataset Description”.
get

Display a single dataset record.

usage: mytardis dataset get [-h] [--json] dataset_id

  EXAMPLE

  Suppose we want to retrieve a dataset record with dataset_id=35.
  The "mytardis dataset get 35" command will also display any
  dataset parameters associated with the dataset and any
  datafiles associated with it.  The datafile query could result
  in pagination.  If "Total Count" (below) is greater
  than "Limit", then there are additional pages of datafiles
  not shown in the dataset view below.

  $ mytardis dataset get 35
  +---------------+------------------------+
  | Dataset field |         Value          |
  +===============+========================+
  | ID            | 35                     |
  +---------------+------------------------+
  | Experiment(s) | /api/v1/experiment/24/ |
  +---------------+------------------------+
  | Description   | James Test Dataset 004 |
  +---------------+------------------------+
  | Instrument    | None                   |
  +---------------+------------------------+

  +---------------------+---------------------+------------------------+-------------------------+-----------------+----------------+---------+
  | DatasetParameter ID |       Schema        |     Parameter Name     |      String Value       | Numerical Value | Datetime Value | Link ID |
  +=====================+=====================+========================+=========================+=================+================+=========+
  |                   1 | Test dataset schema | Example Parameter Name | Example Parameter Value |                 |                |         |
  +---------------------+---------------------+------------------------+-------------------------+-----------------+----------------+---------+

  Model: DataFile
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/dataset_file/?format=json&dataset__id=35
  Total Count: 2
  Limit: 20
  Offset: 0

  +--------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
  | DataFile ID  | Directory | Filename  |                 URI                 | Verified |   Size    |             MD5 Sum              |
  +==============+===========+===========+=====================================+==========+===========+==================================+
  |          120 |           | hello.txt | James Test Dataset 004-35/hello.txt | True     |  25 bytes | 214e52fcf7f98d9fb8588b42cfb7987f |
  +--------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
  |          121 |           | test.txt  | James Test Dataset 004-35/test.txt  | False    |   8 bytes | 74119cb1c9568b96feb7fa392006e40f |
  +--------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
Positional arguments:
dataset_id The dataset ID.
Options:
--json=False Display results in JSON format.
create

Create a dataset record.

usage: mytardis dataset create
    [--instrument INSTRUMENT] [--params PARAMS] experiment_id description

  EXAMPLE

  First let's look up a dataset schema we can use to add some
  metadata to the new experiment record.

  $ mytardis schema list

  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | ID |           Name            |                         Namespace                         |       Type        | Subtype | Immutable | Hidden |
  +====+===========================+===========================================================+===================+=========+===========+========+
   ...  ...                         ...                                                         ...                 ...       ...         ...
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | 13 | Sample Dataset Schema     | https://mytardis.org/schemas/sample-dataset-schema        | Dataset schema    |         | False     | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+

  "mytardis schema get <schema_id>" displays the parameters
  associated with this schema:

  $ mytardis schema get 13
  +--------------+----------------------------------------------------+
  | Schema field |                       Value                        |
  +==============+====================================================+
  | ID           | 13                                                 |
  +--------------+----------------------------------------------------+
  | Name         | Sample Dataset Schema                              |
  +--------------+----------------------------------------------------+
  | Namespace    | https://mytardis.org/schemas/sample-dataset-schema |
  +--------------+----------------------------------------------------+
  | Type         | Dataset schema                                     |
  +--------------+----------------------------------------------------+
  | Subtype      |                                                    |
  +--------------+----------------------------------------------------+
  | Immutable    | False                                              |
  +--------------+----------------------------------------------------+
  | Hidden       | False                                              |
  +--------------+----------------------------------------------------+

  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+
  | ParameterName ID |       Full Name       |         Name          | Data Type | Units | Immutable | Is Searchable | Order | Choices | Comparison Type |
  +==================+=======================+=======================+===========+=======+===========+===============+=======+=========+=================+
  |               34 | Sample Parameter Name | sample_parameter_name | String    |       | False     | False         | 9999  |         | Exact value     |
  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+

  Now that we know the schema's namespace, the parameter name(s) and
  their data type(s), we can create some dataset metadata.

  Below we use cat to create the metadata file, but you can use
  any text editor.

  $ cat << EOF > params.json
  [
      {
          "schema": "https://mytardis.org/schemas/sample-dataset-schema",
          "parameters": [
              {
                  "name": "sample_parameter_name",
                  "value": "Sample Parameter Value"
              }
          ]
      }
  ]
  EOF

  Now we create the dataset record (and associate it with experiment
  ID 20) , using the metadata file we just created:

  $ mytardis dataset create --params params.json 20 "Dataset With Params"
  +---------------+------------------------+
  | Dataset field |         Value          |
  +===============+========================+
  | ID            | 39                     |
  +---------------+------------------------+
  | Experiment(s) | /api/v1/experiment/20/ |
  +---------------+------------------------+
  | Description   | Dataset With Params    |
  +---------------+------------------------+
  | Instrument    | None                   |
  +---------------+------------------------+

  +---------------------+-----------------------+-----------------------+------------------------+-----------------+----------------+---------+
  | DatasetParameter ID |        Schema         |    Parameter Name     |      String Value      | Numerical Value | Datetime Value | Link ID |
  +=====================+=======================+=======================+========================+=================+================+=========+
  |                   3 | Sample Dataset Schema | Sample Parameter Name | Sample Parameter Value |                 |                |         |
  +---------------------+-----------------------+-----------------------+------------------------+-----------------+----------------+---------+

  Dataset created successfully.
Positional arguments:
experiment_id The experiment ID.
description The dataset description.
Options:
--instrument The instrument ID.
--params A JSON file containing dataset parameters.
update

Update a dataset record.

usage: mytardis dataset update
    [--description DESCRIPTION] dataset_id

  EXAMPLE
  $ mytardis dataset update --description "Renamed Dataset" 39
  HTTP 401
  Traceback (most recent call last):
    ...
  Exception

  Dataset updates are not yet enabled in the MyTardis API.
  See the "update_detail" method in tardis/tardis_portal/api.py
Positional arguments:
dataset_id The ID of the dataset to update.
Options:
--description The new description of the dataset.
datafile

Display a list of datafile records or a single datafile record.

See mytardis datafile

usage: mytardis datafile [-h] {list,get,create,update,download,upload} ...
Sub-commands:
list

Display a list of datafile records.

usage: mytardis datafile list
    [--dataset DATASET] [--directory DIRECTORY] [--filename FILENAME]
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]
    [--filter FILTER]

  EXAMPLE

  $ mytardis datafile list --dataset 35

  Model: DataFile
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/dataset_file/?format=json&dataset__id=35
  Total Count: 2
  Limit: 20
  Offset: 0

  +-------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
  | DataFile ID | Directory | Filename  |                 URI                 | Verified |   Size    |             MD5 Sum              |
  +=============+===========+===========+=====================================+==========+===========+==================================+
  |         120 |           | hello.txt | James Test Dataset 004-35/hello.txt | True     |  25 bytes | 214e52fcf7f98d9fb8588b42cfb7987f |
  +-------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
  |         121 |           | test.txt  | James Test Dataset 004-35/test.txt  | False    |   8 bytes | 74119cb1c9568b96feb7fa392006e40f |
  +-------------+-----------+-----------+-------------------------------------+----------+-----------+----------------------------------+
Options:
--dataset The dataset ID.
--directory The subdirectory within the dataset.
--filename The datafile’s name.
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
--filter Filter on these fields, e.g. “filename=file1.txt”.
get

Display a single datafile record.

usage: mytardis datafile get [--json] datafile_id

  EXAMPLE

  $ mytardis datafile get 99
  +----------------+-------------------------------------+
  | DataFile field |                Value                |
  +================+=====================================+
  | ID             | 99                                  |
  +----------------+-------------------------------------+
  | Dataset        | /api/v1/dataset/31/                 |
  +----------------+-------------------------------------+
  | Filename       | hello.txt                           |
  +----------------+-------------------------------------+
  | URI            | James Test Dataset 001-31/hello.txt |
  +----------------+-------------------------------------+
  | Verified       | True                                |
  +----------------+-------------------------------------+
  | Size           |  13 bytes                           |
  +----------------+-------------------------------------+
  | MD5 Sum        | 9af2f8218b150c351ad802c6f3d66abe    |
  +----------------+-------------------------------------+
Positional arguments:
datafile_id The datafile ID.
Options:
--json=False Display results in JSON format.
create

Create a datafile record.

usage: mytardis datafile create
    [-s STORAGEBOX] [-d DATASET_PATH] dataset_id path

  EXAMPLE

  $ mytardis datafile create 31 dataset1/test.txt

  Model: DataFile

  +----------------+------------------------------------+
  | DataFile field |               Value                |
  +================+====================================+
  | ID             | 119                                |
  +----------------+------------------------------------+
  | Dataset        | /api/v1/dataset/31/                |
  +----------------+------------------------------------+
  | Storage Box    | default                            |
  +----------------+------------------------------------+
  | Directory      |                                    |
  +----------------+------------------------------------+
  | Filename       | test.txt                           |
  +----------------+------------------------------------+
  | URI            | James Test Dataset 001-31/test.txt |
  +----------------+------------------------------------+
  | Verified       | False                              |
  +----------------+------------------------------------+
  | Size           |   5 bytes                          |
  +----------------+------------------------------------+
  | MD5 Sum        | 2205e48de5f93c784733ffcca841d2b5   |
  +----------------+------------------------------------+
Positional arguments:
dataset_id The dataset ID.
path The file to be represented in the datafile record, or a directory containing the datafiles to create records for. If a relative path is provided, the first component will be assumed to be the local dataset path.
Options:
-s, --storagebox
 The storage box containing the datafile.
-d, --dataset_path
 The local dataset path.
download

Download a datafile.

usage: mytardis datafile download datafile_id

  EXAMPLE

  $ mytardis datafile download 99
  Downloaded: hello.txt
Positional arguments:
datafile_id The datafile ID.
upload

Upload a datafile.

usage: mytardis datafile upload
    [-s STORAGEBOX] [-d DATASET_PATH] dataset_id file_path

  EXAMPLE

  We will upload datafile "new_datafile.txt" to dataset ID 35:

  $ mytardis datafile upload 35 new_datafile.txt
  Uploaded: new_datafile.txt

  Now let's display dataset 35 (including its datafiles) and
  check whether our new datafile has been uploaded:

  $ mytardis dataset get 35
  +---------------+------------------------+
  | Dataset field |         Value          |
  +===============+========================+
  | ID            | 35                     |
  +---------------+------------------------+
  | Experiment(s) | /api/v1/experiment/24/ |
  +---------------+------------------------+
  | Description   | James Test Dataset 004 |
  +---------------+------------------------+
  | Instrument    | None                   |
  +---------------+------------------------+

  +---------------------+---------------------+------------------------+-------------------------+-----------------+----------------+---------+
  | DatasetParameter ID |       Schema        |     Parameter Name     |      String Value       | Numerical Value | Datetime Value | Link ID |
  +=====================+=====================+========================+=========================+=================+================+=========+
  |                   1 | Test dataset schema | Example Parameter Name | Example Parameter Value |                 |                |         |
  +---------------------+---------------------+------------------------+-------------------------+-----------------+----------------+---------+

  Model: DataFile
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/dataset_file/?format=json&dataset__id=35
  Total Count: 3
  Limit: 20
  Offset: 0

  +-------------+-----------+------------------+--------------------------------------------+----------+-----------+----------------------------------+
  | DataFile ID | Directory |     Filename     |                    URI                     | Verified |   Size    |             MD5 Sum              |
  +=============+===========+==================+============================================+==========+===========+==================================+
  |         120 |           | hello.txt        | James Test Dataset 004-35/hello.txt        | True     |  25 bytes | 214e52fcf7f98d9fb8588b42cfb7987f |
  +-------------+-----------+------------------+--------------------------------------------+----------+-----------+----------------------------------+
  |         121 |           | test.txt         | James Test Dataset 004-35/test.txt         | False    |   8 bytes | 74119cb1c9568b96feb7fa392006e40f |
  +-------------+-----------+------------------+--------------------------------------------+----------+-----------+----------------------------------+
  |         131 |           | new_datafile.txt | James Test Dataset 004-35/new_datafile.txt | True     |  21 bytes | 2ce6aa694791def6de39b3fccead9d87 |
  +-------------+-----------+------------------+--------------------------------------------+----------+-----------+----------------------------------+
Positional arguments:
dataset_id The dataset ID.
file_path The file to upload.
Options:
-s, --storagebox
 The storage box which will store the datafile.
-d, --dataset_path
 The local dataset path.
update

Update a datafile record.

usage: mytardis datafile update [--md5sum MD5SUM] datafile_id

  EXAMPLE

  $ mytardis datafile update --md5sum "md5-sum" 99
  HTTP 401
  Traceback (most recent call last):
    ...
  Exception

  Datafile updates are not yet enabled in the MyTardis API.
  See the "update_detail" method in tardis/tardis_portal/api.py

  Being able to update the MD5 sum would be useful for really
  large datafiles where calculating the MD5 sum is time-consuming.
  Rather than waiting until the MD5 sum calculation is complete to
  begin a datafile upload, the datafile upload could begin
  immediately (supplying a bogus MD5 sum to MyTardis), and then
  the MD5 sum could be updated once the calculation is complete.
Positional arguments:
datafile_id The ID of the datafile to update.
Options:
--md5sum The new MD5 sum of the datafile.
verify

Ask MyTardis to verify a datafile record.

usage: mytardis datafile verify datafile_id

  EXAMPLE

  $ mytardis datafile verify 99
Positional arguments:
datafile_id The datafile ID.
storagebox

Display a list of storage box records or a single storage box record.

See mytardis storagebox

usage: mytardis storagebox [-h] {list,get} ...
Sub-commands:
list

Display a list of storage box records.

usage: mytardis storagebox list
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]

  EXAMPLE

  $ mytardis storagebox list

  Model: StorageBox
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/storagebox/?format=json
  Total Count: 2
  Limit: 20
  Offset: 0

  +----+------------------------------------------------+-----------------+
  | ID |                      Name                      |   Description   |
  +====+================================================+=================+
  |  1 | local box at /opt/mytardis/develop/var/store   | Default Storage |
  +----+------------------------------------------------+-----------------+
  |  2 | local box at /opt/mytardis/develop/var/staging | Default Staging |
  +----+------------------------------------------------+-----------------+
Options:
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
get

Display a single storage box record.

usage: mytardis storagebox get [-h] [--json] storage_box_id

  EXAMPLE

  $ mytardis storagebox get 2
  +----------------------+-------------------------------------------------------------+
  |   StorageBox field   |                            Value                            |
  +======================+=============================================================+
  | ID                   | 2                                                           |
  +----------------------+-------------------------------------------------------------+
  | Name                 | local box at /opt/mytardis/develop/var/staging              |
  +----------------------+-------------------------------------------------------------+
  | Description          | Default Staging                                             |
  +----------------------+-------------------------------------------------------------+
  | Django Storage Class | tardis.tardis_portal.storage.MyTardisLocalFileSystemStorage |
  +----------------------+-------------------------------------------------------------+
  | Max Size             | 2.842e+10                                                   |
  +----------------------+-------------------------------------------------------------+
  | Status               | dirty                                                       |
  +----------------------+-------------------------------------------------------------+

  +----------------------+-----------------------------------+
  | StorageBoxOption Key |      StorageBoxOption Value       |
  +======================+===================================+
  |             location | /opt/mytardis/develop/var/staging |
  +----------------------+-----------------------------------+

  +-------------------------+--------------------------------+
  | StorageBoxAttribute Key |   StorageBoxAttribute Value    |
  +=========================+================================+
  |            scp_username | mydata                         |
  +-------------------------+--------------------------------+
  |            scp_hostname | mytardisdemo.erc.monash.edu.au |
  +-------------------------+--------------------------------+
Positional arguments:
storage_box_id The storage box ID.
Options:
--json=False Display results in JSON format.
schema

Display a list of schema records or a single schema record.

See mytardis schema

usage: mytardis schema [-h] {list,get} ...
Sub-commands:
list

Display a list of schema records.

usage: mytardis schema list
    [--limit LIMIT] [--offset OFFSET] [--order_by ORDER_BY] [--json]

  EXAMPLE

  $ mytardis schema list

  Model: Schema
  Query: http://mytardisdemo.erc.monash.edu.au/api/v1/schema/?format=json
  Total Count: 13
  Limit: 20
  Offset: 0

  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | ID |           Name            |                         Namespace                         |       Type        | Subtype | Immutable | Hidden |
  +====+===========================+===========================================================+===================+=========+===========+========+
  |  1 | Publication               | http://www.tardis.edu.au/schemas/publication/             | Experiment schema |         | True      | True   |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  |  2 | Draft Publication         | http://www.tardis.edu.au/schemas/publication/draft/       | Experiment schema |         | True      | True   |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  |  3 | Publication Details       | http://www.tardis.edu.au/schemas/publication/details/     | Experiment schema |         | True      | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  |  8 | MyData Default Experiment | http://mytardis.org/schemas/mydata/defaultexperiment      | Experiment schema |         | True      | True   |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | 13 | Sample Dataset Schema     | https://mytardis.org/schemas/sample-dataset-schema        | Dataset schema    |         | False     | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
  | 12 | Sample Experiment Schema  | https://mytardis.org/schemas/sample-experiment-schema     | Experiment schema |         | False     | False  |
  +----+---------------------------+-----------------------------------------------------------+-------------------+---------+-----------+--------+
Options:
--limit Maximum number of results to return.
--offset Skip this many records from the start of the result set.
--order_by Order by this field.
--json=False Display results in JSON format.
get

Display a single schema record.

usage: mytardis schema get [-h] [--json] schema_id

  EXAMPLE

  $ mytardis schema get 12
  +--------------+-------------------------------------------------------+
  | Schema field |                         Value                         |
  +==============+=======================================================+
  | ID           | 12                                                    |
  +--------------+-------------------------------------------------------+
  | Name         | Sample Experiment Schema                              |
  +--------------+-------------------------------------------------------+
  | Namespace    | https://mytardis.org/schemas/sample-experiment-schema |
  +--------------+-------------------------------------------------------+
  | Type         | Experiment schema                                     |
  +--------------+-------------------------------------------------------+
  | Subtype      |                                                       |
  +--------------+-------------------------------------------------------+
  | Immutable    | False                                                 |
  +--------------+-------------------------------------------------------+
  | Hidden       | False                                                 |
  +--------------+-------------------------------------------------------+

  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+
  | ParameterName ID |       Full Name       |         Name          | Data Type | Units | Immutable | Is Searchable | Order | Choices | Comparison Type |
  +==================+=======================+=======================+===========+=======+===========+===============+=======+=========+=================+
  |               33 | Sample Parameter Name | sample_parameter_name | String    |       | False     | False         | 9999  |         | Exact value     |
  +------------------+-----------------------+-----------------------+-----------+-------+-----------+---------------+-------+---------+-----------------+
Positional arguments:
schema_id The schema ID.
Options:
--json=False Display results in JSON format.