summaryrefslogtreecommitdiffstats
path: root/lcm/ns_pnfs/views/pnf_view.py
diff options
context:
space:
mode:
authorFu Jinhua <fu.jinhua@zte.com.cn>2018-11-03 06:58:23 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-03 06:58:23 +0000
commit2c3ec81199e28d241ee6c37d3979981fe79fb2bf (patch)
treecfb57c258ea5d0e90553057d2924339954acc3ab /lcm/ns_pnfs/views/pnf_view.py
parent46eaf6719b0ddffe445db6b93e05c7dd4a653de9 (diff)
parent850c3ee912aa4f2a4e65ab9a205e1235dce7071b (diff)
Merge "enhace the ns instance query to support pnfinfo"
Diffstat (limited to 'lcm/ns_pnfs/views/pnf_view.py')
-rw-r--r--lcm/ns_pnfs/views/pnf_view.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lcm/ns_pnfs/views/pnf_view.py b/lcm/ns_pnfs/views/pnf_view.py
index c6f2694d..ad435f9b 100644
--- a/lcm/ns_pnfs/views/pnf_view.py
+++ b/lcm/ns_pnfs/views/pnf_view.py
@@ -63,7 +63,12 @@ class PnfView(APIView):
def get(self, request):
try:
logger.debug("PnfView::get")
- pnfInstDataSet = GetPnf().do_biz()
+ nsInstanceId = request.query_params.get('nsInstanceId', None)
+ if nsInstanceId is not None:
+ filter = {"nsInstanceId": nsInstanceId}
+ pnfInstDataSet = GetPnf(filter).do_biz()
+ else:
+ pnfInstDataSet = GetPnf().do_biz()
logger.debug("PnfView::get::ret=%s", pnfInstDataSet)
resp_serializer = PnfInstancesSerializer(data=[pnfInstData.__dict__ for pnfInstData in pnfInstDataSet])
if not resp_serializer.is_valid():