-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow keystore add to handle multiple settings #54229
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ in the {es} keystore. | |
[source,shell] | ||
-------------------------------------------------- | ||
bin/elasticsearch-keystore | ||
([add <setting>] [-f] [--stdin] | | ||
([add <settings>] [-f] [--stdin] | | ||
[add-file <setting> <path>] | [create] [-p] | | ||
[list] | [passwd] | [remove <setting>] | [upgrade]) | ||
[-h, --help] ([-s, --silent] | [-v, --verbose]) | ||
|
@@ -40,12 +40,13 @@ keystore, see the setting reference. | |
[[elasticsearch-keystore-parameters]] | ||
=== Parameters | ||
|
||
`add <setting>`:: Adds settings to the keystore. By default, you are prompted | ||
for the value of the setting. If the keystore is password protected, you are | ||
also prompted to enter the password. If the setting already exists in the | ||
keystore, you must confirm that you want to overwrite the current value. If the | ||
keystore does not exist, you must confirm that you want to create a keystore. To | ||
avoid these two confirmation prompts, use the `-f` parameter. | ||
`add <settings>`:: Adds settings to the keystore. Multiple setting names can be | ||
specified as arguments to the `add` command. By default, you are prompted for | ||
the values of the settings. If the keystore is password protected, you are also | ||
prompted to enter the password. If a setting already exists in the keystore, you | ||
must confirm that you want to overwrite the current value. If the keystore does | ||
not exist, you must confirm that you want to create a keystore. To avoid these | ||
two confirmation prompts, use the `-f` parameter. | ||
|
||
`add-file <setting> <path>`:: Adds a file to the keystore. | ||
|
||
|
@@ -70,12 +71,14 @@ protected, you are prompted to enter the current password and the new one. You | |
can optionally use an empty string to remove the password. If the keystore is | ||
not password protected, you can use this command to set a password. | ||
|
||
`remove <setting>`:: Removes a setting from the keystore. | ||
`remove <settings>`:: Removes settings from the keystore. Multiple setting | ||
names can be specified as arguments to the `add` command. | ||
|
||
`-s, --silent`:: Shows minimal output. | ||
|
||
`--stdin`:: When used with the `add` parameter, you can pass the setting value | ||
through standard input (stdin). See <<add-string-to-keystore>>. | ||
`--stdin`:: When used with the `add` parameter, you can pass the settings values | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we document There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I notice we only have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for noticing these. Since these are orthogonal to this change, I will handle them in a follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened #54242. |
||
through standard input (stdin). Separate multiple values with carriage returns | ||
or newlines. See <<add-string-to-keystore>>. | ||
|
||
`upgrade`:: Upgrades the internal format of the keystore. | ||
|
||
|
@@ -143,13 +146,28 @@ bin/elasticsearch-keystore add the.setting.name.to.set | |
You are prompted to enter the value of the setting. If the {es} keystore is | ||
password protected, you are also prompted to enter the password. | ||
|
||
To pass the setting value through standard input (stdin), use the `--stdin` flag: | ||
You can also add multiple settings with the `add` command: | ||
|
||
[source,sh] | ||
---------------------------------------------------------------- | ||
bin/elasticsearch-keystore add \ | ||
the.setting.name.to.set \ | ||
the.other.setting.name.to.set | ||
---------------------------------------------------------------- | ||
|
||
You are prompted to enter the values of the settings. If the {es} keystore is | ||
password protected, you are also prompted to enter the password. | ||
|
||
To pass the settings values through standard input (stdin), use the `--stdin` | ||
flag: | ||
|
||
[source,sh] | ||
---------------------------------------------------------------- | ||
cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set | ||
---------------------------------------------------------------- | ||
|
||
Values for multiple settings must be separated by carriage returns or newlines. | ||
|
||
[discrete] | ||
[[add-file-to-keystore]] | ||
==== Add files to the keystore | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth updating the equivalent text in
RemoveSettingKeyStoreCommand
? It still talks about removing "a setting" from the keystore, but it already supports multiple settings.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will handle this in a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened #54244.