summaryrefslogtreecommitdiffstats
path: root/components/pm-subscription-handler/pmsh_service
diff options
context:
space:
mode:
authoregernug <gerard.nugent@est.tech>2021-12-06 13:11:15 +0000
committeregernug <gerard.nugent@est.tech>2021-12-09 12:56:03 +0000
commit15dde94eccad074dda76c420f900c977c184b66f (patch)
tree263bc1ac72ca91311a0b77aeb5e49a8292d71965 /components/pm-subscription-handler/pmsh_service
parent10aa7f851d2256c5b158f8b4c5d3e2756890f7b7 (diff)
[PMSH] Add NF list to the Read by Subname call
Issue-ID: DCAEGEN2-2992 Add the list of NFs when a request is made for a subscription. This will assist with testing and visibility for the user. Change-Id: I6061f1dd1cbc6c579e98605c1d7bcbcea3c4e77b Signed-off-by: egernug <gerard.nugent@est.tech>
Diffstat (limited to 'components/pm-subscription-handler/pmsh_service')
-rwxr-xr-xcomponents/pm-subscription-handler/pmsh_service/mod/api/db_models.py1
-rw-r--r--components/pm-subscription-handler/pmsh_service/mod/api/services/subscription_service.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py b/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py
index 96a803ba..9ecc80e6 100755
--- a/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/api/db_models.py
@@ -67,6 +67,7 @@ class SubscriptionModel(db.Model):
'operationalPolicyName': self.operational_policy_name,
'controlLoopName': self.control_loop_name,
'nfFilter': self.network_filter.serialize(),
+ 'nfs': [nf.nf_name for nf in self.nfs],
'measurementGroups':
[mg.serialize() for mg in self.measurement_groups]}}
diff --git a/components/pm-subscription-handler/pmsh_service/mod/api/services/subscription_service.py b/components/pm-subscription-handler/pmsh_service/mod/api/services/subscription_service.py
index c33c82fb..73467821 100644
--- a/components/pm-subscription-handler/pmsh_service/mod/api/services/subscription_service.py
+++ b/components/pm-subscription-handler/pmsh_service/mod/api/services/subscription_service.py
@@ -306,7 +306,8 @@ def query_subscription_by_name(subscription_name):
logger.info(f'Attempting to fetch subscription by name: {subscription_name}')
subscription_model = db.session.query(SubscriptionModel) \
.options(joinedload(SubscriptionModel.network_filter),
- joinedload(SubscriptionModel.measurement_groups)) \
+ joinedload(SubscriptionModel.measurement_groups),
+ joinedload(SubscriptionModel.nfs)) \
.filter_by(subscription_name=subscription_name).first()
db.session.remove()
return subscription_model