canarieapi.api
¶
API definition.
This module defines the generic REST API for platforms and services as defined by the CANARIE API specification.
Module Contents¶
Functions¶
|
Generate error response for raised exceptions. |
|
|
|
|
Handle HTML errors from an external response. |
|
|
Info route required by CANARIE. |
|
Obtain all monitoring statuses for the requested service or platform. |
|
Obtain access statuses of a service or platform from cron monitoring and logging jobs. |
|
Obtain the last time cron job have run (help to diagnose cron problem). |
|
Stats route required by CANARIE. |
|
Extra route to know service status. |
|
#Handle simple requests required by CANARIE. |
|
Disconnect database. |
Attributes¶
- canarieapi.api.handle_exceptions(exception_instance: Exception) flask.typing.ResponseReturnValue [source]¶
Generate error response for raised exceptions.
- Parameters:
exception_instance – Exception instance.
- canarieapi.api.extern_html_error_handler(status_code_str: str) flask.typing.ResponseReturnValue [source]¶
Handle HTML errors from an external response.
Handle errors that occur externally provided that Apache is configured so that it uses this route for handling errors.
For this add this line for each handled HTML errors in the Apache configuration:
ErrorDocument 400 <Rest root>/400
- canarieapi.api.information(route_name: str, api_type: canarieapi.utility_rest.APIType) flask.typing.ResponseReturnValue [source]¶
Info route required by CANARIE.
- canarieapi.api.collect_monitoring_statuses(route_name: str, *, database: sqlite3.Connection | None = None) MonitorInfo [source]¶
Obtain all monitoring statuses for the requested service or platform.
- canarieapi.api.collect_cron_access_stats(route_name: str, *, database: sqlite3.Connection | None = None) CronAccessStats [source]¶
Obtain access statuses of a service or platform from cron monitoring and logging jobs.
- canarieapi.api.collect_cron_last_status(*, database: sqlite3.Connection | None = None) CronLastStatus [source]¶
Obtain the last time cron job have run (help to diagnose cron problem).
- canarieapi.api.stats(route_name: str, api_type: canarieapi.utility_rest.APIType) flask.typing.ResponseReturnValue [source]¶
Stats route required by CANARIE.
- canarieapi.api.status(route_name: str, api_type: canarieapi.utility_rest.APIType) flask.typing.ResponseReturnValue [source]¶
Extra route to know service status.