X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Flcm_utils.py;h=2989bf412579db05088ad6cf4ab79a23930896af;hb=refs%2Fchanges%2F53%2F7053%2F5;hp=cb741181991c095078b5b1df416f0c4f8ec912ab;hpb=f578e55acd56e8bb15bda3604f9192280988105c;p=osm%2FLCM.git diff --git a/osm_lcm/lcm_utils.py b/osm_lcm/lcm_utils.py index cb74118..2989bf4 100644 --- a/osm_lcm/lcm_utils.py +++ b/osm_lcm/lcm_utils.py @@ -1,6 +1,20 @@ -#!/usr/bin/python3 # -*- coding: utf-8 -*- +## +# Copyright 2018 Telefonica S.A. +# +# 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. +## from collections import OrderedDict from osm_common.dbbase import DbException @@ -40,14 +54,16 @@ class TaskRegistry: def __init__(self): self.task_registry = { "ns": {}, + "nsi": {}, "vim_account": {}, + "wim_account": {}, "sdn": {}, } def register(self, topic, _id, op_id, task_name, task): """ Register a new task - :param topic: Can be "ns", "vim_account", "sdn" + :param topic: Can be "ns", "nsi", "vim_account", "sdn" :param _id: _id of the related item :param op_id: id of the operation of the related item :param task_name: Task descriptive name, as create, instantiate, terminate. Must be unique in this op_id @@ -65,7 +81,7 @@ class TaskRegistry: def remove(self, topic, _id, op_id, task_name=None): """ When task is ended, it should removed. It ignores missing tasks - :param topic: Can be "ns", "vim_account", "sdn" + :param topic: Can be "ns", "nsi", "vim_account", "sdn" :param _id: _id of the related item :param op_id: id of the operation of the related item :param task_name: Task descriptive name. If note it deletes all @@ -103,8 +119,8 @@ class TaskRegistry: def cancel(self, topic, _id, target_op_id=None, target_task_name=None): """ - Cancel all active tasks of a concrete ns, vim_account, sdn identified for _id. If op_id is supplied only this is - cancelled, and the same with task_name + Cancel all active tasks of a concrete ns, nsi, vim_account, sdn identified for _id. If op_id is supplied only + this is cancelled, and the same with task_name """ if not self.task_registry[topic].get(_id): return