summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--lcm/lcm/nf/serializers/terminate_vnf_req.py5
-rw-r--r--lcm/lcm/nf/tests/test_create_vnf.py3
-rw-r--r--lcm/lcm/nf/views/curd_vnf_views.py3
4 files changed, 13 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..80537515
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+logs/*.log
+*.pyc
+.idea
+.tox
diff --git a/lcm/lcm/nf/serializers/terminate_vnf_req.py b/lcm/lcm/nf/serializers/terminate_vnf_req.py
index 805ef6b3..956fb350 100644
--- a/lcm/lcm/nf/serializers/terminate_vnf_req.py
+++ b/lcm/lcm/nf/serializers/terminate_vnf_req.py
@@ -25,3 +25,8 @@ class TerminateVnfRequestSerializer(serializers.Serializer):
help_text="This attribute is only applicable in case of graceful termination",
default=120,
required=False)
+ additionalParams = serializers.DictField(
+ help_text="Additional parameters passed by the NFVO as input to the termination process",
+ child=serializers.CharField(help_text="KeyValue Pairs", allow_blank=True),
+ required=False,
+ allow_null=True)
diff --git a/lcm/lcm/nf/tests/test_create_vnf.py b/lcm/lcm/nf/tests/test_create_vnf.py
index afeedb31..a672827e 100644
--- a/lcm/lcm/nf/tests/test_create_vnf.py
+++ b/lcm/lcm/nf/tests/test_create_vnf.py
@@ -76,5 +76,6 @@ class TestNFInstantiate(TestCase):
"vnfInstanceDescription": "vFW in Nanjing TIC Edge"
}
response = self.client.post("/api/vnflcm/v1/vnf_instances", data=data, format='json')
- expect_data = {"id": "1", "vnfProvider": "huawei", "vnfdVersion": "1.0", "vnfPkgId": "111"}
+ expect_data = {"id": "1", "vnfProvider": "huawei", "vnfdVersion": "1.0", "vnfPkgId": "111",
+ "instantiationState": "NOT_INSTANTIATED"}
self.assertEqual(expect_data, response.data)
diff --git a/lcm/lcm/nf/views/curd_vnf_views.py b/lcm/lcm/nf/views/curd_vnf_views.py
index 078053a8..efd85168 100644
--- a/lcm/lcm/nf/views/curd_vnf_views.py
+++ b/lcm/lcm/nf/views/curd_vnf_views.py
@@ -74,7 +74,8 @@ class CreateVnfAndQueryVnfs(APIView):
create_vnf_resp_serializer = VnfInstanceSerializer(data={"id": nf_inst.nfinstid,
"vnfProvider": nf_inst.vendor,
"vnfdVersion": nf_inst.version,
- "vnfPkgId": nf_inst.package_id})
+ "vnfPkgId": nf_inst.package_id,
+ "instantiationState": nf_inst.status})
if not create_vnf_resp_serializer.is_valid():
raise NFLCMException(create_vnf_resp_serializer.errors)
return Response(data=create_vnf_resp_serializer.data, status=status.HTTP_201_CREATED)