From 2b519c90b9a84a2cb5257ec2b848dd73f7326861 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 8 Dec 2014 11:43:14 -0800 Subject: [PATCH 1/3] doc: add doc for changing peer urls --- Documentation/0.5/other_apis.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/0.5/other_apis.md b/Documentation/0.5/other_apis.md index b916931d3..fabaed9d9 100644 --- a/Documentation/0.5/other_apis.md +++ b/Documentation/0.5/other_apis.md @@ -94,3 +94,23 @@ DELETE /v2/members/ HTTP/1.1 ``` 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 empty 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 + +``` +curl http://10.0.0.10:2379/v2/members/272e204152 -XPUT -H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.0.10:12379"]}' +``` From e83e2bff9200dd173872120d9fab6d7a61292765 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 8 Dec 2014 11:46:24 -0800 Subject: [PATCH 2/3] doc: refactor other_apis.md --- Documentation/0.5/other_apis.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Documentation/0.5/other_apis.md b/Documentation/0.5/other_apis.md index fabaed9d9..82add58a6 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 @@ -91,7 +92,7 @@ DELETE /v2/members/ HTTP/1.1 ### Example -``` +```sh curl http://10.0.0.10:2379/v2/members/272e204152 -XDELETE ``` @@ -111,6 +112,7 @@ PUT /v2/members/ HTTP/1.1 #### Example -``` -curl http://10.0.0.10:2379/v2/members/272e204152 -XPUT -H "Content-Type: application/json" -d '{"peerURLs":["http://10.0.0.10:12379"]}' +```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"]}' ``` From 706b6f96b33e5ad1006d46a88b876ceab8a77a70 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 8 Dec 2014 13:09:26 -0800 Subject: [PATCH 3/3] doc: http status for other_apis.md --- Documentation/0.5/other_apis.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/0.5/other_apis.md b/Documentation/0.5/other_apis.md index 82add58a6..95e0f8cf3 100644 --- a/Documentation/0.5/other_apis.md +++ b/Documentation/0.5/other_apis.md @@ -80,7 +80,7 @@ curl http://10.0.0.10:2379/v2/members -XPOST \ ## 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. @@ -98,7 +98,7 @@ 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 empty when successful. Returns a string describing the failure condition when unsuccessful. +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.