Using the Optable DCN command line tools
The Optable CLI (Command Line Interface) is a utility designed to enable an Optable data collaboration node (DCN) administrator to interact with the DCN and perform management tasks which would otherwise be done using the web-based DCN UI.
Using the Optable CLI requires authenticating to an Optable data collaboration node (DCN). The CLI is therefore designed to be used by DCN customers.
The latest version of the Optable CLI can be downloaded from Optable's CDN:
Note that on OS X you may need to download the executable with curl instead of your browser in order to be able to execute it:
curl https://cdn.optable.co/cli/latest/optable-cli-darwin --output optable-cli
Note that on OS X or Linux you may need to
chmod +x ./optable-clibefore you can run the executable with
Warning: v9.11.0 of the Optable CLI introduces changes to the
exportcommands: before, you could invoke the
./optable-cli export create [args]and now you should add
fileto create an export to a file (using Google Cloud Storage or Amazon S3 as storage), like this:
./optable-cli export create file [args]. The export object has been changed to wrap all file-specific fields into the attribute
file. In a future release, the file-specific fields on the
exportobject will be removed in favour of those wrapped in
export.file. The fields being moved are the following:
cluster_format. Each can be found in
export.fileobject, for example
export.file.override_existing, etc. Update your CLI to v9.11.0 before November 2022 as we will be deprecating the previous export commands then.
Optable CLI commands require authentication with a DCN user or service account. You can create and manage accounts from the Admin > Accounts section in your DCN UI.
You can login with your personal DCN user account by running
optable-cli login <dcn-hostname>
dcn-hostnameshould just be the hostname of your data collaboration node, without any protocol prefix. For example, if you login to your DCN UI by browsing to
https://my-dcn.cloud.optable.co/admin, then your DCN hostname is just
Note that the CLI will automatically refresh your session but will require to manually relogin after 30 days of inactivity.
If you want to script using the CLI, it's recommended to authenticate using a service account instead of your personal user account. Logging into a service account has the advantage of not expiring and not requiring re-authentication.
You can create a service account from the Admin > Accounts section in your DCN UI. Once created, you will be able to create a service key and download a JSON file embedding a private key.
Be sure to keep service account private key files protected as they contain authentication secrets!
You can run the
optable-cli activate-service-account <path-to-key-file>command to add the service account private key file to the CLI configuration. You can then run CLI commands as the service account.
Note that the DCN only stores the public key corresponding to the service key which you have created. The private key is stored on the client side in the CLI configuration (
$HOME/.config/optableby default). The private key is used to sign each request sent to the DCN.
If you suspect that your private key has been compromised, you can revoke a service key from the DCN UI by navigating to the service account in Admin > Accounts.
You can get a list of all supported commands by running
To get help on a specific command, run
optable-cli <command> --help
You can connect to multiple DCNs using the CLI. When you login with the CLI as explained further above, the default context is used. If you would like to login to another DCN you can pass the
-c <context-name>option to
optable-cliwhen logging in.