canarieapi.api
¶
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. |
|
|
|
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.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.