hawat.blueprints.dbstatus package

Description

This pluggable module provides access to database status information. The following information is provided:

  • general statistics of event database:

    • general statistics of events table

      • estimated number of records

      • table size, index size, tablespace size and total size

      • oldest and youngest record timestamp, record timespan

    • general statistics of event_thresholds table

      • estimated number of records

      • table size, index size, tablespace size and total size

      • oldest and youngest record timestamp, record timespan

    • general statistics of thresholds table

      • estimated number of records

      • table size, index size, tablespace size and total size

      • oldest and youngest record timestamp, record timespan

  • PostgreSQL configurations

Provided endpoints

/dbstatus/view

Page providing read-only access various database status characteristics.

Authentication: login required Authorization: admin role only Methods: GET

class hawat.blueprints.dbstatus.AbstractQueryStopView[source]

Bases: hawat.base.PsycopgMixin, hawat.base.RenderableView

Application view providing ability to stop given query.

authentication = True
authorization = [<Permission needs={Need(method='role', value='admin'), Need(method='role', value='maintainer'), Need(method='role', value='developer'), Need(method='role', value='user')} excludes=set()>]
classmethod authorize_item_action(**kwargs)[source]

Perform access authorization for current user to particular item.

check_action_cancel(form, **kwargs)[source]

Check the form for cancel button press and cancel the action.

dispatch_request(item_id)[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

static get_message_cancel(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_cancel().

static get_message_failure(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_failure().

static get_message_success(**kwargs)[source]

Implementation of hawat.base.ItemActionView.get_message_success().

get_url_next()[source]

Hook method. Must return URL for redirection after action success. In most cases there should be call for flask.url_for() function somewhere in this method.

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

classmethod get_view_url(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_url().

methods = ['GET', 'POST']
class hawat.blueprints.dbstatus.ApiQueryStopView[source]

Bases: hawat.base.AJAXMixin, hawat.blueprints.dbstatus.AbstractQueryStopView

Application view providing ability to stop given query.

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

hawat.blueprints.dbstatus.BLUEPRINT_NAME = 'dbstatus'

Name of the blueprint as module global constant.

class hawat.blueprints.dbstatus.DashboardView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.SimpleView

View responsible for presenting database dashboard.

authentication = True
authorization = [<Permission needs={Need(method='role', value='admin')} excludes=set()>]
do_before_response(**kwargs)[source]

Implementation of hawat.base.RenderableView.do_before_response().

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

classmethod get_view_template()[source]

Implementation of hawat.base.RenderableView.get_view_template().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

class hawat.blueprints.dbstatus.DatabaseStatusBlueprint(name, import_name, **kwargs)[source]

Bases: hawat.base.HawatBlueprint

Hawat pluggable module - database status.

classmethod get_module_title()[source]

Implementation of hawat.base.HawatBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customize.

class hawat.blueprints.dbstatus.QueryStatusView[source]

Bases: hawat.base.AJAXMixin, hawat.base.PsycopgMixin, hawat.base.RenderableView

Application view providing access status information of given single query.

authentication = True
authorization = [<Permission needs={Need(method='role', value='admin'), Need(method='role', value='maintainer'), Need(method='role', value='developer'), Need(method='role', value='user')} excludes=set()>]
dispatch_request(item_id)[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

do_before_response(**kwargs)[source]

Implementation of hawat.base.RenderableView.do_before_response().

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

classmethod get_view_url(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_url().

class hawat.blueprints.dbstatus.QueryStopView[source]

Bases: hawat.base.HTMLMixin, hawat.blueprints.dbstatus.AbstractQueryStopView

Application view providing ability to stop given query.

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

classmethod get_view_template()[source]

Implementation of hawat.base.RenderableView.get_view_template().

class hawat.blueprints.dbstatus.ViewView[source]

Bases: hawat.base.HTMLMixin, hawat.base.PsycopgMixin, hawat.base.SimpleView

Application view providing access event database status information.

authentication = True
authorization = [<Permission needs={Need(method='role', value='admin')} excludes=set()>]
do_before_response(**kwargs)[source]

Implementation of hawat.base.RenderableView.do_before_response().

classmethod get_menu_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_icon()[source]

Implementation of hawat.base.BaseView.get_view_icon().

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

classmethod get_view_title(**kwargs)[source]

Implementation of hawat.base.BaseView.get_view_title().

hawat.blueprints.dbstatus.get_blueprint()[source]

Mandatory interface and factory function. This function must return a valid instance of hawat.base.HawatBlueprint or flask.Blueprint.