aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-02-27 15:41:36 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-02-27 15:41:36 +0800
commit3b7a32cce4e04b3eab28f1c93158567698acae77 (patch)
treeed972676a5ecfe62d848506c303a707938b53191
parent3a9c6d798899bf84696d09d5149d47b4c6a0d310 (diff)
Add Create a VNF instance resource api
Change-Id: Ic98a9548c7cdb6d1f39bf299ac2f138b6efc70fe Issue-ID: VFC-779 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/v2/__init__.py13
-rw-r--r--lcm/v2/serializers.py13
-rw-r--r--lcm/v2/urls.py23
-rw-r--r--lcm/v2/views.py26
4 files changed, 75 insertions, 0 deletions
diff --git a/lcm/v2/__init__.py b/lcm/v2/__init__.py
new file mode 100644
index 00000000..342c2a8c
--- /dev/null
+++ b/lcm/v2/__init__.py
@@ -0,0 +1,13 @@
+# Copyright 2018 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/lcm/v2/serializers.py b/lcm/v2/serializers.py
new file mode 100644
index 00000000..342c2a8c
--- /dev/null
+++ b/lcm/v2/serializers.py
@@ -0,0 +1,13 @@
+# Copyright 2018 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
diff --git a/lcm/v2/urls.py b/lcm/v2/urls.py
new file mode 100644
index 00000000..b901e880
--- /dev/null
+++ b/lcm/v2/urls.py
@@ -0,0 +1,23 @@
+# Copyright 2016 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from django.conf.urls import url
+from rest_framework.urlpatterns import format_suffix_patterns
+
+from lcm.v2.views import VnfInstancesView
+
+urlpatterns = [
+ url(r'^api/nslcm/v2/vnf_instances$', VnfInstancesView.as_view()),
+]
+
+urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/lcm/v2/views.py b/lcm/v2/views.py
new file mode 100644
index 00000000..d142176f
--- /dev/null
+++ b/lcm/v2/views.py
@@ -0,0 +1,26 @@
+# Copyright 2016 ZTE Corporation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import logging
+
+from rest_framework.response import Response
+from rest_framework.views import APIView
+from rest_framework import status
+
+logger = logging.getLogger(__name__)
+
+
+class VnfInstancesView(APIView):
+ def post(self, request):
+ logger.debug("VnfInstancesView Post: %s" % request.data)
+ return Response(data={}, status=status.HTTP_202_ACCEPTED)