5f1e48ff46
This patch adds below functionality: - New policy action ``vdu_autoheal`` for recovering failed VDUs as reported by the respective monitoring driver configured in the monitoring policy of the VNFD template. - Add unit/functional tests. - Added oslo_versioned library to implement HealVnfRequest object. Note: The implementation of vdu_autoheal policy action will support HealVnfRequest interface as mentioned in the ETSI standard [1] [1]: https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/003/02.05.01_60/gs_NFV-SOL003v020501p.pdf Implements: blueprint vdu-auto-healing Change-Id: If62acbdac41c92842de0ae3b7dedcda9fd1f86e6
35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# Copyright 2018, OpenStack Foundation.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
# Borrowed from nova code base, more utilities will be added/borrowed as and
|
|
# when needed.
|
|
|
|
"""Utilities and helper functions."""
|
|
|
|
from oslo_utils import timeutils
|
|
|
|
from tacker.db.common_services import common_services_db_plugin
|
|
from tacker.plugins.common import constants
|
|
|
|
|
|
def log_events(context, vnf_dict, evt_type, evt_details):
|
|
_cos_db_plg = common_services_db_plugin.CommonServicesPluginDb()
|
|
_cos_db_plg.create_event(context, res_id=vnf_dict['id'],
|
|
res_type=constants.RES_TYPE_VNF,
|
|
res_state=vnf_dict['status'],
|
|
evt_type=evt_type,
|
|
tstamp=timeutils.utcnow(),
|
|
details=evt_details)
|