diff options
author | xinhuili <lxinhui@vmware.com> | 2017-03-28 00:48:32 -0700 |
---|---|---|
committer | xinhuili <lxinhui@vmware.com> | 2017-03-28 00:48:32 -0700 |
commit | c33d3b52529ea80b4f8b8c5f3774beadfbbb68de (patch) | |
tree | 9a9173cb47212f944e3cde07f834c2fe6fbc4c7b /vio | |
parent | 21d45dd15cebc520db55216cf2c6b00df7222767 (diff) |
Merge several changes at return code
This patch is to merge several changes at return code.
Change-Id: I81fcce46895a93b54fcb3111ab3a2a49b72ff291
Issue-ids: MULTIVIM-36
Signed-off-by: xinhuili <lxinhui@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio/swagger/views/image/views.py | 4 | ||||
-rw-r--r-- | vio/vio/swagger/views/multivim.image.swagger.json | 2 | ||||
-rw-r--r-- | vio/vio/swagger/views/network/views.py | 3 | ||||
-rw-r--r-- | vio/vio/swagger/views/port/views.py | 4 | ||||
-rw-r--r-- | vio/vio/swagger/views/subnet/views.py | 3 |
5 files changed, 10 insertions, 6 deletions
diff --git a/vio/vio/swagger/views/image/views.py b/vio/vio/swagger/views/image/views.py index fd8592d..43ed3c5 100644 --- a/vio/vio/swagger/views/image/views.py +++ b/vio/vio/swagger/views/image/views.py @@ -125,10 +125,10 @@ class CreateListImagesView(APIView): rsp = image_utils.image_formatter(image) rsp.update(vim_rsp) rsp['returnCode'] = '1' - return Response(data=rsp, status=status.HTTP_202_ACCEPTED) + return Response(data=rsp, status=status.HTTP_201_ACCEPTED) except Exception as e: if hasattr(e, "http_status"): return Response(data={'error': str(e)}, status=e.http_status) else: return Response(data={'error': str(e)}, - status=status.HTTP_500_INTERNAL_SERVER_ERROR)
\ No newline at end of file + status=status.HTTP_500_INTERNAL_SERVER_ERROR) diff --git a/vio/vio/swagger/views/multivim.image.swagger.json b/vio/vio/swagger/views/multivim.image.swagger.json index 4604445..05c99ed 100644 --- a/vio/vio/swagger/views/multivim.image.swagger.json +++ b/vio/vio/swagger/views/multivim.image.swagger.json @@ -51,7 +51,7 @@ } ], "responses": { - "200": { + "201": { "description": "successful operation", "schema": { "$ref": "#/definitions/VimImageInfo" diff --git a/vio/vio/swagger/views/network/views.py b/vio/vio/swagger/views/network/views.py index b420e5c..0e6de17 100644 --- a/vio/vio/swagger/views/network/views.py +++ b/vio/vio/swagger/views/network/views.py @@ -49,7 +49,8 @@ class CreateNetworkView(APIView): else: resp = net.create_network(vimid, tenantid, body) resp['returnCode'] = 1 - return Response(data=resp, status=status.HTTP_202_ACCEPTED) + return Response(data=resp, status=status.HTTP_201_CREATED) + return Response(data=resp, status=status.HTTP_200_OK) except Exception as e: if hasattr(e, "http_status"): return Response(data={'error': str(e)}, status=e.http_status) diff --git a/vio/vio/swagger/views/port/views.py b/vio/vio/swagger/views/port/views.py index 3019003..6fdd0fd 100644 --- a/vio/vio/swagger/views/port/views.py +++ b/vio/vio/swagger/views/port/views.py @@ -49,7 +49,9 @@ class CreatePortView(APIView): else: resp = port.create_port(vimid, tenantid, body) resp['returnCode'] = 1 - return Response(data=resp, status=status.HTTP_202_ACCEPTED) + return Response(data=resp, status=status.HTTP_201_CREATED) + return Response(data=resp, status=status.HTTP_200_OK) + except Exception as e: if hasattr(e, "http_status"): return Response(data={'error': str(e)}, status=e.http_status) diff --git a/vio/vio/swagger/views/subnet/views.py b/vio/vio/swagger/views/subnet/views.py index 06d7548..8b0fc28 100644 --- a/vio/vio/swagger/views/subnet/views.py +++ b/vio/vio/swagger/views/subnet/views.py @@ -49,7 +49,8 @@ class CreateSubnetView(APIView): else: resp = subnet.create_subnet(vimid, tenantid, body) resp['returnCode'] = 1 - return Response(data=resp, status=status.HTTP_202_ACCEPTED) + return Response(data=resp, status=status.HTTP_201_CREATED) + return Response(data=resp, status=status.HTTP_200_OK) except Exception as e: if hasattr(e, "http_status"): return Response(data={'error': str(e)}, status=e.http_status) |