You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api_v3.md
+23-23Lines changed: 23 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ Method
42
42
it will autofill by fetching etcd version if this option empty.
43
43
-`ssl_verify`: boolean - whether to verify the etcd certificate when originating TLS connection with etcd (if you want to communicate to etcd with TLS connection, use `https` scheme in your `http_host`), default is `true.
44
44
45
-
The client methods returns either a `etcd` object or an `error string`.
45
+
The client method returns either a `etcd` object or an `error string`.
Please refer the **etcd API documentaion** at - https://github.com/coreos/etcd for more details.
51
+
Please refer to the **etcd API documentaion** at - https://github.com/coreos/etcd for more details.
52
52
53
53
[Back to TOP](#api-v3)
54
54
@@ -59,9 +59,9 @@ Please refer the **etcd API documentaion** at - https://github.com/coreos/etcd f
59
59
*`key`: string value.
60
60
*`opts`: optional options.
61
61
*`timeout`: (int) request timeout seconds. set 0 to disable timeout.
62
-
*`revision`: (int) revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response.
62
+
*`revision`: (int) revision is the point-in-time of the key-value store to use for the range. If revision is less than or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response.
63
63
64
-
Gets the value for key.
64
+
To get the value for key.
65
65
66
66
```lua
67
67
localres, err=cli:get('/path/to/key')
@@ -82,7 +82,7 @@ local res, err = cli:get('/path/to/key')
82
82
*`ignore_value`: (bool) If ignore_value is set, etcd updates the key using its current value. Returns an error if the key does not exist.
83
83
*`ignore_lease`: (bool) If ignore_lease is set, etcd updates the key using its current lease. Returns an error if the key does not exist.
*`timeout`: (int) request timeout seconds. set 0 to disable timeout.
134
134
*`prev_kv`: (bool) If prev_kv is set, etcd gets the previous key-value pairs before deleting it. The previous key-value pairs will be returned in the delete response.
135
135
136
-
Deletes a key-value pair.
136
+
To delete a key-value pair.
137
137
138
138
```lua
139
139
localres, err=cli:delete('/path/to/key')
@@ -153,11 +153,11 @@ local res, err = cli:delete('/path/to/key')
153
153
*`progress_notify`: (bool) progress_notify is set so that the etcd server will periodically send a WatchResponse with no events to the new watcher if there are no recent events.
154
154
*`filters`: (slice of (enum FilterType {NOPUT = 0;NODELETE = 1;})) filters filter the events at server side before it sends back to the watcher.
155
155
*`prev_kv`: (bool) If prev_kv is set, created watcher gets the previous KV before the event happens. If the previous KV is already compacted, nothing will be returned.
156
-
*`watch_id`: (int) If watch_id is provided and non-zero, it will be assigned to this watcher. Since creating a watcher in etcd is not a synchronous operation, this can be used ensure that ordering is correct when creating multiple watchers on the same stream. Creating a watcher with an ID already in use on the stream will cause an error to be returned.
156
+
*`watch_id`: (int) If watch_id is provided and non-zero, it will be assigned to this watcher. Since creating a watcher in etcd is not a synchronous operation, this can be used to ensure that ordering is correct when creating multiple watchers on the same stream. Creating a watcher with an ID already in use on the stream will cause an error to be returned.
157
157
*`fragment`: (bool) fragment enables splitting large revisions into multiple watch responses.
158
158
*`need_cancel`: (bool) if watch need to be cancel, watch would return http_cli for further cancelation. See [watchcancel](#watchcancel) for detail.
159
159
160
-
Watch the update of key.
160
+
To watch the update of key.
161
161
162
162
```lua
163
163
localres, err=cli:watch('/path/to/key')
@@ -171,7 +171,7 @@ local res, err = cli:watch('/path/to/key')
171
171
172
172
*`http_cli`: the http client needs to revoke.
173
173
174
-
Cancel the watch before it got expired. Need to set `need_cancel` to get the http client for cancelation.
174
+
To cancel the watch before it get expired. Need to set `need_cancel` to get the http client for cancelation.
@@ -187,14 +187,14 @@ res = cli:watchcancel(http_cli)
187
187
*`key`: string value.
188
188
*`opts`: optional options.
189
189
*`timeout`: (int) request timeout seconds. set 0 to disable timeout.
190
-
*`revision`: (int) revision is the point-in-time of the key-value store to use for the range. If revision is less or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response.
190
+
*`revision`: (int) revision is the point-in-time of the key-value store to use for the range. If revision is less than or equal to zero, the range is over the newest key-value store. If the revision has been compacted, ErrCompacted is returned as a response.
191
191
*`limit`: (int) limit is a limit on the number of keys returned for the request. When limit is set to 0, it is treated as no limit.
192
192
*`sort_order`: (int [SortNone:0, SortAscend:1, SortDescend:2]) sort_order is the order for returned sorted results.
193
193
*`sort_target`: (int [SortByKey:0, SortByVersion:1, SortByCreateRevision:2, SortByModRevision:3, SortByValue:4]) sort_target is the key-value field to use for sorting.
194
194
*`keys_only`: (bool) keys_only when set returns only the keys and not the values.
195
195
*`count_only`: (bool) count_only when set returns only the count of the keys in the range.
196
196
197
-
Read the directory.
197
+
To read the directory.
198
198
199
199
```lua
200
200
localres, err=cli:readdir('/path/to/dir')
@@ -215,10 +215,10 @@ local res, err = cli:readdir('/path/to/dir')
215
215
*`progress_notify`: (bool) progress_notify is set so that the etcd server will periodically send a WatchResponse with no events to the new watcher if there are no recent events.
216
216
*`filters`: (slice of [enum FilterType {NOPUT = 0;NODELETE = 1;}]) filters filter the events at server side before it sends back to the watcher.
217
217
*`prev_kv`: (bool) If prev_kv is set, created watcher gets the previous KV before the event happens. If the previous KV is already compacted, nothing will be returned.
218
-
*`watch_id`: (int) If watch_id is provided and non-zero, it will be assigned to this watcher. Since creating a watcher in etcd is not a synchronous operation, this can be used ensure that ordering is correct when creating multiple watchers on the same stream. Creating a watcher with an ID already in use on the stream will cause an error to be returned.
218
+
*`watch_id`: (int) If watch_id is provided and non-zero, it will be assigned to this watcher. Since creating a watcher in etcd is not a synchronous operation, this can be used to ensure that ordering is correct when creating multiple watchers on the same stream. Creating a watcher with an ID already in use on the stream will cause an error to be returned.
219
219
*`fragment`: (bool) fragment enables splitting large revisions into multiple watch responses.
220
220
221
-
Watch the update of directory.
221
+
To watch the update of directory.
222
222
223
223
224
224
```lua
@@ -237,7 +237,7 @@ local res, err = cli:watchdir('/path/to/dir')
237
237
*`timeout`: (int) request timeout seconds. set 0 to disable timeout.
238
238
*`prev_kv`: (bool) If prev_kv is set, etcd gets the previous key-value pairs before deleting it. The previous key-value pairs will be returned in the delete response.
239
239
240
-
Remove the directory
240
+
To remove the directory.
241
241
242
242
```lua
243
243
localres, err=cli:rmdir('/path/to/dir')
@@ -256,7 +256,7 @@ local res, err = cli:rmdir('/path/to/dir')
256
256
*`opts`: optional options.
257
257
*`timeout`: (int) request timeout seconds. set 0 to disable timeout.
-`ID`: the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.
293
293
294
-
Creates a lease which expires if the server does not receive a keepalive within a given time to live period. All keys attached to the lease will be expired and deleted if the lease expires. Each expired key generates a delete event in the event history.
294
+
To create a lease which expires if the server does not receive a keepalive within a given time to live period. All keys attached to the lease will get expired and be deleted if the lease expires. Each expired key generates a delete event in the event history.
-`ID`: the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.
311
311
312
-
Revokes a lease. All keys attached to the lease will expire and be deleted.
312
+
To revoke a lease. All keys attached to the lease will expire and be deleted.
313
313
314
314
```lua
315
315
localres, err=cli:grant(5)
@@ -328,7 +328,7 @@ local data, err = cli:get('/path/to/key')
328
328
329
329
-`ID`: the lease ID for the lease to keep alive.
330
330
331
-
Keeps the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client.
331
+
To keep the lease alive by streaming keep alive requests from the client to the server and streaming keep alive responses from the server to the client.
332
332
333
333
[Back to TOP](#api-v3)
334
334
@@ -339,15 +339,15 @@ Keeps the lease alive by streaming keep alive requests from the client to the se
339
339
-`ID`: the lease ID for the lease.
340
340
-`keys`: if true, query all the keys attached to this lease.
0 commit comments