summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-02-01 13:56:24 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-02-01 13:56:24 +0800
commit079621b815fd5c063e7d2ad2700e32dae2fda9d1 (patch)
tree6453aaf0e45285c7c8241b48cf43cd4d882014f2
parentb50ffdfbc99a6384f3769a12151788eeb37bdfd8 (diff)
Add port chain swagger generate logic
Change-Id: Idf0293cad615df280acb576aed840e7aaf88098b Issue-ID: VFC-694 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r--lcm/ns/sfcs/views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lcm/ns/sfcs/views.py b/lcm/ns/sfcs/views.py
index 188e8ced..5fb6ae22 100644
--- a/lcm/ns/sfcs/views.py
+++ b/lcm/ns/sfcs/views.py
@@ -34,6 +34,7 @@ from lcm.ns.sfcs.serializers import CreateSfcInstReqSerializer, CreateSfcInstRes
from lcm.ns.sfcs.serializers import CreateSfcReqSerializer, CreateSfcRespSerializer
from lcm.ns.sfcs.serializers import CreatePortPairGpSerializer
from lcm.ns.sfcs.serializers import CreateFlowClaSerializer
+from lcm.ns.sfcs.serializers import CreatePortChainSerializer
logger = logging.getLogger(__name__)
@@ -110,7 +111,17 @@ class FlowClaView(APIView):
class PortChainView(APIView):
+ @swagger_auto_schema(
+ request_body=CreatePortChainSerializer(),
+ responses={
+ status.HTTP_200_OK: None
+ }
+ )
def post(self, request):
+ req_serializer = CreatePortChainSerializer(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'])}