Skip to content

Views

This views defines an API endpoint for retrieving the application monitoring.

get_version() async

Retrieve the application version.

This asynchronous route handler is executed when a GET request is made to '/version'. It calls the 'sem_ver' function to obtain the application version and returns it as the response.

Returns:

Type Description
Response

The Response with application version.

Source code in hestia/web/api/monitoring/views.py
14
15
16
17
18
19
20
21
22
23
24
@router.get("/version")
async def get_version() -> Response:
    """
    Retrieve the application version.

    This asynchronous route handler is executed when a GET request is made to '/version'.
    It calls the 'sem_ver' function to obtain the application version and returns it as the response.

    :return: The Response with application version.
    """
    return success(data={"version": sem_ver()})

health_check()

Checks the health of a project.

It returns 200 if the project is healthy.

Source code in hestia/web/api/monitoring/views.py
27
28
29
30
31
32
33
34
35
@router.get("/health")
def health_check() -> Response:
    """
    Checks the health of a project.

    It returns 200 if the project is healthy.
    """

    return success(message="OK")