From: elumalai Date: Thu, 28 Apr 2022 11:56:24 +0000 (+0530) Subject: Feature 10910: Migration of Openstack based VM instances X-Git-Tag: v12.0.0rc1~15 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F64%2F11964%2F3;p=osm%2FNBI.git Feature 10910: Migration of Openstack based VM instances Added feature support for Migration of Openstack based VM instances from OSM Change-Id: I7db836401c5b9fee71f032884064593135fb88d9 Signed-off-by: elumalai --- diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 74815ca..787f6e1 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -28,6 +28,7 @@ from osm_nbi.validation import ( ns_scale, ns_update, nsi_instantiate, + ns_migrate, ) from osm_nbi.base_topic import ( BaseTopic, @@ -1158,6 +1159,7 @@ class NsLcmOpTopic(BaseTopic): "update": ns_update, "scale": ns_scale, "terminate": ns_terminate, + "migrate": ns_migrate, } def __init__(self, db, fs, msg, auth): diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index ff2f6de..f57258f 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -85,6 +85,7 @@ URL: /osm GET POST terminate O5 action O scale O5 + migrate O heal 5 update 05 /ns_lcm_op_occs 5 5 @@ -444,6 +445,10 @@ valid_url_methods = { "METHODS": ("POST",), "ROLE_PERMISSION": "ns_instances:id:instantiate:", }, + "migrate": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "ns_instances:id:migrate:", + }, "action": { "METHODS": ("POST",), "ROLE_PERMISSION": "ns_instances:id:action:", diff --git a/osm_nbi/resources_to_operations.yml b/osm_nbi/resources_to_operations.yml index 1f75a5b..3c5ba3d 100644 --- a/osm_nbi/resources_to_operations.yml +++ b/osm_nbi/resources_to_operations.yml @@ -135,6 +135,8 @@ resources_to_operations: "POST /nslcm/v1/ns_instances//scale": "ns_instances:id:scale:post" + "POST /nslcm/v1/ns_instances//migrate": "ns_instances:id:migrate:post" + "GET /nslcm/v1/ns_lcm_op_occs": "ns_instances:opps:get" "GET /nslcm/v1/ns_lcm_op_occs/": "ns_instances:opps:id:get" diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index 5c75522..3373b84 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -526,6 +526,28 @@ ns_scale = { # TODO for the moment it is only VDU-scaling "additionalProperties": False, } +ns_migrate = { + "title": "ns migrate input schema", + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "lcmOperationType": string_schema, + "nsInstanceId": id_schema, + "vnfInstanceId": id_schema, + "migrateToHost": string_schema, + "vdu": { + "type": "object", + "properties": { + "vduId": name_schema, + "vduCountIndex": integer0_schema, + }, + "required": ["vduId"], + "additionalProperties": False, + }, + }, + "required": ["vnfInstanceId"], + "additionalProperties": False +} schema_version = {"type": "string", "enum": ["1.0"]} schema_type = {"type": "string"}