forked from etcd-io/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'How to create a lease' page under tutorials section and update…
…d the demo page (etcd-io#520)
- Loading branch information
Showing
2 changed files
with
22 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: How to create lease | ||
description: Guide to creating a lease in etcd | ||
---- | ||
|
||
`lease` to write with TTL: | ||
|
||
|
||
![07_etcdctl_lease_2016050501](https://storage.googleapis.com/etcd/demo/07_etcdctl_lease_2016050501.gif) | ||
|
||
```shell | ||
etcdctl --endpoints=$ENDPOINTS lease grant 300 | ||
# lease 2be7547fbc6a5afa granted with TTL(300s) | ||
etcdctl --endpoints=$ENDPOINTS put sample value --lease=2be7547fbc6a5afa | ||
etcdctl --endpoints=$ENDPOINTS get sample | ||
etcdctl --endpoints=$ENDPOINTS lease keep-alive 2be7547fbc6a5afa | ||
etcdctl --endpoints=$ENDPOINTS lease revoke 2be7547fbc6a5afa | ||
# or after 300 seconds | ||
etcdctl --endpoints=$ENDPOINTS get sample | ||
``` |