add name for audit, update audit notifications

upgrade notifications

Change-Id: Ia8b7f36a8a2965bc8ec2243a10556592926297b2
Implements:blueprint add-name-for-audit
This commit is contained in:
suzhengwei 2017-06-23 10:48:24 +08:00
parent a3be1587e3
commit 907cc2df16
19 changed files with 48 additions and 17 deletions

View File

@ -23,6 +23,7 @@
"audit": {
"watcher_object.version": "1.0",
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"scope": [],
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",

View File

@ -8,6 +8,7 @@
"audit_uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"audit": {
"watcher_object.data": {
"name": "my_audit",
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"goal_uuid": "bc830f84-8ae3-4fc6-8bc6-e3dd15e8b49a",
"strategy_uuid": "75234dfe-87e3-4f11-a0e0-3c3305d86a39",

View File

@ -15,6 +15,7 @@
"watcher_object.data": {
"created_at": "2016-10-18T09:52:05Z",
"deleted_at": null,
"name": "my_audit",
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"goal_uuid": "bc830f84-8ae3-4fc6-8bc6-e3dd15e8b49a",
"strategy_uuid": "75234dfe-87e3-4f11-a0e0-3c3305d86a39",

View File

@ -45,6 +45,7 @@
"watcher_object.name": "TerseAuditPayload",
"watcher_object.data": {
"parameters": {},
"name": "my_audit",
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"goal_uuid": "bc830f84-8ae3-4fc6-8bc6-e3dd15e8b49a",
"strategy_uuid": "75234dfe-87e3-4f11-a0e0-3c3305d86a39",

View File

@ -15,6 +15,7 @@
"watcher_object.data": {
"created_at": "2016-10-18T09:52:05Z",
"deleted_at": null,
"name": "my_audit",
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"goal_uuid": "bc830f84-8ae3-4fc6-8bc6-e3dd15e8b49a",
"strategy_uuid": "75234dfe-87e3-4f11-a0e0-3c3305d86a39",

View File

@ -6,6 +6,7 @@
"audit": {
"watcher_object.version": "1.0",
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"scope": [],
"created_at": "2016-10-18T09:52:05Z",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "ERROR",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "ERROR",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -2,6 +2,7 @@
"priority": "INFO",
"payload": {
"watcher_object.data": {
"name": "my_audit",
"audit_type": "ONESHOT",
"parameters": {
"para2": "hello",

View File

@ -4,6 +4,7 @@
"payload": {
"watcher_object.name": "AuditUpdatePayload",
"watcher_object.data": {
"name": "my_audit",
"strategy_uuid": "75234dfe-87e3-4f11-a0e0-3c3305d86a39",
"strategy": {
"watcher_object.name": "StrategyPayload",

View File

@ -33,7 +33,7 @@ CONF = cfg.CONF
class TerseAuditPayload(notificationbase.NotificationPayloadBase):
SCHEMA = {
'uuid': ('audit', 'uuid'),
'name': ('audit', 'name'),
'audit_type': ('audit', 'audit_type'),
'state': ('audit', 'state'),
'parameters': ('audit', 'parameters'),
@ -51,10 +51,12 @@ class TerseAuditPayload(notificationbase.NotificationPayloadBase):
# Version 1.1: Added 'auto_trigger' boolean field,
# Added 'next_run_time' DateTime field,
# 'interval' type has been changed from Integer to String
VERSION = '1.1'
# Version 1.2: Added 'name' string field
VERSION = '1.2'
fields = {
'uuid': wfields.UUIDField(),
'name': wfields.StringField(),
'audit_type': wfields.StringField(),
'state': wfields.StringField(),
'parameters': wfields.FlexibleDictField(nullable=True),
@ -80,7 +82,7 @@ class TerseAuditPayload(notificationbase.NotificationPayloadBase):
class AuditPayload(TerseAuditPayload):
SCHEMA = {
'uuid': ('audit', 'uuid'),
'name': ('audit', 'name'),
'audit_type': ('audit', 'audit_type'),
'state': ('audit', 'state'),
'parameters': ('audit', 'parameters'),
@ -97,7 +99,8 @@ class AuditPayload(TerseAuditPayload):
# Version 1.0: Initial version
# Version 1.1: Added 'auto_trigger' field,
# Added 'next_run_time' field
VERSION = '1.1'
# Version 1.2: Added 'name' string field
VERSION = '1.2'
fields = {
'goal': wfields.ObjectField('GoalPayload'),

View File

@ -98,6 +98,7 @@ class TestActionPlanNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -110,7 +111,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "TerseAuditPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.1"
"watcher_object.version": "1.2"
},
"deleted_at": None,
"state": "ONGOING",
@ -174,6 +175,7 @@ class TestActionPlanNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -186,7 +188,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "TerseAuditPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.1"
"watcher_object.version": "1.2"
},
"deleted_at": None,
"state": "PENDING",
@ -242,6 +244,7 @@ class TestActionPlanNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -254,7 +257,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "TerseAuditPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.1"
"watcher_object.version": "1.2"
},
"deleted_at": None,
"state": "DELETED",
@ -293,13 +296,14 @@ class TestActionPlanNotification(base.DbTestCase):
"audit": {
"watcher_object.namespace": "watcher",
"watcher_object.name": "TerseAuditPayload",
"watcher_object.version": "1.1",
"watcher_object.version": "1.2",
"watcher_object.data": {
"interval": None,
"next_run_time": None,
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -385,6 +389,7 @@ class TestActionPlanNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -397,7 +402,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "TerseAuditPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.1"
"watcher_object.version": "1.2"
},
"global_efficacy": {},
"state": "ONGOING",
@ -454,13 +459,14 @@ class TestActionPlanNotification(base.DbTestCase):
"audit": {
"watcher_object.namespace": "watcher",
"watcher_object.name": "TerseAuditPayload",
"watcher_object.version": "1.1",
"watcher_object.version": "1.2",
"watcher_object.data": {
"interval": None,
"next_run_time": None,
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
'name': 'My Audit',
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -546,6 +552,7 @@ class TestActionPlanNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
'name': 'My Audit',
"strategy_uuid": None,
"goal_uuid": (
"f7ad87ae-4298-91cf-93a0-f35a852e3652"),
@ -558,7 +565,7 @@ class TestActionPlanNotification(base.DbTestCase):
},
"watcher_object.name": "TerseAuditPayload",
"watcher_object.namespace": "watcher",
"watcher_object.version": "1.1"
"watcher_object.version": "1.2"
},
"global_efficacy": {},
"state": "ONGOING",

View File

@ -91,6 +91,7 @@ class TestAuditNotification(base.DbTestCase):
},
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"goal_uuid": "f7ad87ae-4298-91cf-93a0-f35a852e3652",
"goal": {
"watcher_object.namespace": "watcher",
@ -150,6 +151,7 @@ class TestAuditNotification(base.DbTestCase):
"auto_trigger": False,
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"goal_uuid": "f7ad87ae-4298-91cf-93a0-f35a852e3652",
"goal": {
"watcher_object.namespace": "watcher",
@ -226,6 +228,7 @@ class TestAuditNotification(base.DbTestCase):
},
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"goal_uuid": "f7ad87ae-4298-91cf-93a0-f35a852e3652",
"goal": {
"watcher_object.namespace": "watcher",
@ -291,6 +294,7 @@ class TestAuditNotification(base.DbTestCase):
},
"parameters": {},
"uuid": "10a47dd1-4874-4298-91cf-eff046dbdb8d",
"name": "My Audit",
"goal_uuid": "f7ad87ae-4298-91cf-93a0-f35a852e3652",
"goal": {
"watcher_object.namespace": "watcher",
@ -360,6 +364,7 @@ class TestAuditNotification(base.DbTestCase):
"interval": None,
"next_run_time": None,
"auto_trigger": False,
"name": "My Audit",
"parameters": {},
"scope": [],
"state": "ONGOING",
@ -446,6 +451,7 @@ class TestAuditNotification(base.DbTestCase):
"interval": None,
"next_run_time": None,
"auto_trigger": False,
"name": "My Audit",
"parameters": {},
"scope": [],
"state": "ONGOING",

View File

@ -254,17 +254,17 @@ expected_notification_fingerprints = {
'ExceptionNotification': '1.0-9b69de0724fda8310d05e18418178866',
'ExceptionPayload': '1.0-4516ae282a55fe2fd5c754967ee6248b',
'NotificationPublisher': '1.0-bbbc1402fb0e443a3eb227cc52b61545',
'TerseAuditPayload': '1.1-19b0e9224c0953366418a30ed785f267',
'AuditPayload': '1.1-4c59e0cc5d30c42d3b842ce0332709d5',
'TerseAuditPayload': '1.2-0fda1751c39f29b539944c2b44690f65',
'AuditPayload': '1.2-d30cc1639404ed380b0742b781db690e',
'AuditStateUpdatePayload': '1.0-1a1b606bf14a2c468800c2b010801ce5',
'AuditUpdateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'AuditUpdatePayload': '1.1-9b1f725e736051b976571701e5cc1e55',
'AuditUpdatePayload': '1.1-e32c3f69c353d47948afa44359246828',
'AuditCreateNotification': '1.0-9b69de0724fda8310d05e18418178866',
'AuditCreatePayload': '1.1-4c59e0cc5d30c42d3b842ce0332709d5',
'AuditCreatePayload': '1.1-d30cc1639404ed380b0742b781db690e',
'AuditDeleteNotification': '1.0-9b69de0724fda8310d05e18418178866',
'AuditDeletePayload': '1.1-4c59e0cc5d30c42d3b842ce0332709d5',
'AuditDeletePayload': '1.1-d30cc1639404ed380b0742b781db690e',
'AuditActionNotification': '1.0-9b69de0724fda8310d05e18418178866',
'AuditActionPayload': '1.1-5a43e7321495c19f98ef5663efa0a821',
'AuditActionPayload': '1.1-3d19c75dd9cdf2a833d0367b234e20d2',
'GoalPayload': '1.0-fa1fecb8b01dd047eef808ded4d50d1a',
'StrategyPayload': '1.0-94f01c137b083ac236ae82573c1fcfc1',
'ActionPlanActionPayload': '1.0-d9f134708e06cf2ff2d3b8d522ac2aa8',