senlin_dashboard.cluster.receivers package

Submodules

senlin_dashboard.cluster.receivers.forms module

Forms for managing receivers.

class senlin_dashboard.cluster.receivers.forms.CreateReceiverForm(request, *args, **kwargs)[source]

Bases: SelfHandlingForm

base_fields = {'action': <django.forms.fields.CharField object>, 'cluster_id': <horizon.forms.fields.ThemableChoiceField object>, 'name': <django.forms.fields.CharField object>, 'params': <django.forms.fields.CharField object>, 'type': <horizon.forms.fields.ThemableChoiceField object>}
declared_fields = {'action': <django.forms.fields.CharField object>, 'cluster_id': <horizon.forms.fields.ThemableChoiceField object>, 'name': <django.forms.fields.CharField object>, 'params': <django.forms.fields.CharField object>, 'type': <horizon.forms.fields.ThemableChoiceField object>}
handle(request, data)[source]
property media

Return all media required to render the widgets on this form.

senlin_dashboard.cluster.receivers.panel module

class senlin_dashboard.cluster.receivers.panel.Receivers[source]

Bases: Panel

name = 'Receivers'
slug = 'receivers'

senlin_dashboard.cluster.receivers.tables module

class senlin_dashboard.cluster.receivers.tables.CreateReceiver(*args, **kwargs)[source]

Bases: LinkAction

ajax = True
base_options = {'__classcell__': <cell at 0x7f750051e9e0: BaseActionMetaClass object>, '__doc__': 'A table action which is simply a link rather than a form POST.\n\n    .. attribute:: name\n\n        Required. The short name or "slug" representing this\n        action. This name should not be changed at runtime.\n\n    .. attribute:: verbose_name\n\n        A string which will be rendered as the link text. (Required)\n\n    .. attribute:: url\n\n        A string or a callable which resolves to a url to be used as the link\n        target. You must either define the ``url`` attribute or override\n        the ``get_link_url`` method on the class.\n\n    .. attribute:: allowed_data_types\n\n        A list that contains the allowed data types of the action.  If the\n        datum\'s type is in this list, the action will be shown on the row\n        for the datum.\n\n        Defaults to be an empty list (``[]``). When set to empty, the action\n        will accept any kind of data.\n    ', '__init__': <function LinkAction.__init__>, '__module__': 'senlin_dashboard.cluster.receivers.tables', '__qualname__': 'CreateReceiver', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BaseAction._allowed>, 'ajax': True, 'allowed': <function BaseAction.allowed>, 'associate_with_table': <function LinkAction.associate_with_table>, 'classes': ('ajax-modal', 'btn-create'), 'data_type_matched': <function BaseAction.data_type_matched>, 'get_ajax_update_url': <function LinkAction.get_ajax_update_url>, 'get_default_attrs': <function BaseAction.get_default_attrs>, 'get_default_classes': <function BaseAction.get_default_classes>, 'get_link_url': <function LinkAction.get_link_url>, 'get_policy_target': <function BaseAction.get_policy_target>, 'icon': 'plus', 'name': 'create', 'render': <function LinkAction.render>, 'update': <function BaseAction.update>, 'url': 'horizon:cluster:receivers:create', 'verbose_name': 'Create Receiver'}
classes = ('ajax-modal', 'btn-create')
icon = 'plus'
name = 'create'
url = 'horizon:cluster:receivers:create'
verbose_name = 'Create Receiver'
class senlin_dashboard.cluster.receivers.tables.DeleteReceiver(*args, **kwargs)[source]

Bases: DeleteAction

