mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl
Commands
PUT [options] <key> <value>
PUT assigns the specified value with the specified key. If key already holds a value, it is overwritten.
Options
- lease -- lease ID (in hexadecimal) to attach to the key.
Return value
Simple reply
-
OK if PUT executed correctly. Exit code is zero.
-
Error string if PUT failed. Exit code is non-zero.
TODO: probably json and binary encoded proto
Examples
./etcdctl PUT foo bar --lease=0x1234abcd
OK
./etcdctl range foo
bar
Notes
If <value> isn't given as command line argument, this command tries to read the value from standard input.
When <value> begins with '-', <value> is interpreted as a flag. Insert '--' for workaround:
./etcdctl put <key> -- <value>
./etcdctl put -- <key> <value>