Skip to content
This repository has been archived by the owner on Jun 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #7 from philips/cleanup-readme
Browse files Browse the repository at this point in the history
README improvements
  • Loading branch information
philips committed Aug 11, 2013
2 parents 3b786ef + 1c2c0f4 commit 83f8c50
Showing 1 changed file with 67 additions and 26 deletions.
93 changes: 67 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,54 @@ etcdctl

[![Build Status](https://travis-ci.org/coreos/etcdctl.png)](https://travis-ci.org/coreos/etcdctl)

This is our spec/working area for a simple command line client for etcd. This client will be bundled with CoreOS. This is all brainstorming at the moment. Please contribute!
`etcdctl` is a command line client for [etcd][etcd]. It can be used in scripts or for administrators to explore an etcd cluster.

## Example usage
[etcd]: https://github.com/coreos/etcd

Setting a key on `/foo/bar`:
## Getting etcdctl

The latest release is available as a binary at [Github][github-release] along with etcd.

[github-release]: https://github.com/coreos/etcd/releases/

You can also build etcdctl from source:

```
./build
```

## Usage

### Key/Value

Setting a key on `/foo/bar`:

```
etcdctl set /foo/bar "Hello world"
Hello world
```

$ etcdctl set /foo/bar "Hello world"
Hello world

Getting a key:

$ etcdctl get /foo/bar
Hello world
```
etcdctl get /foo/bar
Hello world
```

Deleting a key:

$ etcdctl delete /foo/bar
Hello world
```
etcdctl delete /foo/bar
Hello world
```

Tailing a key:

$ etcdctl watch /foo/bar -f
Hello world
.... client hangs forever until ctrl+C printing values as key change
```
etcdctl watch /foo/bar -f
Hello world
.... client hangs forever until ctrl+C printing values as key change
```

### Sets

Expand All @@ -37,24 +61,26 @@ an etcd key, so that they can be detected and used by clients.

Adding members to a set:

$ etcdctl sadd /queues amqp://user:password@rabbitmq1
amqp://user:password@rabbitmq1
$ etcdctl sadd /queues amqp://user:password@rabbitmq2 --ttl=60
amqp://user:password@rabbitmq2
```
etcdctl sadd /queues amqp://user:password@rabbitmq1
amqp://user:password@rabbitmq1
etcdctl sadd /queues amqp://user:password@rabbitmq2 --ttl=60
amqp://user:password@rabbitmq2
```

List all members:

$ etcdctl smembers /queues
amqp://user:password@rabbitmq1
amqp://user:password@rabbitmq2
To delete a member:
```
etcdctl smembers /queues
amqp://user:password@rabbitmq1
amqp://user:password@rabbitmq2
```

$ etcdctl sdel /queues amqp://user:password@rabbitmq1

## Building
To delete a member:

./build
```
etcdctl sdel /queues amqp://user:password@rabbitmq1
```

## Return Codes

Expand All @@ -69,3 +95,18 @@ To delete a member:
4 400 error from etcd

5 500 error from etcd

## Project Details

### Versioning

etcdctl uses [semantic versioning][semver].
Releases will follow lockstep with the etcd release cycle.

[semver]: http://semver.org/

### License

etcdctl is under the Apache 2.0 license. See the [LICENSE][license] file for details.

[license]: https://github.com/coreos/etcdctl/blob/master/LICENSE

0 comments on commit 83f8c50

Please sign in to comment.