Skip to content
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

Update how-to-get-key-by-prefix doc. #805

Merged
merged 1 commit into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 26 additions & 1 deletion content/en/docs/v3.5/tutorials/how-to-get-key-by-prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ description: Guide to extracting etcd keys by their prefix
weight: 300
---

## Pre-requisites

* [Install etcdctl](https://etcd.io/docs/v3.5/install/)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [Install etcdctl](https://etcd.io/docs/v3.5/install/)
* Install [etcdctl](https://etcd.io/docs/v3.5/install/)

nits, I think it's better to make the header of the session unified with other cross pages in this docs
https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/tutorials/how-to-watch-keys.md#prerequisites

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think etcdctl is about what is etcdctl. [install etcdctl] is about how to get it.
I don't think we should just highlight the etcdctl.

* [Setup a local cluster](https://etcd.io/docs/v3.5/dev-guide/local_cluster/)

## Get keys by prefix

```bash
$ etcdctl --endpoints=$ENDPOINTS get PREFIX --prefix
```

### Global Options

```bash
--endpoints=[127.0.0.1:2379], gRPC endpoints
```

### Options

```bash
--prefix, get a range of keys with matching prefix
```

### Example

![03_etcdctl_get_by_prefix_2016050501](https://storage.googleapis.com/etcd/demo/03_etcdctl_get_by_prefix_2016050501.gif)

```shell
Expand All @@ -12,4 +37,4 @@ etcdctl --endpoints=$ENDPOINTS put web2 value2
etcdctl --endpoints=$ENDPOINTS put web3 value3

etcdctl --endpoints=$ENDPOINTS get web --prefix
```
```
27 changes: 26 additions & 1 deletion content/en/docs/v3.6/tutorials/how-to-get-key-by-prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ description: Guide to extracting etcd keys by their prefix
weight: 300
---

## Pre-requisites

* [Install etcdctl](https://etcd.io/docs/v3.6/install/)
* [Setup a local cluster](https://etcd.io/docs/v3.6/dev-guide/local_cluster/)

## Get keys by prefix

```bash
$ etcdctl --endpoints=$ENDPOINTS get PREFIX --prefix
```

### Global Options

```bash
--endpoints=[127.0.0.1:2379], gRPC endpoints
```

### Options

```bash
--prefix, get a range of keys with matching prefix
```

### Example

![03_etcdctl_get_by_prefix_2016050501](https://storage.googleapis.com/etcd/demo/03_etcdctl_get_by_prefix_2016050501.gif)

```shell
Expand All @@ -12,4 +37,4 @@ etcdctl --endpoints=$ENDPOINTS put web2 value2
etcdctl --endpoints=$ENDPOINTS put web3 value3

etcdctl --endpoints=$ENDPOINTS get web --prefix
```
```