Merge pull request #1879 from xiang90/peer_url_doc

doc: add doc for changing peer urls
release-2.0
Xiang Li 2014-12-08 13:40:47 -08:00
commit 31b9f712ba
1 changed files with 27 additions and 5 deletions

View File

@ -16,7 +16,7 @@ GET /v2/members HTTP/1.1
### Example
```
```sh
curl http://10.0.0.10:2379/v2/members
```
@ -63,8 +63,9 @@ POST /v2/members HTTP/1.1
### Example
```
curl http://10.0.0.10:2379/v2/members -XPOST -H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.0.10:2379"]}'
```sh
curl http://10.0.0.10:2379/v2/members -XPOST \
-H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.0.10:2379"]}'
```
```json
@ -79,7 +80,7 @@ curl http://10.0.0.10:2379/v2/members -XPOST -H "Content-Type: application/json"
## Delete a member
Remove a member from the cluster. The member ID must be a hex-encoded uint64.
Returns empty when successful. Returns a string describing the failure condition when unsuccessful.
Returns 204 with empty content when successful. Returns a string describing the failure condition when unsuccessful.
If the member does not exist in the cluster an HTTP 500(TODO: fix this) will be returned. If the cluster fails to process the request within timeout an HTTP 500 will be returned, though the request may be processed later.
@ -91,6 +92,27 @@ DELETE /v2/members/<id> HTTP/1.1
### Example
```
```sh
curl http://10.0.0.10:2379/v2/members/272e204152 -XDELETE
```
## Change the peer urls of a member
Change the peer urls of a given mamber. The member ID must be a hex-encoded uint64. Returns 204 with empty content when successful. Returns a string describing the failure condition when unsuccessful.
If the POST body is malformed an HTTP 400 will be returned. If the member does not exist in the cluster an HTTP 404 will be returned. If any of the given peerURLs exists in the cluster an HTTP 409 will be returned. If the cluster fails to process the request within timeout an HTTP 500 will be returned, though the request may be processed later.
#### Request
```
PUT /v2/members/<id> HTTP/1.1
{"peerURLs": ["http://10.0.0.10:2379"]}
```
#### Example
```sh
curl http://10.0.0.10:2379/v2/members/272e204152 -XPUT \
-H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.0.10:12379"]}'
```