diff --git a/content/en/docs/v3.5/tutorials/how-to-access-etcd.md b/content/en/docs/v3.5/tutorials/how-to-access-etcd.md deleted file mode 100644 index f1ceeb2d..00000000 --- a/content/en/docs/v3.5/tutorials/how-to-access-etcd.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: How to access etcd -description: Guide to access an etcd cluster -weight: 200 ---- - - -![02_etcdctl_access_etcd_2016051001](https://storage.googleapis.com/etcd/demo/02_etcdctl_access_etcd_2016051001.gif) - -`put` command to write: - -```shell -etcdctl --endpoints=$ENDPOINTS put foo "Hello World!" -``` - -`get` to read from etcd: - -```shell -etcdctl --endpoints=$ENDPOINTS get foo -etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo -``` diff --git a/content/en/docs/v3.5/tutorials/reading-from-etcd.md b/content/en/docs/v3.5/tutorials/reading-from-etcd.md new file mode 100644 index 00000000..f59cf485 --- /dev/null +++ b/content/en/docs/v3.5/tutorials/reading-from-etcd.md @@ -0,0 +1,36 @@ +--- +title: Reading from etcd +description: Reading a value in an etcd cluster +weight: 200 +--- + +## Prerequisites + +- Install `etcdctl` + + +## Procedure + +Use the `get` subcommand to read from etcd: + +```shell +$ etcdctl --endpoints=$ENDPOINTS get foo +foo +Hello World! +$ +``` + +where: +- `foo` is the requested key +- `Hello World!` is the retrieved value + +Or, for formatted output: + +``` +$ etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo +{"header":{"cluster_id":289318470931837780,"member_id":14947050114012957595,"revision":3,"raft_term":4, +"kvs":[{"key":"Zm9v","create_revision":2,"mod_revision":3,"version":2,"value":"SGVsbG8gV29ybGQh"}]}} +$ +``` + +where `write-out="json"` causes the value to be output in JSON format (note that the key is not returned). \ No newline at end of file diff --git a/content/en/docs/v3.5/tutorials/writing-to-etcd.md b/content/en/docs/v3.5/tutorials/writing-to-etcd.md new file mode 100644 index 00000000..917f6dee --- /dev/null +++ b/content/en/docs/v3.5/tutorials/writing-to-etcd.md @@ -0,0 +1,20 @@ +--- +title: Writing to etcd +description: Adding a KV pair to an etcd cluster +weight: 200 +--- + +## Prerequisites + +- Install `etcdctl` + +## Procedure + +Use the `put` subcommand to write a key-value pair: + +```shell +etcdctl --endpoints=$ENDPOINTS put foo "Hello World!" +``` +where: +- `foo` is the key name +- `"Hello World!"` is the quote-delimited value diff --git a/content/en/docs/v3.6/tutorials/how-to-access-etcd.md b/content/en/docs/v3.6/tutorials/how-to-access-etcd.md deleted file mode 100644 index f1ceeb2d..00000000 --- a/content/en/docs/v3.6/tutorials/how-to-access-etcd.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: How to access etcd -description: Guide to access an etcd cluster -weight: 200 ---- - - -![02_etcdctl_access_etcd_2016051001](https://storage.googleapis.com/etcd/demo/02_etcdctl_access_etcd_2016051001.gif) - -`put` command to write: - -```shell -etcdctl --endpoints=$ENDPOINTS put foo "Hello World!" -``` - -`get` to read from etcd: - -```shell -etcdctl --endpoints=$ENDPOINTS get foo -etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo -``` diff --git a/content/en/docs/v3.6/tutorials/reading-from-etcd.md b/content/en/docs/v3.6/tutorials/reading-from-etcd.md new file mode 100644 index 00000000..0c51fe37 --- /dev/null +++ b/content/en/docs/v3.6/tutorials/reading-from-etcd.md @@ -0,0 +1,36 @@ +--- +title: Reading from etcd +description: Reading a value in an etcd cluster +weight: 200 +--- + +## Prerequisites + +- Install `etcdctl` + + +## Procedure + +Use the `get` subcommand to read from etcd: + +```shell +$ etcdctl --endpoints=$ENDPOINTS get foo +foo +Hello World! +$ +``` + +where: +- `foo` is the requested key +- `Hello World!` is the retrieved value + +Or, for formatted output: + +``` +$ etcdctl --endpoints=$ENDPOINTS --write-out="json" get foo +{"header":{"cluster_id":289318470931837780,"member_id":14947050114012957595,"revision":3,"raft_term":4, +"kvs":[{"key":"Zm9v","create_revision":2,"mod_revision":3,"version":2,"value":"SGVsbG8gV29ybGQh"}]}} +$ +``` + +where `write-out="json"` causes the value to be output in JSON format (note that the key is not returned). diff --git a/content/en/docs/v3.6/tutorials/writing-to-etcd.md b/content/en/docs/v3.6/tutorials/writing-to-etcd.md new file mode 100644 index 00000000..917f6dee --- /dev/null +++ b/content/en/docs/v3.6/tutorials/writing-to-etcd.md @@ -0,0 +1,20 @@ +--- +title: Writing to etcd +description: Adding a KV pair to an etcd cluster +weight: 200 +--- + +## Prerequisites + +- Install `etcdctl` + +## Procedure + +Use the `put` subcommand to write a key-value pair: + +```shell +etcdctl --endpoints=$ENDPOINTS put foo "Hello World!" +``` +where: +- `foo` is the key name +- `"Hello World!"` is the quote-delimited value