Skip to content

create-admin

Estimated time to read: 1 minute

Experimental-feature notice

This page discusses experimental features. Experimental features are still in progress, and you may encounter bugs or unexpected behavior when using them.

If you experience an issue or want to know more about this feature's status, reach out to us at Era Software.

This command creates an administrative role and then generates an API key for it.

Warning

This command requires the security database permission.

usage: eractl rbac create-admin [-h] [--url URL] [--key KEY] [-o OUTPUT_FILE] [-r ROLE_NAME] [--no-key]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             EraSearch URL, set via environment with ERACTL_URL (default: http://localhost:9200)
  --key KEY             EraSearch API key, set via environment with ERACTL_API_KEY (default: None)
  -o OUTPUT_FILE, --output OUTPUT_FILE
                        File path to store key output (default: None)
  -r ROLE_NAME, --role-name ROLE_NAME
                        Name to use for role (default: admin)
  --no-key              Skip generating API key following role creation (default: False)

To run:

eractl rbac create-admin --url https://erasearch.example.com --key ******

Or to pass arguments from the environment:

export ERACTL_URL="https://erasearch.example.com"
export ERACTL_API_KEY="******"
eractl rbac create-admin

When run, this command will:

  • Create a new admin (override with -n) role with all database and index-level permissions
  • If --no-key is not specified, an API key for the previously-created role will be created
  • If -o option is specified, the newly-created key data will be persisted to the provided path. Otherwise the key data will be written to a file in the current working directory.

Examples

To create an administrative role called super-admin and write the key output to the super-admin-key.json file, use:

eractl rbac create-admin -r super-admin -o super-admin-key.json

Last update: October 6, 2022