static action_past(count)[source]
static action_present(count)[source]
base_options = {'__classcell__': <cell at 0x7f750051edd0: BaseActionMetaClass object>, '__doc__': 'A table action used to perform delete operations on table data.\n\n    .. attribute:: name\n\n        A short name or "slug" representing this action.\n        Defaults to \'delete\'\n\n    .. method:: action_present\n\n       Method returning a present action name. This is used as an action label.\n\n       Method must accept an integer/long parameter and return the display\n       forms of the name properly pluralised (depending on the integer) and\n       translated in a string or tuple/list.\n\n       The returned display form is highly recommended to be a complete action\n       name with a form of a transitive verb and an object noun. Each word is\n       capitalized and the string should be marked as translatable.\n\n       If tuple or list - then setting self.current_present_action = n will\n       set the current active item from the list(action_present[n])\n\n    .. method:: action_past\n\n       Method returning a past action name. This is usually used to display\n       a message when the action is completed.\n\n       Method must accept an integer/long parameter and return the display\n       forms of the name properly pluralised (depending on the integer) and\n       translated in a string or tuple/list.\n\n       The detail is same as that of ``action_present``.\n\n    .. attribute:: success_url\n\n       Optional location to redirect after completion of the delete\n       action. Defaults to the current page.\n\n    .. attribute:: help_text\n\n       Optional message for providing an appropriate help text for\n       the horizon user.\n\n    ', '__init__': <function DeleteAction.__init__>, '__module__': 'senlin_dashboard.cluster.receivers.tables', '__qualname__': 'DeleteReceiver', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BatchAction._allowed>, '_get_action_name': <function BatchAction._get_action_name>, 'action': <function DeleteAction.action>, 'action_past': <staticmethod(<function DeleteReceiver.action_past>)>, 'action_present': <staticmethod(<function DeleteReceiver.action_present>)>, 'allowed': <function BaseAction.allowed>, 'associate_with_table': <function BaseAction.associate_with_table>, 'data_type_matched': <function BaseAction.data_type_matched>, 'default_message_level': 'success', 'delete': <function DeleteReceiver.delete>, 'get_default_attrs': <function BatchAction.get_default_attrs>, 'get_default_classes': <function BaseAction.get_default_classes>, 'get_param_name': <function Action.get_param_name>, 'get_policy_target': <function BaseAction.get_policy_target>, 'get_success_url': <function BatchAction.get_success_url>, 'handle': <function BatchAction.handle>, 'help_text': 'This action cannot be undone.', 'name': 'delete', 'update': <function BatchAction.update>}
delete(request, obj_id)[source]

Required. Deletes an object referenced by obj_id.

Override to provide delete functionality specific to your data.

class senlin_dashboard.cluster.receivers.tables.ReceiverFilterAction(*args, **kwargs)[source]

Bases: FilterAction

base_options = {'__classcell__': <cell at 0x7f750051eaa0: BaseActionMetaClass object>, '__doc__': 'A base class representing a filter action for a table.\n\n    .. attribute:: name\n\n        The short name or "slug" representing this action. Defaults to\n        ``"filter"``.\n\n    .. attribute:: verbose_name\n\n        A descriptive name used for display purposes. Defaults to the\n        value of ``name`` with the first letter of each word capitalized.\n\n    .. attribute:: param_name\n\n        A string representing the name of the request parameter used for the\n        search term. Default: ``"q"``.\n\n    .. attribute:: filter_type\n\n        A string representing the type of this filter. If this is set to\n        ``"server"`` then ``filter_choices`` must also be provided.\n        Default: ``"query"``.\n\n    .. attribute:: filter_choices\n\n        Required for server type filters. A tuple of tuples representing the\n        filter options. Tuple composition should evaluate to (string, string,\n        boolean, string, boolean), representing the following:\n\n        * The first value is the filter parameter.\n        * The second value represents display value.\n        * The third optional value indicates whether or not it should be\n          applied to the API request as an API query attribute. API type\n          filters do not need to be accounted for in the filter method since\n          the API will do the filtering. However, server type filters in\n          general will need to be performed in the filter method.\n          By default this attribute is not provided (``False``).\n        * The fourth optional value is used as help text if provided.\n          The default is ``None`` which means no help text.\n        * The fifth optional value determines whether or not the choice\n          is displayed to users. It defaults to ``True``. This is useful\n          when the choice needs to be displayed conditionally.\n\n    .. attribute:: needs_preloading\n\n        If True, the filter function will be called for the initial\n        GET request with an empty ``filter_string``, regardless of the\n        value of ``method``.\n\n    ', '__init__': <function FilterAction.__init__>, '__module__': 'senlin_dashboard.cluster.receivers.tables', '__qualname__': 'ReceiverFilterAction', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BaseAction._allowed>, 'allowed': <function BaseAction.allowed>, 'assign_type_string': <function FilterAction.assign_type_string>, 'associate_with_table': <function BaseAction.associate_with_table>, 'data_type_filter': <function FilterAction.data_type_filter>, 'data_type_matched': <function BaseAction.data_type_matched>, 'filter': <function FilterAction.filter>, 'filter_choices': (('name', 'Receiver Name =', True), ('type', 'Type =', True), ('action', 'Action =', True), ('cluster_id', 'Cluster ID =', True)), 'filter_type': 'server', 'get_default_attrs': <function BaseAction.get_default_attrs>, 'get_default_classes': <function BaseAction.get_default_classes>, 'get_param_name': <function FilterAction.get_param_name>, 'get_policy_target': <function BaseAction.get_policy_target>, 'get_select_options': <function FilterAction.get_select_options>, 'is_api_filter': <function FilterAction.is_api_filter>, 'name': 'filter', 'update': <function BaseAction.update>}
filter_choices = (('name', 'Receiver Name =', True), ('type', 'Type =', True), ('action', 'Action =', True), ('cluster_id', 'Cluster ID =', True))
filter_type = 'server'
class senlin_dashboard.cluster.receivers.tables.ReceiversTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]

