Addition of PaaS
Change-Id: Ieb685b48aba87585f0d5b8bd962265cee5d486ea
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
diff --git a/osm_lcm/lcm_utils.py b/osm_lcm/lcm_utils.py
index 749f347..19852d0 100644
--- a/osm_lcm/lcm_utils.py
+++ b/osm_lcm/lcm_utils.py
@@ -379,9 +379,9 @@
- worker: the worker ID for this process
"""
- # NS/NSI: "services" VIM/WIM/SDN: "accounts"
+ # NS/NSI: "services" VIM/WIM/SDN/k8scluster/vca/PaaS/k8srepo: "accounts"
topic_service_list = ["ns", "nsi"]
- topic_account_list = ["vim", "wim", "sdn", "k8scluster", "vca", "k8srepo"]
+ topic_account_list = ["vim", "wim", "sdn", "k8scluster", "vca", "paas", "k8srepo"]
# Map topic to InstanceID
topic2instid_dict = {"ns": "nsInstanceId", "nsi": "netsliceInstanceId"}
@@ -395,6 +395,7 @@
"sdn": "sdns",
"k8scluster": "k8sclusters",
"vca": "vca",
+ "paas": "paas",
"k8srepo": "k8srepos",
}
@@ -407,6 +408,7 @@
"sdn": {},
"k8scluster": {},
"vca": {},
+ "paas": {},
"k8srepo": {},
}
self.worker_id = worker_id
@@ -416,7 +418,7 @@
def register(self, topic, _id, op_id, task_name, task):
"""
Register a new task
- :param topic: Can be "ns", "nsi", "vim_account", "sdn"
+ :param topic: Can be "ns", "nsi", "vim_account", "sdn", "paas"
: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
@@ -588,21 +590,21 @@
"""
Lock a task, if possible, to indicate to the HA system that
the task will be executed in this LCM instance.
- :param topic: Can be "ns", "nsi", "vim", "wim", or "sdn"
+ :param topic: Can be "ns", "nsi", "vim", "wim", "paas" or "sdn"
:param op_type: Operation type, can be "nslcmops", "nsilcmops", "create", "edit", "delete"
- :param op_id: NS, NSI: Operation ID VIM,WIM,SDN: Account ID + ':' + Operation Index
+ :param op_id: NS, NSI: Operation ID VIM,WIM,SDN,PaaS: Account ID + ':' + Operation Index
:return:
True=lock was successful => execute the task (not registered by any other LCM instance)
False=lock failed => do NOT execute the task (already registered by another LCM instance)
HA tasks and backward compatibility:
- If topic is "account type" (VIM/WIM/SDN) and op_id is None, 'op_id' was not provided by NBI.
+ If topic is "account type" (VIM/WIM/SDN/PaaS) and op_id is None, 'op_id' was not provided by NBI.
This means that the running NBI instance does not support HA.
In such a case this method should always return True, to always execute
the task in this instance of LCM, without querying the DB.
"""
- # Backward compatibility for VIM/WIM/SDN/k8scluster without op_id
+ # Backward compatibility for VIM/WIM/SDN/k8scluster/PaaS without op_id
if self._is_account_type_HA(topic) and op_id is None:
return True