senlin_dashboard.cluster.profiles package

Submodules

senlin_dashboard.cluster.profiles.forms module

Views for managing profiles.

class senlin_dashboard.cluster.profiles.forms.CreateProfileForm(request, *args, **kwargs)[source]

Bases: SelfHandlingForm

base_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'source_type': <horizon.forms.fields.ThemableChoiceField object>, 'spec_file': <django.forms.fields.FileField object>, 'spec_yaml': <django.forms.fields.CharField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'source_type': <horizon.forms.fields.ThemableChoiceField object>, 'spec_file': <django.forms.fields.FileField object>, 'spec_yaml': <django.forms.fields.CharField object>}
handle(request, data)[source]
property media

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

class senlin_dashboard.cluster.profiles.forms.UpdateProfileForm(request, *args, **kwargs)[source]

Bases: SelfHandlingForm

base_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'profile_id': <django.forms.fields.CharField object>, 'spec': <django.forms.fields.CharField object>}
declared_fields = {'metadata': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'profile_id': <django.forms.fields.CharField object>, 'spec': <django.forms.fields.CharField object>}
handle(request, data)[source]
property media

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

senlin_dashboard.cluster.profiles.panel module

class senlin_dashboard.cluster.profiles.panel.Profiles[source]

Bases: Panel

name = 'Profiles'
slug = 'profiles'

senlin_dashboard.cluster.profiles.tables module

class senlin_dashboard.cluster.profiles.tables.CreateProfile(*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.profiles.tables', '__qualname__': 'CreateProfile', '__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': 'plus', 'name': 'create', 'render': <function LinkAction.render>, 'update': <function BaseAction.update>, 'url': 'horizon:cluster:profiles:create', 'verbose_name': 'Create Profile'}
classes = ('ajax-modal',)
icon = 'plus'
name = 'create'
url = 'horizon:cluster:profiles:create'
verbose_name = 'Create Profile'
class senlin_dashboard.cluster.profiles.tables.DeleteProfile(*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.profiles.tables', '__qualname__': 'DeleteProfile', '__repr__': <function BaseAction.__repr__>, '_allowed': <function BatchAction._allowed>, '_get_action_name': <function BatchAction._get_action_name>, 'action': <function DeleteAction.action>, 'action_past': <staticmethod(<function DeleteProfile.action_past>)>, 'action_present': <staticmethod(<function DeleteProfile.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 DeleteProfile.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.profiles.tables.ProfileFilterAction(*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.profiles.tables', '__qualname__': 'ProfileFilterAction', '__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', 'Profile Name =', 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', 'Profile Name =', True),)
filter_type = 'server'
class senlin_dashboard.cluster.profiles.tables.ProfilesTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]

Bases: DataTable

class Meta[source]

Bases: object

name = 'profiles'
row_actions = (<class 'senlin_dashboard.cluster.profiles.tables.UpdateProfile'>, <class 'senlin_dashboard.cluster.profiles.tables.DeleteProfile'>)
table_actions = (<class 'senlin_dashboard.cluster.profiles.tables.ProfileFilterAction'>, <class 'senlin_dashboard.cluster.profiles.tables.CreateProfile'>, <class 'senlin_dashboard.cluster.profiles.tables.DeleteProfile'>)
verbose_name = 'Profiles'
base_actions = {'create': <CreateProfile: create>, 'delete': <DeleteProfile: delete>, 'filter': <ProfileFilterAction: filter>, 'update': <UpdateProfile: update>}
base_columns = {'created': <Column: created>, 'name': <WrappingColumn: name>, 'type': <Column: type>, 'updated': <Column: updated>}
class senlin_dashboard.cluster.profiles.tables.UpdateProfile(*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.profiles.tables', '__qualname__': 'UpdateProfile', '__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:profiles:update', 'verbose_name': 'Update Profile'}
classes = ('ajax-modal',)
icon = 'pencil'
name = 'update'
url = 'horizon:cluster:profiles:update'
verbose_name = 'Update Profile'
senlin_dashboard.cluster.profiles.tables.get_profile_name(profile)[source]
senlin_dashboard.cluster.profiles.tables.get_updated_time(object)[source]

senlin_dashboard.cluster.profiles.tabs module

class senlin_dashboard.cluster.profiles.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/profiles/_detail_overview.html'
class senlin_dashboard.cluster.profiles.tabs.ProfileDetailTabs(request, **kwargs)[source]

Bases: TabGroup

slug = 'profile_details'
tabs = (<class 'senlin_dashboard.cluster.profiles.tabs.OverviewTab'>,)

senlin_dashboard.cluster.profiles.tests module

class senlin_dashboard.cluster.profiles.tests.ProfilesTest(methodName='runTest')[source]

Bases: TestCase

test_create_profile()[source]
test_index()[source]
test_index_no_policy()[source]
test_index_profile_list_exception()[source]
test_profile_detail()[source]

senlin_dashboard.cluster.profiles.urls module

senlin_dashboard.cluster.profiles.views module

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

Bases: ModalFormView

form_class

alias of CreateProfileForm

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

Bases: TabView

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 = '{{ profile.name }}'
tab_group_class

alias of ProfileDetailTabs

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

Bases: DataTableView

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

alias of ProfilesTable

template_name = 'cluster/profiles/index.html'
class senlin_dashboard.cluster.profiles.views.UpdateView(*args, **kwargs)[source]

Bases: ModalFormView

form_class

alias of UpdateProfileForm

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_initial()[source]

Return the initial data to use for forms on this view.

get_object()[source]
modal_header = 'Update Profile'
page_title = 'Update Profile'
submit_label = 'Update Profile'
submit_url
success_url = '/cluster/profiles/'
template_name = 'cluster/profiles/update.html'
text = 'Update Profile'

Module contents