Configuringedit

In order for ecctl to be able to communicate with the RESTful API, it needs to have a set of configuration parameters defined. These parameters can be set in a configuration file, through environment variables, or at runtime using the CLI’s global flags.

Before you beginedit

The hierarchy for configuration parameters is as follows, from higher precedence to lower:

  1. Command line flags --host, --user, --pass
  2. Environment variables
  3. Shared configuration file $HOME/.ecctl/config.<json|toml|yaml|hcl>

Generate a configuration fileedit

If it’s your first time using ecctl, use the init command to assist you in generating a configuration file. The resulting configuration file will be saved under ~/.ecctl/config.json:

$ ecctl init
Welcome to the Elastic Cloud CLI! This command will guide you through authenticating and setting some default values.

Missing configuration file, would you like to initialise it? [y/n]: y
Enter the URL of your ECE installation: http://192.168.44.10:12300

What default output format would you like?
  [1] text - Human-readable output format, commands with no output templates defined will fall back to JSON.
  [2] json - JSON formatted output API responses.

Please enter a choice: 1


Which authentication mechanism would you like to use?
  [1] API Keys (Recommended).
  [2] Username and Password login.

Please enter your choice: 1

Paste your API Key and press enter: xxxxx

Your credentials seem to be valid, and show you're authenticated as "user".

You're all set! Here are some commands to try:
  $ ecctl auth user key list
  $ ecctl deployment elasticsearch list