{ "info": { "author": "UCT Prague, CESNET z.s.p.o., NTK", "author_email": "miroslav.simek@vscht.cz", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Heartbeat module for Flask applications and OAREPO Invenio repository\n========================================================================\n\nA heartbeat module for flask and OAREPO Invenio. It provides 3 endpoints:\n\n* ``.well-known/heartbeat/readiness``\n\n* ``.well-known/heartbeat/liveliness``\n\n* ``.well-known/heartbeat/environ``\n\n\n\n``.well-known/heartbeat/readiness``\n------------------------------------\n\nThis endpoint returns HTTP status 200 if the server is ready for user requests or 500\nif the server is not yet ready.\n\nAt the same time, it returns a payload explaining what is not yet ready/what went wrong:\n\n.. code:: json\n\n {\n \"status\": false,\n \"checks\": {\n \"Database\": {\n \"status\": false,\n \"message\": \"Error accessing database\"\n }\n }\n }\n\nThis endpoint should be called as Kubernetes readiness probe\n\n*Note:* the result is extensible, ignore unknown keys\n\n**Signals:**\n\nA ``oarepo_heartbeat.readiness_probe`` signal (with name ``oarepo.probe.readiness``)\nis called during the readiness processing. Signal handler should return a response\nin the form of a tuple ``(name, status, data)``. The ``status`` is the ``logical and``\nof returned statuses and data are passed inside the element. The following section\nwill be added to the response:\n\n.. code:: python\n\n \"checks\": {\n \"returned_name\": {\n \"status\": \"returned_status\",\n **returned_data\n }\n }\n\n\n**Initial implementation:**\n\nWhen no signals are attached, the probe always returns HTTP 200, thus checking\nif the server is running.\n\n``.well-known/heartbeat/liveliness``\n------------------------------------\n\nThis endpoint returns HTTP status 200 if the server is functioning correctly or 500\nif the server has a problem.\n\nAt the same time, it returns a payload explaining what went wrong in the same format as in\nreadiness probe:\n\n.. code:: json\n\n {\n \"status\": false,\n \"checks\": {\n \"Database\": {\n \"status\": false,\n \"message\": \"Error accessing database\"\n }\n }\n }\n\nThis endpoint should be called as Kubernetes liveliness probe\n\n*Note:* the result is extensible, ignore unknown keys\n\n**Signals:**\n\nA ``oarepo_heartbeat.liveliness_probe`` signal (with name ``oarepo.probe.liveliness``)\nis called during the readiness processing. Signal handler should return a response\nin the form of a tuple ``(name, status, data)``. The ``status`` is the ``logical and``\nof returned statuses and data are passed inside the element.\n\n**Initial implementation:**\n\nWhen no signals are attached, the probe always returns HTTP 200, thus checking\nif the server is running.\n\n``.well-known/heartbeat/environ``\n------------------------------------\n\nEndpoint returning the runtime environment of the server. The result contains at least\na set of libraries present in the virtualenv and their versions.\n\n.. code:: json\n\n {\n \"status\": true,\n \"libraries\": {\n \"oarepo\": {\n \"conflicts\": null,\n \"version\": \"3.1.1\"\n }\n },\n \"python\": [3, 6, 1]\n }\n\n*Note:* the result is extensible, ignore unknown keys\n\n**Signals:**\n\nA ``oarepo_heartbeat.environ_probe`` signal (with name ``oarepo.probe.environ``)\nis called during the readiness processing. Signal handler should return a response\nas a tuple ``(status, {data})``. The ``status`` is the ``logical and`` of returned statuses\nand the data are merged into one dictionary.\n\n**Initial implementation:**\n\nWhen no signals are attached, the probe always returns HTTP 200 with json containing\n``libraries`` and ``python`` elements as shown above.\n\nInvenio usage:\n==============\n\nTo use this library on invenio, do not forget to add it to setup's blueprints\nand define your own readiness & liveliness signal handlers as needed (for example,\nchecking database, ES connectivity):\n\n.. code:: python\n\n 'invenio_base.blueprints': [\n 'oarepo-heartbeat = oarepo_heartbeat.views:blueprint',\n ],\n\n\nFlask usage:\n==============\n\nRegister the ``oarepo_heartbeat.views:blueprint`` blueprint to your flask\napplication and write your own readiness and liveliness signals as needed.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/oarepo/oarepo-heartbeat", "keywords": "oarepo invenio flask heartbeat kubernetes", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "oarepo-heartbeat", "package_url": "https://pypi.org/project/oarepo-heartbeat/", "platform": "any", "project_url": "https://pypi.org/project/oarepo-heartbeat/", "project_urls": { "Homepage": "https://github.com/oarepo/oarepo-heartbeat" }, "release_url": "https://pypi.org/project/oarepo-heartbeat/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "", "version": "1.0.0" }, "last_serial": 5728998, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6f894930633a3eb40f88bd838fd3c23d", "sha256": "f84324faa5933025bac5e7f22c6f8dc010db526757dd0bc288bfceca651046bd" }, "downloads": -1, "filename": "oarepo-heartbeat-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6f894930633a3eb40f88bd838fd3c23d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2019-08-26T05:53:11", "url": "https://files.pythonhosted.org/packages/de/c6/a0c260ee8b5caecfd9ba8ca15dc0e011e8a3933ac37943f8e2eaec417cdf/oarepo-heartbeat-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6f894930633a3eb40f88bd838fd3c23d", "sha256": "f84324faa5933025bac5e7f22c6f8dc010db526757dd0bc288bfceca651046bd" }, "downloads": -1, "filename": "oarepo-heartbeat-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6f894930633a3eb40f88bd838fd3c23d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2019-08-26T05:53:11", "url": "https://files.pythonhosted.org/packages/de/c6/a0c260ee8b5caecfd9ba8ca15dc0e011e8a3933ac37943f8e2eaec417cdf/oarepo-heartbeat-1.0.0.tar.gz" } ] }