The GeoSpock CLI

The management of the GeoSpock database is done using the GeoSpock CLI, a command line tool that enables you to:

Installing the GeoSpock CLI from pip

Make sure you have pip installed and then run the following commands:

$ python -m pip install geospock-cli

Getting started with the GeoSpock CLI

To start using the GeoSpock CLI, you need to configure some settings for your database deployment and login.

To authenticate using your Identity Provider (IdP) account, you will need to provide a username and password when executing commands. The options available are:

Using the login command

The login commmand allows you to connect to your deployment and save your username and password so that you do not need to specify them every time you invoke the GeoSpock CLI.

Your database administrator should be able to provide you with the details to specify when using the login command.

For example:

$ geospock login --user <user> --password <password> --request-address

A copy of your username and password will be saved in your computer's Keychain/Credential Manager. To delete these credentials from the configuration file, use geospock logout.

How to login for multiple deployments using profiles

If you have multiple GeoSpock database deployments, you can add the --profile <profileID> argument when using the login command to set up a configuration for a specific deployment. You can then use the profile ID with the GeoSpock CLI commands to specify which deployment you want to run those commands on. For example:

$ geospock group-list --profile development

If the --profile argument is not provided, this is equivalent to using --profile default.

Remove the credentials for a particular profile by using geospock logout --profile <profileID>

Providing login and request information with each command

Each GeoSpock CLI command can have the optional --user and --password arguments provided. The request address should also be provided if using this method of authenticating. For example:

$ geospock dataset-list --user <user> --password <password> --request-address

Use credentials in environment variables

If both the GEOSPOCK_USER and GEOSPOCK_PASSWORD environment variables are set, the GeoSpock CLI will use these (unless the --user and --password arguments are provided, as these will override the environment variables). The request address can also be added to the environment variable GEOSPOCK_REQUEST_ADDRESS, or it can also be provided as an argument. For example:

$ geospock dataset-list --request-address

Running the GeoSpock CLI

You can activate the GeoSpock CLI at the command line as follows:

$ geospock COMMAND ... [--profile <profileID>]

To show a list of commands use the following command

$ geospock help [--profile {profileID}]

To get further information on the input types of each command, use the following:

$ geospock help COMMAND [--profile <profileID>]

CLI commands

The GeoSpock CLI has the following commands:

Datasets Group and user management General
- dataset-create
- data-source-description
- group-create
- login
- dataset-list
- dataset-permission-list
- group-list
- group-permission-list
- profile-list
- dataset-status
- dataset-operations
- dataset-data-source-description
- help
- dataset-add-data
- dataset-permission-grant
- dataset-permission-revoke
- group-permission-grant
- group-permission-revoke
- group-add-user
- group-remove-user
- group-all-remove-user
- dataset-delete
- group-delete