senlin_dashboard.cluster.nodes package¶
Submodules¶
senlin_dashboard.cluster.nodes.event_tables module¶
- class senlin_dashboard.cluster.nodes.event_tables.EventsTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]¶
Bases:
DataTable
- STATUS_CHOICES = (('INIT', None), ('ACTIVE', True), ('ERROR', False), ('DELETED', False), ('WARNING', None), ('CREATING', None), ('UPDATING', None), ('DELETING', None))¶
- STATUS_DISPLAY_CHOICES = (('INIT', 'INIT'), ('ACTIVE', 'ACTIVE'), ('ERROR', 'ERROR'), ('DELETED', 'DELETED'), ('WARNING', 'WARNING'), ('CREATING', 'CREATING'), ('UPDATING', 'UPDATING'), ('DELETING', 'DELETING'))¶
- base_actions = {}¶
- base_columns = {'action': <Column: action>, 'generated_at': <Column: generated_at>, 'obj_id': <Column: obj_id>, 'obj_name': <Column: obj_name>, 'status': <Column: status>, 'status_reason': <Column: status_reason>}¶
senlin_dashboard.cluster.nodes.forms module¶
- class senlin_dashboard.cluster.nodes.forms.CreateForm(request, *args, **kwargs)[source]¶
Bases:
SelfHandlingForm
- base_fields = {'cluster_id': <horizon.forms.fields.ThemableChoiceField object>, 'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'profile_id': <horizon.forms.fields.ThemableChoiceField object>, 'role': <django.forms.fields.CharField object>}¶
- declared_fields = {'cluster_id': <horizon.forms.fields.ThemableChoiceField object>, 'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'profile_id': <horizon.forms.fields.ThemableChoiceField object>, 'role': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
- class senlin_dashboard.cluster.nodes.forms.UpdateNodeForm(request, *args, **kwargs)[source]¶
Bases:
SelfHandlingForm
- base_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'node_id': <django.forms.fields.CharField object>, 'profile_id': <horizon.forms.fields.ThemableChoiceField object>, 'role': <django.forms.fields.CharField object>}¶
- declared_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'node_id': <django.forms.fields.CharField object>, 'profile_id': <horizon.forms.fields.ThemableChoiceField object>, 'role': <django.forms.fields.CharField object>}¶
- property media¶
Return all media required to render the widgets on this form.
senlin_dashboard.cluster.nodes.panel module¶
senlin_dashboard.cluster.nodes.tables module¶
- class senlin_dashboard.cluster.nodes.tables.CheckNode(*args, **kwargs)[source]¶
Bases:
BatchAction
- action(request, obj_id)[source]¶
Accepts a single object id and performs the specific action.
This method is required.
Return values are discarded, errors raised are caught and logged.
- base_options = {'__classcell__': <cell at 0x7f750051ec80: BaseActionMetaClass object>, '__doc__': 'A table action which takes batch action on one or more objects.\n\n This action should not require user input on a per-object basis.\n\n .. attribute:: name\n\n A short name or "slug" representing this action.\n Should be one word such as "delete", "add", "disable", etc.\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 BatchAction.__init__>, '__module__': 'senlin_dashboard.cluster.nodes.tables', '__qualname__': 'CheckNode', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BatchAction._allowed>, '_get_action_name': <function BatchAction._get_action_name>, 'action': <function CheckNode.action>, 'action_past': <staticmethod(<function CheckNode.action_past>)>, 'action_present': <staticmethod(<function CheckNode.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', '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': 'check', 'update': <function BatchAction.update>}¶
- name = 'check'¶
- class senlin_dashboard.cluster.nodes.tables.CreateNode(*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.nodes.tables', '__qualname__': 'CreateNode', '__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:nodes:create', 'verbose_name': 'Create Node'}¶
- classes = ('ajax-modal', 'btn-create')¶
- icon = 'plus'¶
- name = 'create'¶
- url = 'horizon:cluster:nodes:create'¶
- verbose_name = 'Create Node'¶
- class senlin_dashboard.cluster.nodes.tables.DeleteNode(*args, **kwargs)[source]¶
Bases:
DeleteAction
- allowed(request, datum)[source]¶
Determine whether this action is allowed for the current request.
This method is meant to be overridden with more specific checks.
- 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.nodes.tables', '__qualname__': 'DeleteNode', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BatchAction._allowed>, '_get_action_name': <function BatchAction._get_action_name>, 'action': <function DeleteAction.action>, 'action_past': <staticmethod(<function DeleteNode.action_past>)>, 'action_present': <staticmethod(<function DeleteNode.action_present>)>, 'allowed': <function DeleteNode.allowed>, 'associate_with_table': <function BaseAction.associate_with_table>, 'data_type_matched': <function BaseAction.data_type_matched>, 'default_message_level': 'success', 'delete': <function DeleteNode.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>}¶
- class senlin_dashboard.cluster.nodes.tables.NodeFilterAction(*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.nodes.tables', '__qualname__': 'NodeFilterAction', '__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', 'Node Name =', True), ('status', 'Status =', True), ('profile_name', 'Profile Name =', 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', 'Node Name =', True), ('status', 'Status =', True), ('profile_name', 'Profile Name =', True), ('cluster_id', 'Cluster ID =', True))¶
- filter_type = 'server'¶
- class senlin_dashboard.cluster.nodes.tables.NodesTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]¶
Bases:
DataTable
- class Meta[source]¶
Bases:
object
- name = 'nodes'¶
- row_actions = (<class 'senlin_dashboard.cluster.nodes.tables.UpdateNode'>, <class 'senlin_dashboard.cluster.nodes.tables.CheckNode'>, <class 'senlin_dashboard.cluster.nodes.tables.RecoverNode'>, <class 'senlin_dashboard.cluster.nodes.tables.DeleteNode'>)¶
- status_columns = ['status']¶
- table_actions = (<class 'senlin_dashboard.cluster.nodes.tables.NodeFilterAction'>, <class 'senlin_dashboard.cluster.nodes.tables.CreateNode'>, <class 'senlin_dashboard.cluster.nodes.tables.DeleteNode'>)¶
- verbose_name = 'Nodes'¶
- STATUS_CHOICES = (('INIT', None), ('ACTIVE', True), ('ERROR', False), ('WARNING', None), ('CREATING', None), ('UPDATING', None), ('DELETING', None), ('RECOVERING', None))¶
- STATUS_DISPLAY_CHOICES = (('INIT', 'INIT'), ('ACTIVE', 'ACTIVE'), ('ERROR', 'ERROR'), ('WARNING', 'WARNING'), ('CREATING', 'CREATING'), ('UPDATING', 'UPDATING'), ('DELETING', 'DELETING'), ('RECOVERING', 'RECOVERING'))¶
- base_actions = {'check': <CheckNode: check>, 'create': <CreateNode: create>, 'delete': <DeleteNode: delete>, 'filter': <NodeFilterAction: filter>, 'recover': <RecoverNode: recover>, 'update': <UpdateNode: update>}¶
- base_columns = {'cluster_id': <Column: cluster_id>, 'created': <Column: created>, 'name': <WrappingColumn: name>, 'physical_id': <Column: physical_id>, 'profile_name': <Column: profile_name>, 'role': <Column: role>, 'status': <Column: status>, 'status_reason': <Column: status_reason>, 'updated': <Column: updated>}¶
- class senlin_dashboard.cluster.nodes.tables.RecoverNode(*args, **kwargs)[source]¶
Bases:
BatchAction
- action(request, obj_id)[source]¶
Accepts a single object id and performs the specific action.
This method is required.
Return values are discarded, errors raised are caught and logged.
- allowed(request, datum)[source]¶
Determine whether this action is allowed for the current request.
This method is meant to be overridden with more specific checks.
- base_options = {'__classcell__': <cell at 0x7f750051ec80: BaseActionMetaClass object>, '__doc__': 'A table action which takes batch action on one or more objects.\n\n This action should not require user input on a per-object basis.\n\n .. attribute:: name\n\n A short name or "slug" representing this action.\n Should be one word such as "delete", "add", "disable", etc.\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 BatchAction.__init__>, '__module__': 'senlin_dashboard.cluster.nodes.tables', '__qualname__': 'RecoverNode', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BatchAction._allowed>, '_get_action_name': <function BatchAction._get_action_name>, 'action': <function RecoverNode.action>, 'action_past': <staticmethod(<function RecoverNode.action_past>)>, 'action_present': <staticmethod(<function RecoverNode.action_present>)>, 'allowed': <function RecoverNode.allowed>, 'associate_with_table': <function BaseAction.associate_with_table>, 'data_type_matched': <function BaseAction.data_type_matched>, 'default_message_level': 'success', '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': 'recover', 'update': <function BatchAction.update>}¶
- name = 'recover'¶
- class senlin_dashboard.cluster.nodes.tables.UpdateNode(*args, **kwargs)[source]¶
Bases:
LinkAction
- 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.nodes.tables', '__qualname__': 'UpdateNode', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BaseAction._allowed>, 'ajax': False, 'allowed': <function BaseAction.allowed>, 'associate_with_table': <function LinkAction.associate_with_table>, 'classes': ('ajax-modal',), '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': 'pencil', 'name': 'update', 'render': <function LinkAction.render>, 'update': <function BaseAction.update>, 'url': 'horizon:cluster:nodes:update', 'verbose_name': 'Update Node'}¶
- classes = ('ajax-modal',)¶
- icon = 'pencil'¶
- name = 'update'¶
- url = 'horizon:cluster:nodes:update'¶
- verbose_name = 'Update Node'¶
senlin_dashboard.cluster.nodes.tabs module¶
- class senlin_dashboard.cluster.nodes.tabs.EventTab(tab_group, request)[source]¶
Bases:
TableTab
- name = 'Event'¶
- preload = False¶
- slug = 'event'¶
- table_classes = (<class 'senlin_dashboard.cluster.nodes.event_tables.EventsTable'>,)¶
- template_name = 'cluster/nodes/_detail_event.html'¶
- class senlin_dashboard.cluster.nodes.tabs.NodeDetailTabs(request, **kwargs)[source]¶
Bases:
TabGroup
- slug = 'node_details'¶
- sticky = True¶
- tabs = (<class 'senlin_dashboard.cluster.nodes.tabs.OverviewTab'>, <class 'senlin_dashboard.cluster.nodes.tabs.EventTab'>)¶
- class senlin_dashboard.cluster.nodes.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/nodes/_detail_overview.html'¶
senlin_dashboard.cluster.nodes.tests module¶
senlin_dashboard.cluster.nodes.urls module¶
senlin_dashboard.cluster.nodes.views module¶
- class senlin_dashboard.cluster.nodes.views.CreateView(*args, **kwargs)[source]¶
Bases:
ModalFormView
- form_class¶
alias of
CreateForm
- modal_header = 'Create Node'¶
- page_title = 'Create Node'¶
- submit_label = 'Create Node'¶
- submit_url = '/cluster/nodes/create/'¶
- success_url = '/cluster/nodes/'¶
- template_name = 'cluster/nodes/create.html'¶
- text = 'Create Node'¶
- class senlin_dashboard.cluster.nodes.views.DetailView[source]¶
Bases:
TabView
- cluster_url = 'horizon:cluster:clusters:detail'¶
- page_title = '{{ node.name }}'¶
- profile_url = 'horizon:cluster:profiles:detail'¶
- tab_group_class¶
alias of
NodeDetailTabs
- template_name = 'horizon/common/_detail.html'¶
- class senlin_dashboard.cluster.nodes.views.IndexView(*args, **kwargs)[source]¶
Bases:
DataTableView
- page_title = 'Nodes'¶
- table_class¶
alias of
NodesTable
- template_name = 'cluster/nodes/index.html'¶
- class senlin_dashboard.cluster.nodes.views.UpdateView(*args, **kwargs)[source]¶
Bases:
ModalFormView
- form_class¶
alias of
UpdateNodeForm
- modal_header = 'Update Node'¶
- page_title = 'Update Node'¶
- submit_label = 'Update Node'¶
- submit_url¶
- success_url = '/cluster/nodes/'¶
- template_name = 'cluster/nodes/update.html'¶
- text = 'Update Node'¶