Dataset CLI

User can interact with Amorphic dataset via command line. However one need following details on hand to query Amorphic:

  • API TOKEN

  • ROLE ID

  • ENVIRONMENT

  • AMORPHIC URL

Implementation

python cli/datasets.py

This API helps with dataset create, delete, get operations for use in production like scenarios

python cli/datasets.py [OPTIONS] COMMAND [ARGS]...

create

This method takes a comma separated string of json-files or folders containing json files to create datasets

Tip: json file(s) can be created manually but would recommend not doing so. Instead, this CLI tool has a GET command which returns response in the form of a json object, which is ideal.

python cli/datasets.py create [OPTIONS]

Options

--input-files <input_files>

Required Multiple json files or folders can be passed in as a comma separated string

--ignore-errors

When this flag is passed, errors are ignored during dataset creation, and proceeds on to processing the remaining files

--log-level <log_level>

Log level determines the amount or type of information to be shown

Options

INFO | WARN | DEBUG | ERROR

--endpoint-url <endpoint_url>

Amorphic API endpoint URL (Can be found in the Amorphic UI)

--env <env>

Amorphic environment name (Can be found in the Amorphic UI)

--role-id <role_id>

Amorphic role id required to perform the operations (Can be found in the Amorphic UI

--read-credentials-from-env

If this flag is passed, endpoint_url, env and role_id variables will be picked from the env.

Note: If these variables are explicitly passed from the CLI, they will override the values read from the environment variables

delete

Deletes dataset(s) using DatasetId or DatasetName

python cli/datasets.py delete [OPTIONS]

Options

-i, --dataset-id <dataset_id>

Multiple dataset ids can be passed in as a comma separated string

-n, --dataset-name <dataset_name>

Multiple dataset names can be passed in as a comma separated string

--ignore-errors

When this flag is passed, errors are ignored during dataset deletion, and proceeds on to deleting the remaining datasets

--log-level <log_level>

Log level determines the amount or type of information to be shown

Options

INFO | WARN | DEBUG | ERROR

--endpoint-url <endpoint_url>

Amorphic API endpoint URL (Can be found in the Amorphic UI)

--env <env>

Amorphic environment name (Can be found in the Amorphic UI)

--role-id <role_id>

Amorphic role id required to perform the operations (Can be found in the Amorphic UI

--read-credentials-from-env

If this flag is passed, endpoint_url, env and role_id variables will be picked from the env.

Note: If these variables are explicitly passed from the CLI, they will override the values read from the environment variables

get

Fetches information of a dataset using the dataset id or dataset name

python cli/datasets.py get [OPTIONS]

Options

-i, --dataset-id <dataset_id>

Multiple dataset ids can be passed in as a comma separated string

-n, --dataset-name <dataset_name>

Multiple dataset names can be passed in as a comma separated string

--ignore-errors

When this flag is passed, errors are ignored during dataset deletion, and proceeds on to deleting the remaining datasets

--log-level <log_level>

Log level determines the amount or type of information to be shown

Options

INFO | WARN | DEBUG | ERROR

--endpoint-url <endpoint_url>

Amorphic API endpoint URL (Can be found in the Amorphic UI)

--env <env>

Amorphic environment name (Can be found in the Amorphic UI)

--role-id <role_id>

Amorphic role id required to perform the operations (Can be found in the Amorphic UI

--read-credentials-from-env

If this flag is passed, endpoint_url, env and role_id variables will be picked from the env.

Note: If these variables are explicitly passed from the CLI, they will override the values read from the environment variables