hawat.blueprints.dnsr package

This pluggable module provides access to DNS service. It is implemented upon custom mentat.services.dnsr module.

Provided endpoints

/dnsr/search

Endpoint providing search form for querying DNS service and formating result as HTML page.

  • Authentication: login required

  • Methods: GET

/api/dnsr/search

Endpoint providing API search form for querying DNS service and formating result as JSON document.

  • Authentication: login required

  • Authorization: any role

  • Methods: GET, POST

/snippet/dnsr/search

Endpoint providing API search form for querying DNS service and formating result as JSON document containing HTML snippets.

  • Authentication: login required

  • Authorization: any role

  • Methods: GET, POST

class hawat.blueprints.dnsr.APISearchView[source]

Bases: vial.view.mixin.AJAXMixin, hawat.blueprints.dnsr.AbstractSearchView

View responsible for querying DNS service and presenting the results in the form of JSON document.

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

methods = ['GET', 'POST']
class hawat.blueprints.dnsr.AbstractSearchView[source]

Bases: vial.view.RenderableView

Application view providing base search capabilities for DNS service.

The resolving is implemented using mentat.services.dnsr module.

authentication = True
authorization = [<Permission needs={Need(method='role', value='maintainer'), Need(method='role', value='developer'), Need(method='role', value='user'), Need(method='role', value='admin')} excludes=set()>]
dispatch_request()[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]

Return menu entry title for the view.

Default implementation returns the return value of vial.view.BaseView.get_view_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Menu entry title for the view.

Return type

str

classmethod get_view_title(**kwargs)[source]

Return title for the view, that will be displayed in the title tag of HTML head element and also as the content of page header in h2 tag.

Default implementation returns the return value of vial.view.BaseView.get_menu_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Title for the view.

Return type

str

hawat.blueprints.dnsr.BLUEPRINT_NAME = 'dnsr'

Name of the blueprint as module global constant.

class hawat.blueprints.dnsr.DnsrBlueprint(name, import_name, **kwargs)[source]

Bases: vial.app.VialBlueprint

Hawat pluggable module - DNS service.

classmethod get_module_title()[source]

Implementation of vial.app.VialBlueprint.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 customized.

class hawat.blueprints.dnsr.SearchView[source]

Bases: vial.view.mixin.HTMLMixin, hawat.blueprints.dnsr.AbstractSearchView

View responsible for querying DNS service and presenting the results in the form of HTML page.

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

methods = ['GET']
class hawat.blueprints.dnsr.SnippetSearchView[source]

Bases: vial.view.mixin.SnippetMixin, hawat.blueprints.dnsr.AbstractSearchView

View responsible for querying DNS service and presenting the results in the form of JSON document containing ready to use HTML page snippets.

classmethod get_view_name()[source]

Return unique name for the view. Name must be unique in the namespace of parent blueprint/module and should contain only characters [a-z0-9]. It will be used for generating endpoint name for the view.

This method does not have any default implementation and must be overridden by a subclass.

Returns

Name for the view.

Return type

str

methods = ['GET', 'POST']
renders = ['label', 'full']
snippets = [{'name': 'hostnames', 'condition': <function SnippetSearchView.<lambda>>}]
hawat.blueprints.dnsr.get_blueprint()[source]

Mandatory interface for vial.Vial and factory function. This function must return a valid instance of vial.app.VialBlueprint or flask.Blueprint.