mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix(README): fixup leader docs
The leader module uses PUT to set a leader value and DELETE to delete one. Fix the documents to reflect that.
This commit is contained in:
parent
e96234382a
commit
d447ba52ad
@ -1037,7 +1037,7 @@ Here's the API:
|
|||||||
**Attempt to set a value for the "order_processing" leader key:**
|
**Attempt to set a value for the "order_processing" leader key:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -X POST http://127.0.0.1:4001/mod/v2/leader/order_processing?ttl=60 -d name=myserver1.foo.com
|
curl -X PUT http://127.0.0.1:4001/mod/v2/leader/order_processing?ttl=60 -d name=myserver1.foo.com
|
||||||
```
|
```
|
||||||
|
|
||||||
**Retrieve the current value for the "order_processing" leader key:**
|
**Retrieve the current value for the "order_processing" leader key:**
|
||||||
@ -1050,14 +1050,14 @@ myserver1.foo.com
|
|||||||
**Remove a value from the "order_processing" leader key:**
|
**Remove a value from the "order_processing" leader key:**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -X POST http://127.0.0.1:4001/mod/v2/leader/order_processing?name=myserver1.foo.com
|
curl -X DELETE http://127.0.0.1:4001/mod/v2/leader/order_processing?name=myserver1.foo.com
|
||||||
```
|
```
|
||||||
|
|
||||||
If multiple clients attempt to set the value for a key then only one will succeed.
|
If multiple clients attempt to set the value for a key then only one will succeed.
|
||||||
The other clients will hang until the current value is removed because of TTL or because of a `DELETE` operation.
|
The other clients will hang until the current value is removed because of TTL or because of a `DELETE` operation.
|
||||||
Multiple clients can submit the same value and will all be notified when that value succeeds.
|
Multiple clients can submit the same value and will all be notified when that value succeeds.
|
||||||
|
|
||||||
To update the TTL of a value simply reissue the same `POST` command that you used to set the value.
|
To update the TTL of a value simply reissue the same `PUT` command that you used to set the value.
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user