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 access etcd" page: add prereq, add h2 header, issue 790 #809

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
10 changes: 5 additions & 5 deletions content/en/docs/v3.4/op-guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ The list of flags provided below may not be up-to-date due to ongoing developmen
+ default: 0
+ env variable: ETCD_BACKEND_BATCH_LIMIT

### --backend-bbolt-freelist-type
+ The freelist type that etcd backend(bboltdb) uses (array and map are supported types).
+ default: map
+ env variable: ETCD_BACKEND_BBOLT_FREELIST_TYPE

### --backend-batch-interval
+ BackendBatchInterval is the maximum time before commit the backend transaction.
+ default: 0
Expand Down Expand Up @@ -458,6 +453,11 @@ Follow the instructions when using these flags.

## Experimental flags

### --experimental-backend-bbolt-freelist-type
+ The freelist type that etcd backend(bboltdb) uses (array and map are supported types).
+ default: array
+ env variable: ETCD_EXPERIMENTAL_BACKEND_BBOLT_FREELIST_TYPE

### --experimental-corrupt-check-time
+ Duration of time between cluster corruption check passes
+ default: 0s
Expand Down
31 changes: 29 additions & 2 deletions content/en/docs/v3.5/tutorials/how-to-access-etcd.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,42 @@ weight: 200

![02_etcdctl_access_etcd_2016051001](https://storage.googleapis.com/etcd/demo/02_etcdctl_access_etcd_2016051001.gif)

`put` command to write:
## Prerequisites

- [etcdctl](/docs/v3.5/dev-guide/interacting_v3/) is required

Choose a reason for hiding this comment

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

I think we should keep this unified with other pages of this docs like this
https://github.com/etcd-io/website/blob/main/content/en/docs/v3.5/tutorials/how-to-watch-keys.md#prerequisites


## Write to an etcd cluster

The `put` command is used to write to etcd in the format `etcdctl --endpoints=<endpoints> put <key> <value> [OPTIONS]`.

```shell
etcdctl --endpoints=$ENDPOINTS put foo "Hello World!"
```
The variables in the above example are:
- $ENDPOINTS = <endpoints>
- foo = <key>
- "Hello World" = <value>

`get` to read from etcd:
## Read from an etcd cluster

The `get` command is used to read from etcd in the format `etcdctl --endpoints=<endpoints> get <key>`.

```shell
etcdctl --endpoints=$ENDPOINTS get foo
```

The variables in the above example are:
- $ENDPOINTS = <endpoints>
- foo = <key>

All commands can accept an output format by setting `-w` or `--write-out` with an output format: `simple`, `json`, `protobuf`, or `fields`.
The output format is used in the following format `etcdctl --endpoints=<endpoints> --write-out=<format>`.

```shell
etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo
```

The variables in the above example are:
- $ENDPOINTS = <endpoints>
- "json" = <format>
- foo = <value>
31 changes: 29 additions & 2 deletions content/en/docs/v3.6/tutorials/how-to-access-etcd.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,42 @@ weight: 200

![02_etcdctl_access_etcd_2016051001](https://storage.googleapis.com/etcd/demo/02_etcdctl_access_etcd_2016051001.gif)

`put` command to write:
## Prerequisites

- [etcdctl](/docs/v3.6/dev-guide/interacting_v3/) is required

## Write to an etcd cluster

The `put` command is used to write to etcd in the format `etcdctl --endpoints=<endpoints> put <key> <value> [OPTIONS]`.

```shell
etcdctl --endpoints=$ENDPOINTS put foo "Hello World!"
```
The variables in the above example are:
- $ENDPOINTS = <endpoints>
- foo = <key>
- "Hello World" = <value>

`get` to read from etcd:
## Read from an etcd cluster

The `get` command is used to read from etcd in the format `etcdctl --endpoints=<endpoints> get <key>`.

```shell
etcdctl --endpoints=$ENDPOINTS get foo
```

The variables in the above example are:
- $ENDPOINTS = <endpoints>
- foo = <key>

All commands can accept an output format by setting `-w` or `--write-out` with an output format: `simple`, `json`, `protobuf`, or `fields`.
The output format is used in the following format `etcdctl --endpoints=<endpoints> --write-out=<format>`.

```shell
etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo
```

The variables in the above example are:
- $ENDPOINTS = <endpoints>
- "json" = <format>
- foo = <value>