diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2018-02-01 12:08:36 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2018-02-01 12:08:36 +0800 |
commit | b50ffdfbc99a6384f3769a12151788eeb37bdfd8 (patch) | |
tree | c305ecf438ba001e5940cfe53cf8ac838e466703 | |
parent | 97e77c54ae4a29c78a643a84164e7ff373dd78e4 (diff) |
Add flow cla swagger generate logic
Change-Id: I4ff8fcdbc08919f216b04dfbbdea188110403319
Issue-ID: VFC-694
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | lcm/ns/sfcs/views.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lcm/ns/sfcs/views.py b/lcm/ns/sfcs/views.py index f6babeec..188e8ced 100644 --- a/lcm/ns/sfcs/views.py +++ b/lcm/ns/sfcs/views.py @@ -33,6 +33,7 @@ from lcm.ns.sfcs.utils import get_fp_id, ignorcase_get from lcm.ns.sfcs.serializers import CreateSfcInstReqSerializer, CreateSfcInstRespSerializer from lcm.ns.sfcs.serializers import CreateSfcReqSerializer, CreateSfcRespSerializer from lcm.ns.sfcs.serializers import CreatePortPairGpSerializer +from lcm.ns.sfcs.serializers import CreateFlowClaSerializer logger = logging.getLogger(__name__) @@ -77,6 +78,10 @@ class PortPairGpView(APIView): } ) def post(self, request): + req_serializer = CreatePortPairGpSerializer(data=request.data) + if not req_serializer.is_valid(): + logger.error(req_serializer.errors) + data = { 'fpinstid': request.data["fpinstid"], "ns_model_data": json.loads(request.data['context']), @@ -86,7 +91,17 @@ class PortPairGpView(APIView): class FlowClaView(APIView): + @swagger_auto_schema( + request_body=CreateFlowClaSerializer(), + responses={ + status.HTTP_200_OK: None + } + ) def post(self, request): + req_serializer = CreateFlowClaSerializer(data=request.data) + if not req_serializer.is_valid(): + logger.error(req_serializer.errors) + data = { 'fpinstid': request.data["fpinstid"], "ns_model_data": json.loads(request.data['context'])} |