Skip to content
Snippets Groups Projects
Commit 2c3af024 authored by Release Webservice's avatar Release Webservice
Browse files

Finished release 0.84.

parents 4ee607b4 f6abbb7a
Branches
Tags 0.84
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.84] - 2022-03-07
- DBOARD3-536: added /ping endpoint
## [0.83] - 2022-03-02 ## [0.83] - 2022-03-02
- DBOARD3-533: allow netconf configuration 'inactive' attribute (e.g. rt1.bra.sk) - DBOARD3-533: allow netconf configuration 'inactive' attribute (e.g. rt1.bra.sk)
- POL1-565: return non-monitored services in /msr/services - POL1-565: return non-monitored services in /msr/services
......
...@@ -17,14 +17,7 @@ and www.json.org for more details. ...@@ -17,14 +17,7 @@ and www.json.org for more details.
.. contents:: :local: .. contents:: :local:
/version .. automodule:: inventory_provider.routes.default
-------------
.. autofunction:: inventory_provider.routes.default.version
API modules
--------------
.. automodule:: inventory_provider.routes.classifier .. automodule:: inventory_provider.routes.classifier
......
"""
Health-related Endpoints
=========================
These endpoints are intended for checking the status of the service.
.. contents:: :local:
/version
---------------------
.. autofunction:: inventory_provider.routes.default.version
/ping
-----------------------------
.. autofunction:: inventory_provider.routes.default.ping
"""
import pkg_resources import pkg_resources
from flask import Blueprint, jsonify, current_app from flask import Blueprint, jsonify, current_app
...@@ -72,3 +92,15 @@ def version(): ...@@ -72,3 +92,15 @@ def version():
if latch: if latch:
version_params['latch'] = latch version_params['latch'] = latch
return jsonify(version_params) return jsonify(version_params)
@routes.route('/ping', methods=['GET', 'POST'])
def ping():
"""
This method can be used to verify the web service is alive
and processing requests. This endpoint is used by haproxy
for backend http checks.
There's no response payload, only 204 (empty content) will be returned.
"""
return '', 204
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='inventory-provider', name='inventory-provider',
version="0.83", version="0.84",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='Dashboard inventory provider', description='Dashboard inventory provider',
......
...@@ -63,3 +63,15 @@ def test_load_json_docs(data_config, mocked_redis): ...@@ -63,3 +63,15 @@ def test_load_json_docs(data_config, mocked_redis):
for ifc in common.load_json_docs( for ifc in common.load_json_docs(
data_config, 'netconf-interfaces:*', num_threads=20): data_config, 'netconf-interfaces:*', num_threads=20):
jsonschema.validate(ifc, INTERFACE_SCHEMA) jsonschema.validate(ifc, INTERFACE_SCHEMA)
def test_ping_post(client):
rv = client.post('ping')
assert rv.status_code == 204
assert len(rv.data) == 0
def test_ping_get(client):
rv = client.get('ping')
assert rv.status_code == 204
assert len(rv.data) == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment