From 519da48b76e8996450d58debecf5fdde7daa5b5e Mon Sep 17 00:00:00 2001 From: govindarajul Date: Fri, 29 Apr 2022 19:05:22 +0530 Subject: [PATCH] Feature 10911-Vertical scaling of VM instances from OSM Added implementation code for Vertical Scaling of VDUs in OSM NBI. Change-Id: I13a30ec3da9eccaf04219023f33ec0a6e6061f0e Signed-off-by: govindarajul --- osm_nbi/instance_topics.py | 2 ++ osm_nbi/nbi.py | 4 ++++ osm_nbi/validation.py | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/osm_nbi/instance_topics.py b/osm_nbi/instance_topics.py index 62df4f8..57c7232 100644 --- a/osm_nbi/instance_topics.py +++ b/osm_nbi/instance_topics.py @@ -30,6 +30,7 @@ from osm_nbi.validation import ( ns_heal, nsi_instantiate, ns_migrate, + ns_verticalscale, ) from osm_nbi.base_topic import ( BaseTopic, @@ -1167,6 +1168,7 @@ class NsLcmOpTopic(BaseTopic): "heal": ns_heal, "terminate": ns_terminate, "migrate": ns_migrate, + "verticalscale": ns_verticalscale, } def __init__(self, db, fs, msg, auth): diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py index de48c03..d78379f 100644 --- a/osm_nbi/nbi.py +++ b/osm_nbi/nbi.py @@ -461,6 +461,10 @@ valid_url_methods = { "METHODS": ("POST",), "ROLE_PERMISSION": "ns_instances:id:update:", }, + "verticalscale": { + "METHODS": ("POST",), + "ROLE_PERMISSION": "ns_instances:id:verticalscale:" + }, }, }, "ns_lcm_op_occs": { diff --git a/osm_nbi/validation.py b/osm_nbi/validation.py index f9213d8..6ed6fba 100644 --- a/osm_nbi/validation.py +++ b/osm_nbi/validation.py @@ -613,6 +613,29 @@ ns_heal = { "additionalProperties": False, } +ns_verticalscale = { + "title": "vertial scale 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"} vim_type = shortname_schema # {"enum": ["openstack", "openvim", "vmware", "opennebula", "aws", "azure", "fos"]} -- 2.25.1