Bases: DataTable

class Meta[source]

Bases: object

name = 'receivers'
row_actions = (<class 'senlin_dashboard.cluster.receivers.tables.DeleteReceiver'>,)
table_actions = (<class 'senlin_dashboard.cluster.receivers.tables.ReceiverFilterAction'>, <class 'senlin_dashboard.cluster.receivers.tables.CreateReceiver'>, <class 'senlin_dashboard.cluster.receivers.tables.DeleteReceiver'>)
verbose_name = 'Receivers'
base_actions = {'create': <CreateReceiver: create>, 'delete': <DeleteReceiver: delete>, 'filter': <ReceiverFilterAction: filter>}
base_columns = {'action': <Column: action>, 'cluster_id': <Column: cluster_id>, 'created': <Column: created>, 'name': <WrappingColumn: name>, 'type': <Column: type>, 'updated': <Column: updated>}
senlin_dashboard.cluster.receivers.tables.get_updated_time(object)[source]

senlin_dashboard.cluster.receivers.tabs module

class senlin_dashboard.cluster.receivers.tabs.OverviewTab(tab_group, request=None, policy_rules=None)[source]

Bases: Tab

get_context_data(request)[source]

Return a dictionary of context data used to render the tab.

Required.

name = 'Overview'
slug = 'overview'
template_name = 'cluster/receivers/_detail_overview.html'
class senlin_dashboard.cluster.receivers.tabs.ReceiverDetailTabs(request, **kwargs)[source]

Bases: TabGroup

slug = 'receiver_details'
tabs = (<class 'senlin_dashboard.cluster.receivers.tabs.OverviewTab'>,)

senlin_dashboard.cluster.receivers.tests module

class senlin_dashboard.cluster.receivers.tests.ReceiversTest(methodName='runTest')[source]

Bases: TestCase

test_create_receiver()[source]
test_index()[source]
test_index_no_receiver()[source]
test_index_receiver_list_exception()[source]

senlin_dashboard.cluster.receivers.urls module

senlin_dashboard.cluster.receivers.views module

class senlin_dashboard.cluster.receivers.views.CreateView(*args, **kwargs)[source]

Bases: ModalFormView

form_class

alias of CreateReceiverForm

modal_header = 'Create Receiver'
page_title = 'Create Receiver'
submit_label = 'Create Receiver'
submit_url = '/cluster/receivers/create/'
success_url = '/cluster/receivers/'
template_name = 'cluster/receivers/create.html'
text = 'Create Receiver'
class senlin_dashboard.cluster.receivers.views.DetailView[source]

Bases: TabView

cluster_url = 'horizon:cluster:clusters:detail'
get_context_data(**kwargs)[source]

Adds the tab_group variable to the context data.

get_object()[source]
get_tabs(request, *args, **kwargs)[source]

Returns the initialized tab group for this view.

page_title = '{{ receiver.name }}'
tab_group_class

alias of ReceiverDetailTabs

template_name = 'horizon/common/_detail.html'
class senlin_dashboard.cluster.receivers.views.IndexView(*args, **kwargs)[source]

Bases: DataTableView

get_data()[source]
has_more_data(table)[source]
has_prev_data(table)[source]
page_title = 'Receivers'
table_class

alias of ReceiversTable

template_name = 'cluster/receivers/index.html'

Module contents