X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rwlaunchpad%2Fplugins%2Fvala%2Frwos_ma_nfvo%2Frwos_ma_nfvo_rest%2Frwos_ma_nfvo_rest.py;fp=rwlaunchpad%2Fplugins%2Fvala%2Frwos_ma_nfvo%2Frwos_ma_nfvo_rest%2Frwos_ma_nfvo_rest.py;h=3ac942913eeebe0e6031e75b9748f7bcf05a67fd;hb=6f07e6f33f751ab4ffe624f6037f887b243bece2;hp=0000000000000000000000000000000000000000;hpb=72a563886272088feb7cb52e4aafbe6d2c580ff9;p=osm%2FSO.git diff --git a/rwlaunchpad/plugins/vala/rwos_ma_nfvo/rwos_ma_nfvo_rest/rwos_ma_nfvo_rest.py b/rwlaunchpad/plugins/vala/rwos_ma_nfvo/rwos_ma_nfvo_rest/rwos_ma_nfvo_rest.py new file mode 100644 index 00000000..3ac94291 --- /dev/null +++ b/rwlaunchpad/plugins/vala/rwos_ma_nfvo/rwos_ma_nfvo_rest/rwos_ma_nfvo_rest.py @@ -0,0 +1,51 @@ + +# +# Copyright 2016 RIFT.IO Inc +# +# 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. +# + +import re +import logging +import rw_status +import rwlogger +import subprocess, os + +import gi +gi.require_version('RwOsMaNfvo', '1.0') +gi.require_version('RwTypes', '1.0') +from gi.repository import ( + GObject, + RwOsMaNfvo, + RwTypes) + +logger = logging.getLogger('rwos-ma-nfvo-rest') + + +rwstatus = rw_status.rwstatus_from_exc_map({ IndexError: RwTypes.RwStatus.NOTFOUND, + KeyError: RwTypes.RwStatus.NOTFOUND, + NotImplementedError: RwTypes.RwStatus.NOT_IMPLEMENTED,}) + +class RwOsMaNfvoRestPlugin(GObject.Object, RwOsMaNfvo.Orchestrator): + """This class implements the Ve-Vnfm VALA methods.""" + + def __init__(self): + GObject.Object.__init__(self) + + + @rwstatus + def do_init(self, rwlog_ctx): + if not any(isinstance(h, rwlogger.RwLogger) for h in logger.handlers): + logger.addHandler(rwlogger.RwLogger(subcategory="rwos-ma-nfvo-rest", + log_hdl=rwlog_ctx,)) +