From: fujinhua Date: Tue, 27 Feb 2018 07:41:36 +0000 (+0800) Subject: Add Create a VNF instance resource api X-Git-Tag: v1.1.0~137 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F33111%2F1;p=vfc%2Fnfvo%2Flcm.git Add Create a VNF instance resource api Change-Id: Ic98a9548c7cdb6d1f39bf299ac2f138b6efc70fe Issue-ID: VFC-779 Signed-off-by: fujinhua --- 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)