Skip to content

Commit

Permalink
Added 'How to create a lease' page under tutorials section and update…
Browse files Browse the repository at this point in the history
…d the demo page (etcd-io#520)
  • Loading branch information
Somoshree authored Oct 19, 2021
1 parent 2c69528 commit 91726d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
20 changes: 0 additions & 20 deletions content/en/docs/v3.5/demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,6 @@ etcdctl --endpoints=$ENDPOINTS put web3 value3
etcdctl --endpoints=$ENDPOINTS get web --prefix
```

## Lease

`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
```


## Auth

Expand Down
22 changes: 22 additions & 0 deletions content/en/docs/v3.5/tutorials/how-to-create-lease.md
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
```

0 comments on commit 91726d0

Please sign in to comment.