The GeoSpock CLI
The management of the GeoSpock database is done using the GeoSpock CLI, a command line tool that enables you to:
- create and manage GeoSpock database user accounts; see Managing users
- add data to the GeoSpock database as a dataset; see The onboarding process
- manage the dataset in your GeoSpock database; see Dataset administration
- manage access to your datasets; see Managing dataset access
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
geospock login
command; refer to Using thelogin
command - Providing login and request information with each GeoSpock CLI command; refer to Providing login and request details with each command
- Setting environment variables with account information; refer to Use credentials in environment variables
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 https://testrequest.geospock.com/graphql
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 https://testrequest.geospock.com/graphql
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 https://testrequest.geospock.com/graphql
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 |
---|---|---|
Create: - dataset-create - data-source-description |
Create: - group-create |
Create: - login |
List: - dataset-list - dataset-permission-list |
List: - group-list - group-permission-list |
List: - profile-list |
Information: - dataset-status - dataset-operations - dataset-data-source-description |
Information: - help |
|
Update: - dataset-add-data - dataset-permission-grant - dataset-permission-revoke |
Update: - group-permission-grant - group-permission-revoke - group-add-user - group-remove-user - group-all-remove-user |
|
Delete: - dataset-delete |
Delete: - group-delete |