Add Create a VNF instance resource api 11/33111/1
authorfujinhua <fu.jinhua@zte.com.cn>
Tue, 27 Feb 2018 07:41:36 +0000 (15:41 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Tue, 27 Feb 2018 07:41:36 +0000 (15:41 +0800)
Change-Id: Ic98a9548c7cdb6d1f39bf299ac2f138b6efc70fe
Issue-ID: VFC-779
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/v2/__init__.py [new file with mode: 0644]
lcm/v2/serializers.py [new file with mode: 0644]
lcm/v2/urls.py [new file with mode: 0644]
lcm/v2/views.py [new file with mode: 0644]

diff --git a/lcm/v2/__init__.py b/lcm/v2/__init__.py
new file mode 100644 (file)
index 0000000..342c2a8
--- /dev/null
@@ -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 (file)
index 0000000..342c2a8
--- /dev/null
@@ -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 (file)
index 0000000..b901e88
--- /dev/null
@@ -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 (file)
index 0000000..d142176
--- /dev/null
@@ -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)