Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dedicated version and health api docs pages #3482

Merged
merged 3 commits into from
Dec 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/graphql/manual/api-reference/health.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. _health_api_reference:

Health check API Reference
==========================

.. contents:: Table of contents
:backlinks: none
:depth: 1
:local:

The Health API is a public endpoint which gives info on the server health.

Endpoint
--------

All requests are ``GET`` requests to the ``/healthz`` endpoint.

API Spec
--------

Request
^^^^^^^

.. code-block:: http

GET /healthz HTTP/1.1

Response
^^^^^^^^

Depending on the server health status any of the following responses can be returned:

.. list-table::
:header-rows: 1

* - Server condition
- HTTP Status
- Message
* - All healthy
- 200
- OK
* - Serving requests but some metadata objects are inconsistent/not-available
- 200
- WARN: inconsistent objects in schema
* - Unhealthy
- 500
- ERROR

.. note::

If there are metadata inconsistencies, you should use the Hasura console or the
`get_inconsistent_metadata <schema-metadata-api/manage-metadata.html#get-inconsistent-metadata>`_ API to find out what
the inconsistent objects are and resolve them.


Sample response
***************

.. code-block:: http

HTTP/1.1 200 OK


Disabling Health check API
--------------------------

The ``healthz`` API endpoint is public and cannot be disabled
30 changes: 6 additions & 24 deletions docs/graphql/manual/api-reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,18 @@ See details at :doc:`schema-metadata-api/index`.
Version API
^^^^^^^^^^^

A ``GET`` request to the public ``/v1/version`` endpoint responds with the current server version
in JSON format:
The ``/v1/version`` is a public endpoint that responds with the current server version in JSON format.

.. code-block:: js

{"version": "v1.0.0-alpha01"}
See details at :doc:`version`.

.. _health_api:

Health check API
^^^^^^^^^^^^^^^^

A ``GET`` request to the public ``/healthz`` endpoint will respond with the following:

.. list-table::
:header-rows: 1

* - Server condition
- HTTP Status
- Message
* - All healthy
- 200
- OK
* - Serving requests but some metadata objects are inconsistent/not-available
- 200
- WARN: inconsistent objects in schema
* - Unhealthy
- 500
- ERROR

If there are metadata inconsistencies, you should use the console or use the `get_inconsistent_metadata <schema-metadata-api/manage-metadata.html#get-inconsistent-metadata>`_ API to find out what the inconsistent objects are.
The ``/healthz`` is a public endpoint that returns the server health status.

See details at :doc:`health`.

.. _pg_dump_api:

Expand Down Expand Up @@ -122,6 +102,8 @@ You can refer to the following to know about all PostgreSQL types supported by t

GraphQL API <graphql-api/index>
Schema / Metadata APIs <schema-metadata-api/index>
Version API <version>
Health check API <health>
PG Dump API <pgdump>
Config API <config>
Supported PostgreSQL types <postgresql-types>
45 changes: 45 additions & 0 deletions docs/graphql/manual/api-reference/version.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. _version_api_reference:

Version API Reference
=====================

.. contents:: Table of contents
:backlinks: none
:depth: 1
:local:


The ``/v1/version`` is a public endpoint that responds with the current server version in JSON format.

Endpoint
--------

All requests are ``GET`` requests to the ``/v1/version`` endpoint.

API Spec
--------

Request
^^^^^^^

.. code-block:: http

GET /v1/version HTTP/1.1


Sample response
^^^^^^^^^^^^^^^

.. code-block:: http

HTTP/1.1 200 OK
Content-Type: application/json

{
"version": "v1.0.0-alpha01"
}

Disabling Version API
---------------------

The ``version`` API endpoint is public and cannot be disabled
rikinsk marked this conversation as resolved.
Show resolved Hide resolved