Merge "Add name for audit"
This commit is contained in:
commit
79fcf55752
|
@ -55,7 +55,7 @@ def insert_watcher_policy_file():
|
||||||
|
|
||||||
|
|
||||||
class Audit(base.APIDictWrapper):
|
class Audit(base.APIDictWrapper):
|
||||||
_attrs = ('uuid', 'created_at', 'modified_at', 'deleted_at',
|
_attrs = ('uuid', 'name', 'created_at', 'modified_at', 'deleted_at',
|
||||||
'state', 'audit_type', 'audit_template_uuid',
|
'state', 'audit_type', 'audit_template_uuid',
|
||||||
'audit_template_name', 'interval')
|
'audit_template_name', 'interval')
|
||||||
|
|
||||||
|
@ -81,6 +81,9 @@ class Audit(base.APIDictWrapper):
|
||||||
:param interval: Audit interval (default: None)
|
:param interval: Audit interval (default: None)
|
||||||
:type interval: int
|
:type interval: int
|
||||||
|
|
||||||
|
:param name: Name for this audit
|
||||||
|
:type name: string
|
||||||
|
|
||||||
:return: the created Audit object
|
:return: the created Audit object
|
||||||
:rtype: :py:class:`~.Audit`
|
:rtype: :py:class:`~.Audit`
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -35,6 +35,10 @@ class CreateForm(forms.SelfHandlingForm):
|
||||||
audit_template = forms.DynamicChoiceField(
|
audit_template = forms.DynamicChoiceField(
|
||||||
label=_("Audit Template"),
|
label=_("Audit Template"),
|
||||||
add_item_link=ADD_AUDIT_TEMPLATES_URL)
|
add_item_link=ADD_AUDIT_TEMPLATES_URL)
|
||||||
|
audit_name = forms.CharField(max_length=255, label=_("Name"),
|
||||||
|
help_text=_("An audit name should not "
|
||||||
|
"duplicate with existed audits' names."),
|
||||||
|
required=False)
|
||||||
audit_type = forms.ChoiceField(label=_("Audit Type"),
|
audit_type = forms.ChoiceField(label=_("Audit Type"),
|
||||||
choices=[(None, _("Select Audit Type")),
|
choices=[(None, _("Select Audit Type")),
|
||||||
('oneshot', _('ONESHOT')),
|
('oneshot', _('ONESHOT')),
|
||||||
|
@ -86,6 +90,7 @@ class CreateForm(forms.SelfHandlingForm):
|
||||||
params = {'audit_template_uuid': data.get('audit_template')}
|
params = {'audit_template_uuid': data.get('audit_template')}
|
||||||
params['audit_type'] = data['audit_type'].upper()
|
params['audit_type'] = data['audit_type'].upper()
|
||||||
params['auto_trigger'] = data['auto_trigger']
|
params['auto_trigger'] = data['auto_trigger']
|
||||||
|
params['name'] = data['audit_name']
|
||||||
if data['audit_type'] == 'continuous':
|
if data['audit_type'] == 'continuous':
|
||||||
params['interval'] = data['interval']
|
params['interval'] = data['interval']
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -104,10 +104,14 @@ class ArchiveAudits(horizon.tables.DeleteAction):
|
||||||
|
|
||||||
|
|
||||||
class AuditsTable(horizon.tables.DataTable):
|
class AuditsTable(horizon.tables.DataTable):
|
||||||
name = horizon.tables.Column(
|
uuid = horizon.tables.Column(
|
||||||
'uuid',
|
'uuid',
|
||||||
verbose_name=_("UUID"),
|
verbose_name=_("UUID"),
|
||||||
link="horizon:admin:audits:detail")
|
link="horizon:admin:audits:detail")
|
||||||
|
name = horizon.tables.Column(
|
||||||
|
'name',
|
||||||
|
verbose_name=_("Name"),
|
||||||
|
link="horizon:admin:audits:detail")
|
||||||
goal = horizon.tables.Column(
|
goal = horizon.tables.Column(
|
||||||
'goal_name',
|
'goal_name',
|
||||||
verbose_name=_('Goal'))
|
verbose_name=_('Goal'))
|
||||||
|
|
Loading…
Reference in New Issue