Commit Graph

526 Commits (56bfdab2f0c6786a8af76760727b7bcf7f64ed53)

Author SHA1 Message Date
Gyu-Ho Lee 9dd75a946f clientv3, ctlv3: document range end requirement 2016-11-08 17:02:32 -08:00
Gyu-Ho Lee 31a6efbc13 etcdctl/ctlv3: clarify 'user add' argument (user:password) 2016-11-03 10:47:45 -07:00
Xiang Li b28b38fb6d Merge pull request #6793 from timothysc/no-ttl
Add a no-ttl flag to etcdctl migrate to discard keys on transform.
2016-11-03 09:00:53 -07:00
Xiang Li c5ac02164d Merge pull request #6794 from xiang90/fix_migration
ctlv3: fix migration
2016-11-03 08:43:30 -07:00
Timothy St. Clair 97e96feb1d ctlv3: Add a no-ttl flag to etcdctl migrate to discard keys on transform. 2016-11-03 10:41:54 -05:00
Xiang Li 2ba42990ec ctlv3: fix migration 2016-11-02 20:00:07 -07:00
Gyu-Ho Lee 9b470ef4c0 etcdctl/ctlv2: error handling with JSON 2016-11-01 20:59:13 -07:00
Gyu-Ho Lee b64de4707d Merge pull request #6724 from johnbazan/ctlv3_add_user_with_password_inline
etcdctl: allow to add a user within one command line
2016-10-31 14:31:09 -07:00
Jonathan Bazan 73b4a58ac0 etcdctl: allow to add a user within one command line
This makes the "user add usr:pwd" feature available for ctlv3
without asking for the password in a new prompt.
2016-10-31 18:14:19 -03:00
joshrosso e489229153 etcdctl: add ttl unit to flag description
Add the ttl unit (seconds) to --ttl description for etcdctl's mk, mkdir, set,
setdir, update, and updatedir commands.
2016-10-25 17:12:15 -07:00
Hongchao Deng b3f0eeabe4 etcdctl: fix migrate in outputing client.Node to json
Using printf will try to parse the string and replace special
characters. In migrate code, we want to just output the raw
json string of client.Node.
For example,
    Printf("%\\") => %!\(MISSING)
    Print("%\\") => %\
Thus, we should use print instead.
2016-10-20 10:03:45 -07:00
sharat 00837b0736 etcdctlv3: update txn interactive command output 2016-10-19 19:55:09 +05:30
Gyu-Ho Lee 3a6d4b7f12 e2e: test sort ASCEND when sort target is missing 2016-10-18 16:29:22 -07:00
Gyu-Ho Lee fac20b228d ctlv3: support del all keys by '--prefix' 2016-10-17 09:33:59 -07:00
Gyu-Ho Lee 66f9e81c9a etcdctl: update README on environment variables 2016-10-14 11:58:59 -07:00
Hitoshi Mitake d585b43abe etcdctl, e2e: add --check-key option to endpoint health
This commit adds a new option --check-key to endpoint health command
for health checking with a custom key. It is mainly for avoiding
permission problem.
2016-10-14 11:39:46 +09:00
Hitoshi Mitake 644ec0ddef etcdctl, e2e: parse auth related options in endpoint health command
Partially fixes https://github.com/coreos/etcd/issues/6611
2016-10-09 20:34:09 +09:00
sharat 75f812eaa3 etcdctlv2: windows compatibility issue fix for etcd v3.0.1 2016-10-07 22:15:30 +05:30
Anthony Romano f2af08f5aa etcdctl: remove superfluous session in lock command 2016-10-05 13:30:36 -07:00
sharat dcfbcb7a68 etcdctlv3: minor updates to put and make-mirror command 2016-09-28 10:20:08 +05:30
sharat af8728f328 etcdctlv3:corrected and organised etcdctl commands 2016-09-23 18:21:54 +05:30
sharat 308038e96a etcdctlv3 : added options and examples for del from-key 2016-09-22 22:54:20 +05:30
Xiang Li b1e4defc48 Merge pull request #6501 from sinsharat/feature_add_del_from-key
etcdctlv3: del command from-key feature added
2016-09-22 09:15:04 -05:00
Gyu-Ho Lee 804e215981 Merge pull request #6505 from sinsharat/compaction_options_update
etcdctlv3: updated compaction options
2016-09-22 06:52:43 -07:00
sharat 5fa233a564 etcdctlv3: updated compaction options 2016-09-22 19:06:05 +05:30
sharat 35ff70656b etcdctlv3: del command from-key feature added 2016-09-22 16:55:36 +05:30
sharat 1601ee761a etcdctlv3: updated member command options 2016-09-22 15:04:54 +05:30
Xiang Li 30b26f8f50 etcdctl: remove the use of remprefix 2016-09-22 08:43:31 +08:00
sharat bcda9af15d etcdctlv3: updated del command options 2016-09-22 00:16:53 +05:30
sharat 05175480b3 etcdctlv3: updated snapshot restore options 2016-09-21 16:17:32 +05:30
Sharat 9743ee8b83 etcdctlv3: updated readme for options and examples for get command 2016-09-21 04:51:13 +05:30
sharat 3e67702d4b etcdctlv3: updated options for TIMETOLIVE 2016-09-20 16:40:58 +05:30
sharat 6c408eb779 etcdctlv3:updated readme.md for make-mirror modify/remove prefix in dest cluster 2016-09-17 16:13:01 +05:30
Xiang Li 86aeeca644 Merge pull request #6454 from sinsharat/windows_save_snapshot_fix
ctlv3: close snapshot file before rename (Windows)
2016-09-16 18:09:59 -05:00
sharat fef6557f6c ctlv3: close snapshot file before rename (Windows) 2016-09-16 21:55:04 +05:30
sharat b571f4d627 etcdctl/ctlv3: feature added to modify/remove prefix in the destination cluster 2016-09-16 18:48:41 +05:30
sharat cd3a7fb833 etcdctl: readme.md display fix 2016-09-15 12:23:56 +05:30
Anthony Romano e77baa3dcb Merge pull request #6424 from heyitsanthony/v3api-createminmax
etcdserver: range queries with min/max create revision
2016-09-14 19:10:52 -07:00
Anthony Romano 82af0c4a7d ctlv3: remove superfluous session creation 2016-09-14 17:03:33 -07:00
Hitoshi Mitake 4211c0b7af etcdctl, clientv3: improve printing of role get for prefix permission
This commit improves printing of role get command for prefix
permission. If a range permission corresponds to a prefix permission,
it is explicitly printed for a user. Below is an example of the new
printing:

