--- /dev/null
+# Copyright @ 2020 China Mobile (SuZhou) Software Technology Co.,Ltd.\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+import logging\r
+\r
+from rest_framework import status\r
+from rest_framework.views import APIView\r
+from drf_yasg.utils import swagger_auto_schema\r
+from res.resources.serializers import NetworkInfoSerializer\r
+from res.resources.views.base_view import view_safe_call_with_log\r
+from res.biz.networks_get import GetNetworksService\r
+logger = logging.getLogger(__name__)\r
+\r
+\r
+class GetNetworksView(APIView):\r
+ @swagger_auto_schema(\r
+ responses={\r
+ status.HTTP_200_OK: NetworkInfoSerializer(),\r
+ status.HTTP_500_INTERNAL_SERVER_ERROR: 'internal error'\r
+ }\r
+ )\r
+ @view_safe_call_with_log(logger=logger)\r
+ def get(self, request, vnf_instance_id):\r
+ return GetNetworksService().get_networks(vnf_instance_id)\r