Skip to content

Commit efd9082

Browse files
authored
cmd: Rename apikey to api-key and EC_API_KEY (#363)
In order to align the environment variables to match the existing cloud documentation, this patch renames the `--apikey` flag to `--api-key`, which also makes the `EC_APIKEY` be changed to the desired `EC_API_KEY` environment variable. Signed-off-by: Marc Lopez <marc5.12@outlook.com>
1 parent 73b6452 commit efd9082

241 files changed

Lines changed: 252 additions & 252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎cmd/root.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func init() {
108108
RootCmd.PersistentFlags().String("host", "", "Base URL to use")
109109
RootCmd.PersistentFlags().String("user", "", "Username to use to authenticate (If empty will look for EC_USER environment variable)")
110110
RootCmd.PersistentFlags().String("pass", "", "Password to use to authenticate (If empty will look for EC_PASS environment variable)")
111-
RootCmd.PersistentFlags().String("apikey", "", "API key to use to authenticate (If empty will look for EC_APIKEY environment variable)")
111+
RootCmd.PersistentFlags().String("api-key", "", "API key to use to authenticate (If empty will look for EC_API_KEY environment variable)")
112112
RootCmd.PersistentFlags().Bool("verbose", false, "Enable verbose mode")
113113
RootCmd.PersistentFlags().String("output", "text", "Output format [text|json]")
114114
RootCmd.PersistentFlags().Bool("force", false, "Do not ask for confirmation")

‎cmd/root_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func TestInitApp(t *testing.T) {
200200
multierror.NewPrefixed(
201201
"invalid configuration options specified",
202202
errors.New("output must be one either json or text"),
203-
errors.New("apikey or user and pass must be specified"),
203+
errors.New("api_key or user and pass must be specified"),
204204
),
205205
),
206206
},

‎docs/ecctl-getting-started.asciidoc‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ authenticated clients. The preferred authentication method is API keys.
154154
There are two ways to authenticate against the Elasticsearch Service or the Elastic Cloud Enterprise APIs
155155
{p}:
156156

157-
* By specifying an API key using the `--apikey` flag
157+
* By specifying an API key using the `--api-key` flag
158158
* By specifying the `--user` and `--pass` flags
159159

160160
The first method requires the user to already have an API key, if this
@@ -179,8 +179,8 @@ the binary for Elastic Cloud:
179179
host: https://api.elastic-cloud.com # URL of your Elasticsearch Service or Elastic Cloud Enterprise API endpoint
180180
181181
# Credentials
182-
## apikey is the preferred authentication mechanism.
183-
apikey: bWFyYzo4ZTJmNmZkNjY5ZmQ0MDBkOTQ3ZjI3MTg3ZWI5MWZhYjpOQktHY05jclE0cTBzcUlnTXg3QTd3
182+
## api_key is the preferred authentication mechanism.
183+
api_key: bWFyYzo4ZTJmNmZkNjY5ZmQ0MDBkOTQ3ZjI3MTg3ZWI5MWZhYjpOQktHY05jclE0cTBzcUlnTXg3QTd3
184184
185185
## username and password can be used when no API key is available.
186186
user: username
@@ -198,7 +198,7 @@ i.e. `EC_HOST` or `EC_USER`.
198198

199199
[source,sh]
200200
----
201-
export EC_APIKEY=bWFyYzo4ZTJmNmZkNjY5ZmQ0MDBkOTQ3ZjI3MTg3ZWI5MWZhYjpOQktHY05jclE0cTBzcUlnTXg3QTd3
201+
export EC_API_KEY=bWFyYzo4ZTJmNmZkNjY5ZmQ0MDBkOTQ3ZjI3MTg3ZWI5MWZhYjpOQktHY05jclE0cTBzcUlnTXg3QTd3
202202
----
203203

204204
[float]

‎docs/ecctl.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Elastic Cloud Control
1212
=== Options
1313

1414
----
15-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
15+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
1616
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
1717
--force Do not ask for confirmation
1818
--format string Formats the output using a Go template

‎docs/ecctl.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Elastic Cloud Control
99
### Options
1010

1111
```
12-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
12+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
1313
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
1414
--force Do not ask for confirmation
1515
--format string Formats the output using a Go template

‎docs/ecctl_auth.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ecctl auth [flags]
2323
=== Options inherited from parent commands
2424

2525
----
26-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
26+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
2727
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
2828
--force Do not ask for confirmation
2929
--format string Formats the output using a Go template

‎docs/ecctl_auth.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ecctl auth [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
22+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
2323
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
2424
--force Do not ask for confirmation
2525
--format string Formats the output using a Go template

‎docs/ecctl_auth_key.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ecctl auth key [flags]
2323
=== Options inherited from parent commands
2424

2525
----
26-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
26+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
2727
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
2828
--force Do not ask for confirmation
2929
--format string Formats the output using a Go template

‎docs/ecctl_auth_key.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ecctl auth key [flags]
1919
### Options inherited from parent commands
2020

2121
```
22-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
22+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
2323
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
2424
--force Do not ask for confirmation
2525
--format string Formats the output using a Go template

‎docs/ecctl_auth_key_create.adoc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ecctl auth key create [flags]
2525
=== Options inherited from parent commands
2626

2727
----
28-
--apikey string API key to use to authenticate (If empty will look for EC_APIKEY environment variable)
28+
--api-key string API key to use to authenticate (If empty will look for EC_API_KEY environment variable)
2929
--config string Config name, used to have multiple configs in $HOME/.ecctl/<env> (default "config")
3030
--force Do not ask for confirmation
3131
--format string Formats the output using a Go template

0 commit comments

Comments
 (0)