mirror of https://github.com/status-im/consul.git
Incorporate feedback from @jkirschner-hashicorp and @karl-cardenas-coding
This commit is contained in:
parent
8529a23e59
commit
0e5c1c349c
|
@ -26,7 +26,7 @@ please consider using [transactions](/api/txn) instead.
|
||||||
This endpoint returns the specified key. If no key exists at the given path, a
|
This endpoint returns the specified key. If no key exists at the given path, a
|
||||||
404 is returned instead of a 200 response.
|
404 is returned instead of a 200 response.
|
||||||
|
|
||||||
For multi-key reads (up to a limit of 64) please consider using
|
For multi-key reads (up to a limit of 64 KV operations) please consider using
|
||||||
[transactions](/api/txn) instead.
|
[transactions](/api/txn) instead.
|
||||||
|
|
||||||
| Method | Path | Produces |
|
| Method | Path | Produces |
|
||||||
|
|
|
@ -12,10 +12,10 @@ store at the given key name. If no key exists with that name, an error is
|
||||||
returned. If a key exists with that name but has no data, nothing is returned.
|
returned. If a key exists with that name but has no data, nothing is returned.
|
||||||
A key name or prefix is required.
|
A key name or prefix is required.
|
||||||
|
|
||||||
-> When reading many entries under a given prefix, it may be worth considering
|
-> **Note**: When reading many entries under a given prefix, it may be worth
|
||||||
[`kv export`](/commands/kv/export) instead, the output of which can be used
|
considering [`kv export`](/commands/kv/export) instead. The kv export output
|
||||||
with [`kv import`](/commands/kv/import) to move entire trees between Consul
|
can be used with [`kv import`](/commands/kv/import) to move entire trees between
|
||||||
clusters. Alternatively, the [transaction API](/api-docs/txn) provides
|
Consul clusters. Alternatively, the [transaction API](/api-docs/txn) provides
|
||||||
support for performing up to 64 KV operations atomically.
|
support for performing up to 64 KV operations atomically.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -64,9 +64,9 @@ $ consul kv get redis/config/connections
|
||||||
5
|
5
|
||||||
```
|
```
|
||||||
|
|
||||||
This will return the original, raw value stored in Consul.
|
This will return the original raw value stored in Consul.
|
||||||
|
|
||||||
If the key with the given name does not exist, an error is returned:
|
If the key with the given name does not exist, an error is returned.
|
||||||
|
|
||||||
```shell-session hideClipboard
|
```shell-session hideClipboard
|
||||||
$ consul kv get not-a-real-key
|
$ consul kv get not-a-real-key
|
||||||
|
@ -76,7 +76,7 @@ Error! No key exists at: not-a-real-key
|
||||||
### Detailed Output
|
### Detailed Output
|
||||||
|
|
||||||
To view detailed information about the key, specify the `-detailed` flag.
|
To view detailed information about the key, specify the `-detailed` flag.
|
||||||
This will output all known metadata about the key including ModifyIndex
|
This will output all known metadata about the key including `ModifyIndex`
|
||||||
and any user-supplied flags:
|
and any user-supplied flags:
|
||||||
|
|
||||||
```shell-session hideClipboard
|
```shell-session hideClipboard
|
||||||
|
@ -102,8 +102,8 @@ redis/config/cpu:128
|
||||||
redis/config/memory:512
|
redis/config/memory:512
|
||||||
```
|
```
|
||||||
|
|
||||||
Or combine with the `-detailed` flag to list detailed information about all
|
Alternatively, combine with the `-detailed` flag to list detailed information
|
||||||
entries under a prefix:
|
about all entries under a prefix:
|
||||||
|
|
||||||
```shell-session hideClipboard
|
```shell-session hideClipboard
|
||||||
$ consul kv get -recurse -detailed redis
|
$ consul kv get -recurse -detailed redis
|
||||||
|
|
|
@ -9,7 +9,7 @@ Command: `consul kv put`
|
||||||
|
|
||||||
The `kv put` command writes the data to the given path in the KV store.
|
The `kv put` command writes the data to the given path in the KV store.
|
||||||
|
|
||||||
-> When writing multiple entries at once, consider using
|
-> **Note**: When writing multiple entries at once, consider using
|
||||||
[`kv import`](/commands/kv/import) instead. Alternatively, the
|
[`kv import`](/commands/kv/import) instead. Alternatively, the
|
||||||
[transaction API](/api-docs/txn) provides support for performing up to
|
[transaction API](/api-docs/txn) provides support for performing up to
|
||||||
64 KV operations atomically.
|
64 KV operations atomically.
|
||||||
|
@ -121,8 +121,8 @@ EOF
|
||||||
Success! Data written to: leaderboard/scores
|
Success! Data written to: leaderboard/scores
|
||||||
```
|
```
|
||||||
|
|
||||||
~> For secret and sensitive values, you should consider using a secret
|
~> **Warning**: For secret and sensitive values, you should consider using a
|
||||||
management solution like **[HashiCorp's Vault](https://www.vaultproject.io/)**.
|
secret management solution like **[HashiCorp's Vault](https://learn.hashicorp.com/tutorials/vault/static-secrets?in=vault/secrets-management)**.
|
||||||
While it is possible to encrpyt data before writing it to Consul's KV store,
|
While it is possible to encrpyt data before writing it to Consul's KV store,
|
||||||
Consul provides no built-in support for encryption at-rest.
|
Consul provides no built-in support for encryption at-rest.
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ $ consul kv put -cas -modify-index=456 redis/config/connections 10
|
||||||
Success! Data written to: redis/config/connections
|
Success! Data written to: redis/config/connections
|
||||||
```
|
```
|
||||||
|
|
||||||
### Locking Primatives
|
### Locking Primitives
|
||||||
|
|
||||||
To create or tune a lock, use the `-acquire` and `-session` flags. The session must already exist (this command will not create it or manage it):
|
To create or tune a lock, use the `-acquire` and `-session` flags. The session must already exist (this command will not create it or manage it):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue