You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2020/01/29 03:19:06 UTC

[couchdb-documentation] branch master updated: Document GET /_node/{nodename} (#486)

This is an automated email from the ASF dual-hosted git repository.

wohali pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-documentation.git


The following commit(s) were added to refs/heads/master by this push:
     new e5550c5  Document GET /_node/{nodename} (#486)
e5550c5 is described below

commit e5550c5b22fedd511892ee11bf9bb05bf7fde52d
Author: Joan Touzet <wo...@users.noreply.github.com>
AuthorDate: Wed Jan 29 03:18:59 2020 +0000

    Document GET /_node/{nodename} (#486)
---
 src/api/server/common.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++
 src/whatsnew/3.0.rst      |  2 +-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/src/api/server/common.rst b/src/api/server/common.rst
index a5fb478..0343625 100644
--- a/src/api/server/common.rst
+++ b/src/api/server/common.rst
@@ -1400,6 +1400,50 @@ error.
             "target": "http://adm:*****@localhost:15984/cdyno-0000002/"
         }
 
+.. _api/server/name:
+
+======================
+``/_node/{node-name}``
+======================
+
+.. http:get:: /_node/{node-name}
+    :synopsis: Returns node name
+
+    The ``/_node/{node-name}`` endpoint can be used to confirm the Erlang
+    node name of the server that processes the request. This is most useful
+    when accessing ``/_node/_local`` to retrieve this information. Repeatedly
+    retrieving this information for a CouchDB endpoint can be useful to determine
+    if a CouchDB cluster is correctly proxied through a reverse load balancer.
+
+    :<header Accept: - :mimetype:`application/json`
+                     - :mimetype:`text/plain`
+    :>header Content-Type: - :mimetype:`application/json`
+                           - :mimetype:`text/plain; charset=utf-8`
+    :code 200: Request completed successfully
+
+    **Request**:
+
+    .. code-block:: http
+
+        GET /_node/_local HTTP/1.1
+        Accept: application/json
+        Host: localhost:5984
+
+    **Response**:
+
+    .. code-block:: http
+
+      HTTP/1.1 200 OK
+      Cache-Control: must-revalidate
+      Content-Length: 27
+      Content-Type: application/json
+      Date: Tue, 28 Jan 2020 19:25:51 GMT
+      Server: CouchDB (Erlang OTP)
+      X-Couch-Request-ID: 5b8db6c677
+      X-CouchDB-Body-Time: 0
+
+      {"name":"node1@127.0.0.1"}
+
 .. _api/server/stats:
 
 =============================
diff --git a/src/whatsnew/3.0.rst b/src/whatsnew/3.0.rst
index c7f9cf7..d9bcce7 100644
--- a/src/whatsnew/3.0.rst
+++ b/src/whatsnew/3.0.rst
@@ -216,7 +216,7 @@ Features and Enhancements
   blocking.
 
 * :ghissue:`2005`, :ghissue:`2006`: The name of any node can now be retrieved through
-  the new API endpoint ``GET /_node/_local``.
+  the :ref:`new API endpoint <api/server/name>` ``GET /_node/{node-name}``.
 
 * :ghissue:`1766`: Timeouts for requests, ``all_docs``, attachments, views, and
   partitioned view requests can all be specified separately in the ini file under