$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [/dir/, /dir0) (prefix /dir/)
        [k1, k5)
KV Write:
        [/dir/, /dir0) (prefix /dir/)
        [k1, k5)
2016-09-14 16:10:32 +09:00
Xiang Li 672472f85e Merge pull request #6414 from mitake/prefix-perm
etcdctl: an option for granting permission with key prefix
2016-09-13 23:29:40 -05:00
Hitoshi Mitake 4e2b09a7ca etcdctl: an option for granting permission with key prefix
This commit adds a new option --prefix to "role grant-permission"
command. If the option is passed, the command interprets the key as a
prefix of range permission.

Example of usage:
$ ETCDCTL_API=3 bin/etcdctl --user root:p role grant-permission --prefix r1 readwrite /dir/
Role r1 updated
$ ETCDCTL_API=3 bin/etcdctl --user root:p role get r1
Role r1
KV Read:
        [/dir/, /dir0)
        [k1, k5)
KV Write:
        [/dir/, /dir0)
        [k1, k5)
$ ETCDCTL_API=3 bin/etcdctl --user u1:p put /dir/key val
OK
2016-09-14 12:54:14 +09:00
sharat 6f4e3696d2 etcdctl\ctlv3: updated readme.md for timetolive example 2016-09-13 22:31:34 +05:30
sharat d5edb62bd0 etcdctl:readme.md doc made uniform 2016-09-10 00:32:36 +05:30
Gyu-Ho Lee 04a4cea630 etcdctl/ctlv3: add 'lease timetolive' command 2016-09-09 08:21:58 +09:00
sharat 8b764aac71 ctlv3: fix line parsing for Windows 2016-09-09 01:58:33 +05:30
Xiang Li 28d80ad709 Merge pull request #6370 from xiang90/fix_restore
etcdctl: restore should create a snapshot
2016-09-08 14:25:07 -05:00
Sharat 656167d760 etcdctl: Corrected command in Readme.md (#6376)
Corrected command in Readme.md
2016-09-07 21:09:24 +09:00
sharat 534cb0b749 etcdctlv3: Readme.md updated
1. Under PUT example the put command was mentioned in capital which will
give the below error:
Error: unknown command "PUT" for "etcdctl"
Hence corrected the same.
2. The lease id is mentioned with 0x to denote hex but since its an
example, copy pasting the command will give the below error:
Error: bad lease ID (strconv.ParseInt: parsing "0x1234abcd": invalid
syntax), expecting ID in Hex
Hence modified the same to a sample correct value so that a user new to
etcd does not get confused.
3. The command ./etcdctl range foo does not work and gives the below
error:
Error: unknown command "range" for "etcdctl"
Hence corrected the same

#6372
2016-09-07 12:35:20 +05:30
Xiang Li 7e182fa24a etcdctl: restore should create a snapshot
Restore should create a snasphot. So the new db file
can be sent to newly joined member.
2016-09-07 11:21:53 +08:00
Jason E. Aten cccbf302f2 etcdctl/ctlv3: don't crash when we should prompt for pw.
when 'etcdctl --user name get blah' is invoked to
 prompt for password, don't panic.

 addresses the segfault part of #6343
2016-09-03 10:32:16 -07:00
Anthony Romano b1740f5fe4 etcdctl: fix quoted string handling in txn and watch
Fixes #6315
2016-09-01 19:39:23 -07:00
Gyu-Ho Lee 524a5a1afb ctlv3: add 'print-value-only' flag to get command 2016-08-29 12:09:07 -07:00
Xiang Li 86dcfbf205 etcdctl: list output options 2016-08-23 11:32:00 -07:00
Xiang Li d5d2370fc8 Merge pull request #6172 from xiang90/session
session: remove session manager and add ttl
2016-08-15 15:20:19 -07:00
Xiang Li feaff17259 session: remove session manager and add ttl 2016-08-15 14:12:25 -07:00
Gyu-Ho Lee 6b671b88dc etcdctl/ctlv3: fix spell errors 2016-08-13 20:54:27 -07:00
Anthony Romano e218834b58 etcdctl: set ServerName for TLS when using --discovery-srv 2016-08-03 22:28:03 -07:00
jesse.millan 205f10aeb6 etcdctl: Add support for formating output of key related commands
All v2 key and dir related commands will now honor the global format option if
it was specified. Otherwise, the output will remain the same.
2016-07-27 14:17:19 -07:00
jesse.millan f18d5433cc etcdctl: Add support for formating output of ls command in json
The ls command will check for and honor json or extended output formats.

Fixes #5993
2016-07-20 18:05:23 -07:00
Anthony Romano 97ff1abb3e etcdctl: remove 0.4 import command 2016-07-13 15:30:37 -07:00
Anthony Romano 439b96f090 etcdctl: remove 0.4 peer syncing 2016-07-13 15:26:25 -07:00
Xiang Li 55ca788efe etcdctl: only takes 127.0.0.1:2379 as default endpoint 2016-07-11 13:28:02 -07:00
Xiang Li 7ec822107a *: add put prevkv 2016-07-05 20:45:01 -07:00
Xiang Li 12bf1a3382 *: rename preserveKVs to prevKv 2016-07-05 20:45:01 -07:00
Xiang Li c853704ac9 *: support get-old-kv in watch 2016-07-05 16:17:09 -07:00
Xiang Li c8c5f41a01 Merge pull request #5836 from xiang90/better_d_prev
*: support return prev deleted kv
2016-07-01 14:43:33 -07:00
Xiang Li 40c4a7894d *: support return prev deleted kv 2016-07-01 14:01:48 -07:00
Gyu-Ho Lee cb1a1426b1 *: remove beta from docs 2016-06-30 09:39:52 -07:00
Gyu-Ho Lee 9b47ca5972 ctlv3: make flags, commands formats consistent
1. Capitalize first letter
2. Remove period at the end

(followed the pattern in linux coreutil man page)
2016-06-29 15:52:06 -07:00
Anthony Romano 1c25aa6c48 clientv3, ctl3, clientv3/integration: add compact response to compact 2016-06-28 09:32:31 -07:00
Gyu-Ho Lee 76e2bf03b8 etcdctl: v3 compact with physical flag 2016-06-27 12:07:46 -07:00
Gyu-Ho Lee fa74a0d3bb etcdctl: change peerURLs flag to 'peer-urls' 2016-06-23 09:52:25 -07:00
Danny Sauer a998fb4af1 etcdctl: index is incremented in Watcher; remove double-increment 2016-06-23 08:54:34 -05:00
Gyu-Ho Lee 5720fe812e etcdctl: use CreateDirAll 2016-06-22 15:55:56 -07:00
Xiang Li 82991074bf Merge pull request #5733 from mitake/user-detail
etcdctl: a flag for getting detailed information of a user
2016-06-22 09:26:00 -07:00
Hitoshi Mitake 0e7690780f etcdctl: a flag for getting detailed information of a user
This commit adds a new flag --detail to etcdctl user get command. The
flag enables printing the detailed permission information of the user
like below example:

$ ETCDCTL_API=3 bin/etcdctl --user root:p user get u1
User: u1
Roles: r1 r2
$ ETCDCTL_API=3 bin/etcdctl --user root:p user get u1 --detail
User: u1

Role r1
KV Read:
        [k1, k5)
KV Write:
        [k1, k5)

Role r2
KV Read:
        a
        b
        [k8, k9)
KV Write:
        a
        b
        [k8, k9)
2016-06-22 13:29:48 +09:00
Gyu-Ho Lee 80aa5978ca etcdctl/ctlv3: minor clean ups
- Fix typo
- Improve command ordering (elect should be below lock)
- Update migrate command description
2016-06-21 13:12:01 -07:00
Gyu-Ho Lee e5d9ca5180 etcdctl/ctlv3: document auth,user,role 2016-06-21 12:46:42 -07:00
Gyu-Ho Lee bdca594495 etcdctl/ctlv2: use latest Action interface 2016-06-20 16:34:28 -07:00
Gyu-Ho Lee 0ae9d444f9 ctlv2: use urfave/cli in ctlv2 2016-06-20 15:17:03 -07:00
Hitoshi Mitake 0173564122 etcdctl: slightly enhance output of role revoke-permission 2016-06-20 16:57:50 +09:00
Ajit Yagaty ad5d55dd4c v3api: Add a flag to RangeRequest to return only the keys.
Currently the user can't list only the keys in a prefix search. In
order to support such operations the filtering will be done on the
server side to reduce the encoding and network transfer costs.
2016-06-19 14:18:39 -07:00
Hitoshi Mitake 18253e2723 *: support getting all users and roles in auth v3
This commit expands RPCs for getting user and role and support list up
all users and roles. etcdctl v3 is now support getting all users and
roles with the newly added option --all e.g. etcdctl user get --all
2016-06-17 16:22:41 +09:00
Gyu-Ho Lee 1e38ab1706 etcdctl: print API version (v2, v3 separate) 2016-06-14 15:33:39 -07:00
Hitoshi Mitake 253e313c09 *: support granting and revoking range
This commit adds a feature for granting and revoking range of keys,
not a single key.

Example:
$ ETCDCTL_API=3 bin/etcdctl role grant r1 readwrite k1 k3
Role r1 updated
$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        [a, b)
        [k1, k3)
        [k2, k4)
KV Write:
        [a, b)
        [k1, k3)
        [k2, k4)
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k4
k1
v1
$ ETCDCTL_API=3 bin/etcdctl --user u1:p get k1 k5
Error:  etcdserver: permission denied
2016-06-08 14:58:25 -07:00
Gyu-Ho Lee 624d5eb0cb etcdctl: support range_end for watch command
Fix https://github.com/coreos/etcd/issues/5575.
2016-06-07 16:52:15 -07:00
Gyu-Ho Lee 1e4d3603db clientv3,ctlv3: following changes for proto change 2016-06-07 13:32:36 -07:00
Xiang Li 83ce1051ff auth: make naming consistent 2016-06-07 10:54:50 -07:00
Katsuyuki Tateishi 8b75a33398 *: replace '-' with '--' for long options
A long option should have double dashes (cf. #4595),
so are error messages.
2016-06-06 12:25:45 +09:00
Hitoshi Mitake 94f22e8a07 *: rename RPCs and structs related to revoking
This commit renames RPCs and structs related to revoking.
1. UserRevoke -> UserRevokeRole
2. RoleRevoke -> RoleRevokePermission
2016-06-05 16:57:23 +09:00
Hitoshi Mitake c7a1423d45 *: support deleting a role in auth v3
This commit implements RoleDelete() RPC for supporting deleting a role
in auth v3. It also adds a new subcommand "role delete" to etcdctl.
2016-06-04 13:42:45 +09:00
Hitoshi Mitake 0cb1343109 *: support revoking a key from a role in auth v3
This commit implements RoleRevoke() RPC for supporting revoking a key
from a role in auth v3. It also adds a new subcommand "role revoke" to
etcdctl.
2016-06-04 13:42:45 +09:00
Hitoshi Mitake 957b07c408 *: support revoking a role from a user in auth v3
This commit implements UserRevoke() RPC for supporting revoking a role
from a user in auth v3. It also adds a new subcommand "user revoke" to
etcdctl.
2016-06-04 13:39:26 +09:00
Hitoshi Mitake 10ee69b44c *: support getting role in auth v3
This commit implements RoleGet() RPC of etcdserver and adds a new
subcommand "role get" to etcdctl v3. It will list up permissions that
are granted to a given role.

$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        b
        d
KV Write:
        a
        c
        d
2016-06-03 13:03:54 +09:00
Hitoshi Mitake 5609fdb9a8 *: support getting user in etcdctl v3
This commit adds a new subcommand "user get" to etcdctl v3. It will
list up roles that are granted to a given user.

Example:
$ ETCDCTL_API=3 bin/etcdctl user get u1
User: u1
Roles: r1 r2 r3

This commit also modifies the layout of InternalRaftRequest for
frequent update of auth related members.
2016-06-02 12:10:19 +09:00
Gyu-Ho Lee 240757729c etcdctl: make v3 as default README 2016-06-01 11:36:21 -07:00
Anthony Romano 2cd3a3bd59 etcdctl: improve error message on migration without v2 keys
Fixes #5478
2016-05-30 19:14:04 -07:00
Gyu-Ho Lee c43e59338f etcdctl/ctlv3: remove mvccpb.EXPIRE in mirror cmd 2016-05-29 15:11:29 -07:00
Gyu-Ho Lee 5cba7080bc etcdctl/ctlv3: protobuf write-out for member list
Fix https://github.com/coreos/etcd/issues/5297.
2016-05-25 22:23:57 -07:00
Gyu-Ho Lee 86591d64c5 etcdctl: doc member list, others protobuf output 2016-05-25 22:17:45 -07:00
Xiang Li 628a38d906 etcdctl: add migrate command into readme 2016-05-19 16:53:47 -07:00
Xiang Li 6f2e7875aa etcdctl: add migrate command
Migrate command accepts a datadir and an optional user-provided
transformer function that transform v2 keys to v2 keys.

Migrate command then builds a v3 backend state based on the existing
v2 keys and the output of the transformer function.
2016-05-19 12:17:15 -07:00
Hitoshi Mitake 6259318521 *: attach auth token as a gRPC credential
This commit adds a functionality of attaching an auth token to gRPC
connection as a per RPC credential.

For doing this, this commit lets clientv3.Client.Dial() create a
dedicated gRPC connection for doing authentication. With the dedicated
connection, the client calls Authenticate() RPC and obtain its
token. The token is attached to the main gRPC connection with
grpc.WithPerRPCCredentials().

This commit also adds a new option --username to etcdctl (v3). With
this option, etcdctl attaches its auth token to the main gRPC
connection (currently it is not used at all).
2016-05-17 13:26:12 +09:00
Anthony Romano 798718c49b etcdctl: verify snapshot hash on restore
Fixes #4097
2016-05-16 12:08:08 -07:00
Gyu-Ho Lee 3ec627d1a8 etcdctl/ctlv3: allow empty key
Fix https://github.com/coreos/etcd/issues/5323.
2016-05-13 11:29:58 -07:00
Anthony Romano 393725fe5f clientv3/concurrency: ctx-ize Leader(), Resign(), and Unlock() 2016-05-13 10:07:35 -07:00
Gyu-Ho Lee c538e0f9a9 etcdctl: update LICENSE header 2016-05-12 20:51:39 -07:00
Anthony Romano dcb3b7aecf *: scrub legacy ports from code and scripts 2016-05-11 13:46:30 -07:00
Anthony Romano db8f5771f1 doc: scrub legacy ports and TLS information for v3 2016-05-11 13:46:29 -07:00
Ajit Yagaty 23f9d72870 etcdctl: Add --wal-dir and --backup-wal-dir options to backup command.
If the WAL is stored in a separate directory then the backup command
would need a --wal-dir option to pick the path to the WAL directory.
The user might also want to store the backup of data and wal separately
for which --backup-wal-dir option is provided.
2016-05-10 18:38:56 -07:00
Gyu-Ho Lee 62a9209088 etcdctl/ctlv2: total-timeout for Sync
Fix https://github.com/coreos/etcd/issues/4897.
2016-05-10 14:20:05 -07:00
Gyu-Ho Lee 3e088b3b40 etcdctl/ctlv3: make 'table' printer configurable
Fix https://github.com/coreos/etcd/issues/5296.
2016-05-10 10:02:02 -07:00
Ajit Yagaty adc981c53d auth: Adding support for "auth disable" command.
Added support for the auth disable command in the server, added the
etcdctl command and a respective testcase.
2016-05-07 19:21:49 -07:00
Gyu-Ho Lee 01927cc26a *: remove v2 specific authentication doc 2016-04-27 11:30:51 -07:00
Rob Holland a00be40db2 etcdctl: Add a newline so that errors don't bleed into each other. 2016-04-27 14:25:57 +01:00
Anthony Romano b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00
Gyu-Ho Lee 3ad8e91e00 *: fix flag location, minor typo 2016-04-25 09:41:11 -07:00
Gyu-Ho Lee 53abaf86c6 etcdctl/ctlv3: close bolt.DB in snapshot status 2016-04-22 11:43:52 -07:00
Anthony Romano d2a58cbb0a etcdctl: print full json response for Get
Otherwise parsing get/txn output with json is somewhat complicated
because in some cases there's a json message and sometimes not.
Likewise, a get on an absent key has to return the current revision for
some algorithms to work.
2016-04-20 09:56:32 -07:00
Xiang Li bf9cccfc34 Merge pull request #5118 from ajityagaty/fsync_osx
fileutil: Sync on HFS/OSX needs to be handled differently.
2016-04-18 22:22:53 -07:00
Ajit Yagaty 8b6de5f85d fileutil: Sync on HFS/OSX needs to be handled differently.
A call file.Sync on OSX doesn't guarantee actual persistence on
physical drive media as the data can be cached in physical drive's
buffers. Hence calls to file.Sync need to be replaced with
fcntl(F_FULLFSYNC).
2016-04-18 21:49:04 -07:00
Gyu-Ho Lee 8a0fa5622e Merge pull request #5114 from gyuho/snapshot_test
*: add Snapshot e2e test
2016-04-18 09:27:07 -07:00
Ajit Yagaty 68dd22d93d etcdctlv3: Fix for typo in alarm command handling. 2016-04-17 19:31:39 -07:00
Gyu-Ho Lee a2afb513dd *: add snapshot e2e test 2016-04-16 13:27:10 -07:00
Amit Kumar Gupta c629a30f1f etcdctl: unset ETCDCTL_API env var properly 2016-04-15 15:43:00 -07:00
Gyu-Ho Lee a78ece4ac2 etcdctl: snapshot status error for non-existent file 2016-04-15 14:15:16 -07:00
Anthony Romano cd05ac4217 doc: document many etcdctl commands
documents defrag, compaction, lease, snapshot status, member, endpoint
2016-04-13 21:50:59 -07:00
Anthony Romano f07350735d etcdctl: respect --write-out=json for endpoint status command 2016-04-13 17:04:31 -07:00
Gyu-Ho Lee e9aa8ff235 Merge pull request #5071 from gyuho/member_api_change
*: Member api change
2016-04-13 16:45:10 -07:00
Anthony Romano 3dcfe79cc0 Merge pull request #5070 from heyitsanthony/member-doc
etcdctl: display required arguments for member commands in usage
2016-04-13 16:40:16 -07:00
Gyu-Ho Lee 2c6176b5f2 *: remove MemberLeader API in client side (fix examples) 2016-04-13 16:23:57 -07:00
Anthony Romano 90df7fd738 etcdctl: display required arguments for member commands in usage 2016-04-13 16:18:00 -07:00
Anthony Romano 22812badc2 Merge pull request #5069 from heyitsanthony/fix-snapshot-status-json
etcdctl: respect -write-out=json for snapshot status
2016-04-13 15:57:39 -07:00
Anthony Romano b90e30b28e etcdctl: respect -write-out=json for snapshot status 2016-04-13 13:37:32 -07:00
Anthony Romano a553ea8ba7 Merge pull request #5068 from heyitsanthony/lease-fixups
etcdctl: improve lease command documentation and exit codes
2016-04-13 13:20:06 -07:00
Anthony Romano 993f25f055 Merge pull request #5065 from heyitsanthony/errexit-defrag
etcdctl: return non-zero exit code if defrag fails on any endpoint
2016-04-13 13:19:43 -07:00
Anthony Romano 721ed6ba2b etcdctl: return non-zero exit code if defrag fails on any endpoint 2016-04-13 12:39:43 -07:00
Anthony Romano 855a5116a2 etcdctl: improve lease command documentation and exit codes 2016-04-13 12:38:21 -07:00
Gyu-Ho Lee 60548b85c4 *: add rev flag to get command 2016-04-13 11:32:29 -07:00
Xiang Li ae9b251d99 etcdctl: move endpoint-heath and status into endpoint command 2016-04-12 16:30:26 -07:00
Anthony Romano a12fd9cc92 etcdctl: print grant/revoke error instead of scanning roles for changes
Fixes #5045
2016-04-12 10:49:05 -07:00
mqliang ff311ba0a7 etcdctlv3: print db size and raft status in 'etcdctl status' command 2016-04-12 22:58:22 +08:00
Xiang Li b5292f6fce etcdctl: add snapshot status support 2016-04-11 22:55:47 -07:00
Anthony Romano 8c2225f251 Merge pull request #5038 from heyitsanthony/sshot-docs
doc: document etcdctl snapshot command
2016-04-11 16:21:09 -07:00
Anthony Romano e5a2bd58ec etcdctl: respect --write-out
Support got clobbered about a month ago.
2016-04-11 16:01:38 -07:00
Anthony Romano 6e8d01f956 doc: document etcdctl snapshot command 2016-04-11 15:58:20 -07:00
Anthony Romano be822b05d2 Merge pull request #5012 from heyitsanthony/snap-api
*: snapshot RPC
2016-04-11 13:00:18 -07:00
Anthony Romano e838c26f8a etcdctl: use snapshot RPC in snapshot command 2016-04-11 12:32:53 -07:00
Hitoshi Mitake 7ba2646d37 *: support granting a role to a user in v3 auth 2016-04-11 15:53:30 +09:00
Hitoshi Mitake 097cec8194 etcdctl: let some v3 auth related functions be private
They don't need to be public.
2016-04-11 13:01:19 +09:00
Hitoshi Mitake 02033b4c47 *: support granting key permission to role in v3 auth 2016-04-11 12:23:19 +09:00
Gyu-Ho Lee fb85da92e8 *: fix based on gosimple and unused 2016-04-07 23:16:37 -07:00
Anthony Romano dc17eaace7 *: rename Lease Create to Grant
Creating a lease through the client API interface union looked like
"c.Create(...)"-- the method name wasn't very descriptive.
2016-04-07 12:28:14 -07:00
Gyu-Ho Lee 6e6d64fb9b *: clean up unused vars, functions
With help from https://github.com/dominikh/go-unused.
IsNetTimeoutError seems useful, so moved to pkg/netutil.
2016-04-06 21:33:55 -07:00
Xiang Li c3bca3739f Merge pull request #4926 from mitake/auth-role-add
*: support adding role in auth v3
2016-04-04 18:44:16 -07:00
Hitoshi Mitake 2b17a3919c *: support adding role in auth v3 2016-04-05 09:28:17 +09:00
Gyu-Ho Lee 1543e7bd95 etcdctl: READMEv3 doc about prefix 2016-04-04 07:00:49 -07:00
Gyu-Ho Lee 9afae9e2c1 *: add del by prefix with e2e tests 2016-04-03 11:41:49 -07:00
Xiang Li 19136afc2b Merge pull request #4798 from mqliang/memberStatus
etcdctlv3: initial implementaton of 'etcdctl member status' command
2016-04-03 08:48:23 -07:00
mqliang d80af00785 etcdctlv3: implement the 'etcdctl status' command 2016-04-03 13:55:58 +08:00
Gyu-Ho Lee e8877ab180 etcdctl: print number of deleted keys 2016-04-02 20:54:37 -07:00
Hitoshi Mitake 73166b41e9 *: support changing password in v3 auth
This commit adds a functionality for updating password of existing
users.
2016-03-31 15:28:15 +09:00
Hitoshi Mitake 2ad9b5692f etcdctl: print messages for successful auth operations
This commit lets etcdctl v3 follow the manner of etcdctl v2.
2016-03-31 13:56:01 +09:00
Hitoshi Mitake d8888ded12 *: support deleting user in v3 auth
This commit adds a functionality of user deletion. It can be invoked
with the new user delete command.

Example usage:
$ ETCDCTL_API=3 etcdctl user delete usr1
2016-03-31 13:18:51 +09:00
Anthony Romano 2aca3252e8 etcdctl: alarm command 2016-03-30 13:33:52 -07:00
kayrus 720502b25f etcdctl: Handle ETCDCTL_USERNAME environment 2016-03-29 19:06:31 +02:00
Ajit Yagaty 2e3856740d etcdctl: Add aliases for command flags.
Add aliases to the flags that are supplied to the sub commands.
2016-03-28 20:57:34 -07:00
Xiang Li 87d9f06a45 *: combine etcdctl and etcdctlv3 2016-03-28 11:28:05 -07:00
Anthony Romano bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
Gyu-Ho Lee 67c2384bdf *: replace '-' with '--' in doc
Fix https://github.com/coreos/etcd/issues/4595.
2016-03-21 11:12:43 -07:00
mqliang d8c315ab55 etcdctl: show leader/member information when run 'etcdctl member list' command
leader/follower information is very helpful for debugging. User must get this information through http endpoint
before this patch, which is inconvenient.
2016-03-16 13:48:37 +08:00
Xiang Li bab8f43cb0 Merge pull request #4726 from ajityagaty/mk_in_order
etcdctl: Add command to create in-order keys.
2016-03-13 10:15:42 -07:00
Ajit Yagaty ef0c8e5c18 etcdctl: Add an option to mk command to create in-order keys.
Adding a new option to the mk command to create in-order keys
under a given directory, identified by <key> argument. Optionally
TTL can also be set on the newly created in-order key.
2016-03-10 20:28:28 -08:00
Anthony Romano edafbe9555 etcdctl: clarify setdir purpose in help message
Fixes #4640
2016-03-09 14:38:57 -08:00
Anthony Romano 02d9aa481b etcdctl: accept user:pass format for add user
Otherwise needed an interactive terminal to create a user.
2016-03-04 13:29:06 -08:00
Xiang Li 6053480b75 Merge pull request #4580 from AdoHe/etcdctl_use_endpoints
etcdctl: use endpoints instead of endpoint flag
2016-02-24 19:01:42 -08:00
AdoHe d8a8116f9a etcdctl: use endpoints instead of endpoint flag 2016-02-24 21:49:50 -05:00
Anthony Romano c5b51946eb *: exported godoc fixups 2016-02-21 20:36:44 -08:00
Gyu-Ho Lee 658f2e53ba etcdctl: make doc on 'no-sync' clearer
For issues like https://github.com/coreos/etcd/issues/4496.
2016-02-11 19:52:03 -08:00
Josh Wood cb7ebe81a8 Merge pull request #4359 from joshix/kayrus-deprcpeers
etcdctl: Changed default "endpoint" servers order
2016-01-30 21:20:10 -08:00
kayrus 1b7b20f4f8 etcdctl: Changed default "endpoint" servers order
And added "DEPRECATED" note to a "peers" option (relates to d685135832)

Updated to amend commit.
2016-01-30 21:07:57 -08:00
Gyu-Ho Lee c8eebd0070 etcdctl: use os.Stdout, os.Stderr directly for cmd 2016-01-27 00:54:40 -08:00
Hitoshi Mitake cae0577619 etcdctl: add an option to ls for consistent result
Like the commit 11f49a0960, this commit adds a new option "--quorum"
to etcdctl ls command. It is required for obtaining a consistent
result.
2016-01-21 14:03:10 +09:00
Joe Haddad 476178fce0 etcdctl: add docs for configuration flags and env vars 2016-01-15 19:46:29 -05:00
Gyu-Ho Lee 054db2e3cf etcdctl, etcdctlv3: add help message for non-valid value arg
Unix commands interprets argument value of first character '-'
as a flag. And this won't be fixed in our upstream CLI libraries.
This adds help message to show users workarounds.

Addressing https://github.com/coreos/etcd/issues/2020.
2016-01-13 09:25:24 -08:00
Gyu-Ho Lee dd02ec6554 etcdctl: ignore value in updatedir command
Fixes coreos#4145.
client.KeysAPI ignores value if SetOptions.Dir is true.
2016-01-06 16:37:04 -08:00
Xiang Li 34abead33e etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error 2015-12-30 11:06:42 -08:00
Anthony Romano 4477ef636e etcdctl: return exitcode 2 if can't connect to any peers 2015-12-28 23:04:34 -08:00
Xiang Li 2681137fe0 Merge pull request #4020 from xiang90/ctl_04
etcdctl: support etcd0.4
2015-12-21 12:55:03 -08:00
Xiang Li 541f2e5200 etcdctl: support basic operations with etcd 0.4.
For CoreOS users, they will get a updated version of etcdctl without updating
the etcd server version. And the users cannot really control this behavior.
We do not want to suddenly break them without enough communication.

So we still want the most basic opeartions like get, set, watch of etcdctl2 work
with etcd 0.4. This patches solve the incompability issue.
2015-12-21 11:59:13 -08:00
Anthony Romano 2974c4ec27 etcdctl: fill out ArgsUsage fields for help
USAGE in help now names positional arguments (e.g., "member remove <memberID>"
instead of "member remove [arguments...]")

Fixes #4021
2015-12-21 09:05:37 -08:00
Gyu-Ho Lee bccc602c8f etcdctl/command: fix shawdowed error variable
This fixes https://github.com/coreos/etcd/issues/3954.
2015-12-12 09:13:12 -08:00
Gyu-Ho Lee e8215cc577 etcdctl: remove duplicate exit line
`handleError` already exits with the exit code in arguments.
`os.Exit(1)` is never executed in this case.
2015-11-25 09:41:27 -08:00
Xiang Li e39206e084 etcdctl: cluster health exit with non-zero when cluster is unhealthy 2015-11-20 13:51:31 -08:00
Hitoshi Mitake 11f49a0960 etcdctl: a new option for quorum get
Current etcdctl seems to lack an option for specifying quorum flag for
GET. This commit adds the option.
2015-11-20 14:09:50 +09:00
Gyu-Ho Lee 81229dbea9 *: add missing package descriptions
This adds and updates package descriptions in etcd projects.
And also deletes some duplicate LICENSE statements.
2015-11-17 20:54:10 -08:00
mqliang b2d92dedae etcdctl:fix health check condition 2015-10-18 08:22:13 +08:00
Gyu-Ho Lee 1dab7e8084 etcdctl/command: mk command with PrevNoExist
This attempts to fix #3676. `PrevNoExist` checks if the key previously exists
and if so, it returns an error, which is how `mk` command is supposed to work.
The previous code ignores the previous key and overwrites with the later value.

/cc @yichengq
2015-10-15 09:05:17 -07:00
Yicheng Qin afd74dfeb7 Merge pull request #3611 from mitake/etcdctl-timeout
etcdctl: use a context with -total-timeout in simple commands
2015-10-14 16:13:34 -07:00
Yicheng Qin 9673eb625a pkg/transport: pass dial timeout to NewTransport
So we could set dial timeout for new transport, which makes it
customizable according to max RTT.
2015-10-11 10:09:25 -07:00
Hitoshi Mitake 33a0df3e33 etcdctl: use a context with -total-timeout in simple commands
Like the commit 8ebc933111, this commit lets simple etcdctl commands
use a context with timeout value passed via -total-timeout.

This commit doesn't change complex commands like watch,
cluster-health, and import because it is not obvious that using the
context in the commands is good or not.
2015-09-29 17:23:01 +09:00
Hitoshi Mitake 8ebc933111 etcdctl: use user specified timeout value for entire command execution
etcdctl should be capable to use a user specified timeout value for
total command execution, not only per request timeout. This commit
adds a new option --total-timeout to the command. The value passed via
this option is used as a timeout value of entire command execution.

Fixes coreos#3517
2015-09-28 10:31:46 +09:00
Jonathan Boulle 7848ac3979 *: add missing license headers 2015-09-15 14:09:01 -07:00
Dmitry Smirnov b2f4a5f587 *: fix spelling issues (codespell).
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2015-09-11 10:22:29 +10:00
Xiang Li 322aab133d etcdctl: suggest endpoint over peer 2015-09-04 13:16:33 -07:00
Xiang Li 04539c6240 etcdctl: prepare for health endpoint change
We made a mistake on the health endpoint by returning a string "true".
We have to make the etcdctl works for the next version of etcd which
will correct the mistake on the server side.

It is too late to change the server side right now since we already
released a version of etcdctl that only understands "true".
2015-09-04 10:20:24 -07:00
Yicheng Qin 8e040efed9 etcdctl: log more about sync process
Users don't even know that etcdctl is doing sync and fails on sync
process. So we add more logs for sync process.
2015-09-02 16:10:25 -07:00
Yicheng Qin 423e3bbbd8 etcdctl/cluster_health: provide better message for empty client urls
It skips sync when init client, and prints out unreachable messagen and
points to notice when checking health of etcd members one by one.
2015-09-01 14:42:19 -07:00
Yicheng Qin c2caa4ae3b etcdctl/command: print more details about ErrNoEndpoint
This commit prints more details if getting ErrNoEndpoint when sync with
cluster. This helps users to know what happens.
2015-08-31 16:28:43 -07:00
Xiang Li 8d8033df55 etcdctl: suggest endpoint over peers flag 2015-08-27 18:52:17 -07:00
Xiang Li 044b23c3ca Merge pull request #3356 from xiang90/travis
*: test gofmt with -s and fix reported issues
2015-08-21 18:59:51 -07:00
Xiang Li 6b23a8131f *: test gofmt with -s and fix reported issues 2015-08-21 18:52:16 -07:00
Yicheng Qin 224755855d etcdctl/cluster_health: set health var when checked healthy
This was a typo.
2015-08-21 15:27:35 -07:00
Xiang Li b0303e948c Merge pull request #3323 from xiang90/cl_health
etcdctl: use health endpoint to greatly simplify health checking
2015-08-19 17:15:52 -07:00
Xiang Li 568d1c6783 etcdctl: use health endpoint to greatly simplify health checking 2015-08-19 11:47:08 -07:00
Yicheng Qin fab3feab66 etcdctl/role: reject non-canonical permission path
Non-canonical permission path is useless because the path received
by auth is always canonical, which is due to our ServeMux always
redirects request to canonical path().

This helps users to detect path permission setting error early.

Ref: http://godoc.org/net/http#ServeMux
2015-08-18 08:59:53 -07:00
Xiang Li 7e04a79fb4 etcdctl: print out better error information 2015-08-12 10:09:56 -07:00
Xiang Li e36c499d0f etcdctl: add per request timeout 2015-08-11 13:33:50 -07:00
Xiang Li 845c51fedd *: fix typos vaild->valid 2015-08-07 10:57:11 -07:00
Xiang Li 9527a97720 etcdctl: ls takes / as default key arg 2015-08-04 22:56:55 -07:00
Xiang Li ff5c3469c1 Merge pull request #3197 from xiang90/health
etcdctl: cluster-health supports forever flag
2015-08-03 20:48:06 -07:00
Xiang Li f7f00b0af6 etcdctl: cluster-health supports forever flag
cluster-health command supports checking the cluster health
forever.
2015-08-01 22:29:08 +08:00
Yicheng Qin 147885078c etcdctl: fix watch -after-index parsing
It uses -after-index incorrectly now:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=33
```

After this PR:

```
$ ./bin/etcdctl --debug watch -after-index 31 foo
Cluster-Endpoints: http://localhost:2379, http://localhost:4001
cURL Command: curl -X GET
http://localhost:2379/v2/keys/foo?recursive=false&wait=true&waitIndex=32
```
2015-07-30 11:15:43 -07:00
Yicheng Qin f1aaa7a9e3 etcdctl: refactor the way to check cluster health
This method uses raft status exposed at /debug/varz to determine the
health of the cluster. It uses whether commit index increases to
determine the cluster health, and uses whether match index increases to
determine the member health.

This could fix the bug #2711 that fails to detect follower is unhealthy
because it doesn't rely on whether message in long-polling connection is sent.

This health check is stricter than the old one, and reflects the
situation that whether followers are healthy in the view of the leader. One
example is that if the follower is receiving the snapshot, it will turns
out to be unhealthy because it doesn't move forward.

`etcdctl cluster-health` will reflect the healthy view in the raft level,
while connectivity checks reflects the healthy view in transport level.
2015-07-29 17:06:55 -07:00
Xiang Li 448ca20cdc etcdctl: fix exec watch command
The previous flag parsing has a small issue. It uses
`recursive == true` and `after-index == 0` to determine
if user specifies the sub flags. This is incorrect since
user can specify `after-index = 0`. Then the flag parsing
would be confused.

This commit explicitly find the `--` in the remaining args
and determine the key and cmdArgs accordingly.
2015-07-23 13:13:15 +08:00
Yicheng Qin 604709cad7 etcdctl: update -peers to default to use schema
Change its default value from `127.0.0.1:4001,127.0.0.1:2379` to
`http://127.0.0.1:4001,http://127.0.0.1:2379`

Adding HTTP schema makes its format consistent with etcd's xxx-urls
flags.
2015-07-21 12:53:21 -07:00
Mohammad Samman 43437e21f9 etcdctl: added domain discovery flag
provided a domain, will look up SRV records for etcd endpoints

Fixes #2636
2015-07-21 12:53:21 -07:00
Xiang Li ee82ee05b4 etcdctl: support member update command 2015-07-21 12:53:20 -07:00
Xiang Li 9f9661f513 etcdctl: print out key and action when watching recursively 2015-07-21 12:53:20 -07:00
Xiang Li 87ef0f0b3e godep: remove go-etcd dependency 2015-07-21 12:53:20 -07:00
Xiang Li 071ad9f72b etcdctl: health use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li 0b1ddce889 etcdctl: import snap use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li adeb101e04 etcdctl: remove old stuff 2015-07-21 12:53:20 -07:00
Xiang Li 759c156e3e etcdctl: exec_watch use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li 5b01b3877f etcdctl: watch use etcd/client 2015-07-21 12:53:20 -07:00
Xiang Li b20c06348d etcdctl: ls use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li ae1669de26 etcdctl: updatedir use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li f12ae45c6a etcdctl: update use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li 58b19a7c1e etcdctl: rmdir use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li 9d7a8dd2b0 etcdctl: mk use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li 61befc7ce6 etcdctl: minor cleanup 2015-07-21 12:53:19 -07:00
Xiang Li e3fcc450cf etcdctl: make rm use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li 9d9c3a7180 etcdctl: make setdir/mkdir use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li db4b18aee3 etcdctl: make set command use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li e9478ba630 etcdctl: make get command use etcd/client 2015-07-21 12:53:19 -07:00
Xiang Li 61e9b99edb Merge pull request #2417 from kelseyhightower/improve-etcdctl-ls-command-help
etcdctl: update the ls subcommand help to match behavior
2015-07-09 11:33:19 -06:00
Barak Michener 64ec8af91b *: Rename `security` to `auth` 2015-06-15 18:18:50 -04:00
Xiang Li f59da0e453 *:fix point-in-time backup
Backup process should be able to read all WALs until io.EOF to
generate a point-in-time backup.

Our WAL file is append-only. And the backup process will lock all
files before start reading, which can prevent the gc routine from
removing any files in the middle.
2015-06-15 11:12:28 -07:00
Barak Michener a4d1a5a6e5 *: Add security/auth support to etcdctl and etcd/client
add godep for speakeasy and auth entry parsing
add security_user to client
add role to client
add role commands
add auth support to etcdclient and etcdctl(member/user)
add enable/disable to etcdctl
better error messages, read/write/readwrite
Bump go-etcd to include codec changes, add new dependency
verify the error for revoke/add if nothing changed, remove security-merging prefix
2015-06-10 16:58:10 -04:00