Orion CLI¶
Options¶
The Orion CLI has several top level options that modify the behavior of the commands that are run.
Timeout¶
The --timeout
flag can be used to set the request timeout in seconds,
i.e. if the server takes longer to respond to a request than the specified
number of seconds, the client disconnects. The default value is 5, but for
certain operations, such as sharing a package with many cubes to many users,
the default is too short.
JSON¶
The --json
flag can be used to have the Orion CLI return JSON
rather than plaintext to make it easier parse the results
ocli --json <command>
Profile¶
The --profile
flag specifies which profile configuration to use while
making requests to the Orion API. The default is the default
profile
ocli --profile=testing <command>
Max Retries¶
The --max-retries
flag specifies the number of times that the client
will retry a connection if it fails or gets a 404 error. This is set to 2
by default. There is back off implemented with the retries, so the time will
increase exponentially (to a certain point) with the number of retries.
Shard uploads and downloads are unaffected by --max-retries
.
ocli --max-retries=5 <command>
Configuration Commands¶
To configure an Orion Profile
ocli config profile --url <hostname> --username <username> [--password <text>] [--with-token] [--project <project_id>]
To configure an Orion Profile for use with SAML requires first creating a token in the web interface’s user profile page
ocli config profile --url <hostname> --username <username> --with-token [--project <project_id>]
To change the default project of an Orion Profile
ocli config project
To delete an Orion Profile
ocli config delete <profile_name>
To retrieve information about the current profile
ocli config info
To list the configured profiles
ocli config list
To refresh your Orion Profile token
ocli config token
Storage Commands¶
Datasets¶
The CLI provides several ways to interact with datasets
Using the id of a dataset it is possible to access all of the information associated with the dataset
ocli datasets info <resource_id>
To delete a dataset, use the following command
ocli datasets delete <resource_id>
To list the datasets the current orion profile has access to. The arguments
passed after list are used as query parameters. For example
tags=2D,3D name=foo
or name=aspirin
.
ocli datasets list [--project=<integer>] [--name=<string>] [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
To upload a dataset, pass the local path to the file and the client will create a new dataset. Handles any OEChem readable format, except JSON.
ocli datasets upload <file> [--project=<identifier>]
The following command will download a dataset, with any OEChem writable format except JSON, to your local file system.
ocli datasets download <resource_id> <file>
If the creation of a dataset is interrupted (e.g. a job fails or is canceled as
it is writing records), then it will be left in a dirty state. The following
command will finalize a dataset, which sets dirty
to false and provides
an accurate count of records contained in the dataset.
ocli datasets finalize <resource_id>
Files¶
The Orion CLI provides several ways to interact with Files.
To retrieve information about an Orion File
ocli files info <resource_id>
To delete an Orion File
ocli files delete <resource_id>
To list Orion Files. Possible to filter using query parameters.
For example tags=foo
will filter Orion Files that have the tag foo
.
ocli files list [--project=<integer>] [--name=<string>] [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
Uploading a file from the local file system to Orion
ocli files upload <file> [--project=<identifier>]
Downloading an Orion File to the local file system
ocli files download <resource_id> <file>
Shard Collections¶
Commands for managing collections
To list the collections that you have access to
ocli collections list [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
To get information on a specific collection
ocli collections info <resource_id>
To list shards in a collection
ocli collections list-shards <resource_id> [--limit=<integer>] [--offset=<integer>]
To get information on a specific shard in a collection
ocli collections info-shard <resource_id> <shard_id>
To upload a list of files to a new collection
ocli collections upload <name> <file> [<file> ...]
To upload a list of files to an existing collection
ocli collections upload <resource_id> <file> [<file> ...]
To open an existing, closed collection in order to add to it
ocli collections open <resource_id>
To close an existing, open collection in order to prevent adding to it
ocli collections close <resource_id>
To download all shards in an existing collection to a directory
ocli collections download <resource_id> <destination>
To download a list of shards in an existing collection to a directory
ocli collections download-shards <resource_id> [<shard_id> ...] <destination>
To delete an existing collection
ocli collections delete <resource_id>
To delete individual shards in an existing collection
ocli collections delete-shards <resource_id> <shard_id> ...
Secrets¶
Secrets are a way of storing tokens in Orion. All values are encrypted upon upload and are decrypted when request through the API
To get information on a specific secret
ocli secrets info <resource_id>
To delete an existing secret
ocli secrets delete <resource_id>
To list the secrets that you have access to
ocli secrets list [--name=<string>] [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
To create a new secret.
If --value
is not provided, a prompt will provide the ability to set
the value using a password input to avoid storing the value in the terminal
history.
ocli secrets create <secret_name> [--value=<secret_value>] [--description=<string>]
Services¶
Orion Services is a registry of internal or external services integrated with the larger Orion system
To get information on a specific service
ocli services info <resource_id>
To delete an existing service
ocli services delete <resource_id>
To list the services that you have access to
ocli services list [--name=<string>] [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
To create a new service
ocli services create <service_name> [--description=<string>]
Projects¶
Commands for managing projects
To get information on a specific project
ocli projects info <resource_id>
To delete an existing project
ocli projects delete <resource_id>
To list the projects that you have access to
ocli projects list [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
To create a new project
ocli projects create <project_name>
Floe Commands¶
The following commands are a set of resources in Orion that relate to Floe which includes Packages, WorkFloes, and Jobs.
Packages¶
Commands related to Floe Packages
Retrieving the information about a Floe Package
ocli packages info <resource_id>
Retrieving the Environment build log for a Floe Package
ocli packages environment <resource_id>
Retrieving the Inspection information for a Floe Package
ocli packages inspection <resource_id>
Deleting a Floe Package
ocli packages delete <resource_id>
Listing Floe Packages
ocli packages list [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
Upload a Floe Package
ocli packages upload <file>
WorkFloes¶
Commands for accessing Workfloes in Orion. Workfloes are a collection of cubes that defines the flow of data.
Retrieving the information about a WorkFloe
ocli workfloes info <resource_id>
Deleting a Workfloe
ocli workfloes delete <resource_id>
Listing Workfloes
ocli workfloes list [--package=<integer>] [--name=<string>] [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
Jobs¶
Commands for interacting with Jobs in Orion. Jobs are an instantiation of a Workfloe that performs the computation defined by the Workfloe.
Retrieving the information about a Job
ocli jobs info <resource_id>
Retrieve the logs of a Job
ocli jobs logs <resource_id>
Canceling a running Job
ocli jobs cancel <resource_id>
Deleting a Job
ocli jobs delete <resource_id>
Listing existing Jobs
ocli jobs list [--limit=<integer>] [--offset=<integer>] [<key>=<value>,...]
Starting a Job
ocli jobs start <workfloe_id> <job_name> --wait [FLOE_PARAMETERS]
Watching a Job
ocli jobs watch <workfloe_id> <job_name> [CUBES] [OPTIONS]
Collect debug information
ocli jobs debug-export <job_id>