Code Review
/
vfc
/
gvnfm
/
vnflcm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add file of delete vnf instance
[vfc/gvnfm/vnflcm.git]
/
lcm
/
lcm
/
nf
/
vnfs
/
views.py
diff --git
a/lcm/lcm/nf/vnfs/views.py
b/lcm/lcm/nf/vnfs/views.py
index
6dbdb73
..
f03e4bc
100644
(file)
--- a/
lcm/lcm/nf/vnfs/views.py
+++ b/
lcm/lcm/nf/vnfs/views.py
@@
-11,8
+11,9
@@
# 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.
# 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 json
import logging
import logging
+import os
import traceback
from rest_framework import status
import traceback
from rest_framework import status
@@
-37,7
+38,7
@@
class CreateVnfIdentifier(APIView):
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except Exception:
logger.error(traceback.format_exc())
return Response(data={'error': '%s' % e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
except Exception:
logger.error(traceback.format_exc())
- return Response(data=
'unexpected exception'
, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
+ return Response(data=
{'error': 'unexpected exception'}
, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
rsp = {"vnfInstanceId": nf_inst_id}
return Response(data=rsp, status=status.HTTP_201_CREATED)
rsp = {"vnfInstanceId": nf_inst_id}
return Response(data=rsp, status=status.HTTP_201_CREATED)
@@
-55,7
+56,7
@@
class InstantiateVnf(APIView):
class DeleteVnfIdentifier(APIView):
def delete(self, request):
logger.debug("DeleteVnfIdentifier--delete::> %s" % request.data)
class DeleteVnfIdentifier(APIView):
def delete(self, request):
logger.debug("DeleteVnfIdentifier--delete::> %s" % request.data)
- return Response(data='', status=status.HTTP_20
2_ACCEPTED
)
+ return Response(data='', status=status.HTTP_20
4_NO_CONTENT
)
class TerminateVnf(APIView):
class TerminateVnf(APIView):
@@
-80,3
+81,12
@@
class GetOperationStatus(APIView):
def get(self, request):
logger.debug("GetOperationStatus--get::> %s" % request.data)
return Response(data='', status=status.HTTP_202_ACCEPTED)
def get(self, request):
logger.debug("GetOperationStatus--get::> %s" % request.data)
return Response(data='', status=status.HTTP_202_ACCEPTED)
+
+
+class SwaggerJsonView(APIView):
+ def get(self, request):
+ json_file = os.path.join(os.path.dirname(__file__), 'swagger.json')
+ f = open(json_file)
+ json_data = json.JSONDecoder().decode(f.read())
+ f.close()
+ return Response(json_data)