Logs events for VNF scale operations

Change-Id: Id9ab6408c1b8b49370dfbd6aa56555762f9afdc4
Implements: blueprint: audit-support
This commit is contained in:
vish 2016-08-31 21:22:20 +00:00 committed by vishwanath jayaraman
parent 80b638fcac
commit 8e21d60862
2 changed files with 9 additions and 1 deletions

View File

@ -475,7 +475,14 @@ class VNFMPluginDb(vnfm.VNFMPluginBase, db_base.CommonDbMixin):
context, policy['vnf']['id'], previous_statuses, status)
if mgmt_url:
vnf_db.update({'mgmt_url': mgmt_url})
return self._make_vnf_dict(vnf_db)
updated_vnf_dict = self._make_vnf_dict(vnf_db)
self._cos_db_plg.create_event(
context, res_id=updated_vnf_dict['id'],
res_type=constants.RES_TYPE_VNF,
res_state=updated_vnf_dict['status'],
evt_type=constants.RES_EVT_SCALE,
tstamp=timeutils.utcnow())
return updated_vnf_dict
def _update_vnf_pre(self, context, vnf_id):
with context.session.begin(subtransactions=True):

View File

@ -61,6 +61,7 @@ RES_EVT_CREATE = "CREATE"
RES_EVT_DELETE = "DELETE"
RES_EVT_UPDATE = "UPDATE"
RES_EVT_MONITOR = "MONITOR"
RES_EVT_SCALE = "SCALE"
RES_EVT_VNFD_NA_STATE = "Not Applicable"
RES_EVT_CREATED_FLD = "created_at"