Feature 11073: Enhanced OSM declarative modelling for applications. App as first class citizen
Change-Id: I6b750f4d862692ab885e98afe3771ba817dd6535
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/odu_workflows.py b/osm_lcm/odu_workflows.py
index e352883..0c51b2d 100644
--- a/osm_lcm/odu_workflows.py
+++ b/osm_lcm/odu_workflows.py
@@ -21,6 +21,7 @@
vim_mgmt as odu_vim_mgmt,
cluster_mgmt as odu_cluster_mgmt,
nodegroup as odu_nodegroup,
+ app as odu_app,
ksu as odu_ksu,
oka as odu_oka,
profiles as odu_profiles,
@@ -127,6 +128,18 @@
"move_ksu": {
"workflow_function": self.move_ksu,
},
+ "create_app": {
+ "workflow_function": self.create_app,
+ "clean_function": self.clean_items_app_launch,
+ },
+ "update_app": {
+ "workflow_function": self.update_app,
+ "clean_function": self.clean_items_app_launch,
+ },
+ "delete_app": {
+ "workflow_function": self.delete_app,
+ "clean_function": self.clean_items_app_launch,
+ },
"create_cloud_credentials": {
"workflow_function": self.create_cloud_credentials,
"clean_function": self.clean_items_cloud_credentials_create,
@@ -211,19 +224,28 @@
delete_secret = odu_common.delete_secret
create_configmap = odu_common.create_configmap
delete_configmap = odu_common.delete_configmap
+ create_app = odu_app.create_app
+ update_app = odu_app.update_app
+ delete_app = odu_app.delete_app
+ launch_app = odu_app.launch_app
+ clean_items_app_launch = odu_app.clean_items_app_launch
async def launch_workflow(self, key, op_id, op_params, content):
self.logger.info(
- f"Workflow is getting into launch. Key: {key}. Operation: {op_id}. Params: {op_params}. Content: {content}"
+ f"Workflow is getting into launch. Key: {key}. Operation: {op_id}"
)
+ # self.logger.debug(f"Operation Params: {op_params}")
+ # self.logger.debug(f"Content: {content}")
workflow_function = self._workflows[key]["workflow_function"]
self.logger.info("workflow function : {}".format(workflow_function))
try:
- result, workflow_name = await workflow_function(op_id, op_params, content)
- return result, workflow_name
+ result, workflow_name, workflow_resources = await workflow_function(
+ op_id, op_params, content
+ )
+ return result, workflow_name, workflow_resources
except Exception as e:
self.logger.error(f"Error launching workflow: {e}")
- return False, str(e)
+ return False, str(e), None
async def dummy_clean_items(self, op_id, op_params, content):
self.logger.info(
@@ -245,7 +267,7 @@
async def dummy_operation(self, op_id, op_params, content):
self.logger.info("Empty operation status Enter")
self.logger.info(f"Operation {op_id}. Params: {op_params}. Content: {content}")
- return content["workflow_name"]
+ return True, content["workflow_name"], None
async def clean_items(self, items):
# Delete pods