diff --git a/Documentation/0.5/other_apis.md b/Documentation/0.5/other_apis.md index b916931d3..95e0f8cf3 100644 --- a/Documentation/0.5/other_apis.md +++ b/Documentation/0.5/other_apis.md @@ -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/ 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/ 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"]}' +```