import traceback
from django.db.models import Q
+
logger = logging.getLogger(__name__)
'timeStamp': catalog.pub.utils.timeutil.now_time(),
'vnfPkgId': vnf_pkg_id,
'vnfdId': vnfd_id,
- 'changeType': pkg_change_type,
- 'operationalState': operational_state,
'_links': {
'vnfPackage': {
'href': 'http://%s:%s/%s/vnf_packages/%s' % (pub_config.MSB_SERVICE_IP,
}
}
}
+
+ if notification_type == "VnfPackageChangeNotification":
+ notification_content['changeType'] = pkg_change_type
+ notification_content['operationalState'] = operational_state
+
return notification_content
self.vnfd_id = ignore_case_get(self.filter, "vnfdId", [])
self.vnf_pkg_id = ignore_case_get(self.filter, "vnfPkgId", [])
self.vnf_products_from_provider = \
- ignore_case_get(self.filter, "vnfProductsFromProviders", {})
+ ignore_case_get(self.filter, "vnfProductsFromProviders", [])
def check_callbackuri_connection(self):
logger.debug("SubscribeNotification-post::> Sending GET request "
allow_null=False,
required=False
)
- vnfProductsFromProviders = vnfProductsProvidersSerializer(
+ vnfProductsFromProviders = serializers.ListField(
+ child=vnfProductsProvidersSerializer(),
help_text="Match VNF packages that contain "
"VNF products from certain providers.",
allow_null=False,
"notificationTypes": [
"VnfPackageOnboardingNotification"
],
- "vnfProductsFromProviders": {
+ "vnfProductsFromProviders": [{
"vnfProvider": "string",
"vnfProducts": {
"vnfProductName": "string",
]
}
}
- },
+ }],
"vnfdId": [
"00342b18-a5c7-11e8-998c-bf1755941f12"
],
'timeStamp': "nowtime()",
'vnfPkgId': uuid_vnfPackageId,
'vnfdId': uuid_vnfdid,
- 'changeType': const.PKG_CHANGE_TYPE.OP_STATE_CHANGE,
- 'operationalState': None,
"subscriptionId": uuid_subscriptid,
'_links': {
'subscription': {
url(r'^api/vnfpkgm/v1/subscriptions/(?P<subscriptionId>[0-9a-zA-Z\-\_]+)$', QueryTerminateSubscriptionView.as_view(), name='subscriptions_query_terminate'),
url(r'^api/vnfpkgm/v1/vnf_packages/(?P<vnfPkgId>[0-9a-zA-Z\-\_]+)/artifacts/(?P<artifactPath>[0-9a-zA-Z\-\_]+)$', FetchVnfPkgmArtifactsView.as_view(), name="fetch_vnf_artifacts"),
url(r'^URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageOnboardingNotification$', PkgOnboardingNotificationView.as_view()),
- url(r'^URI-is-provided-by-the-client-when-creating-the-sbuscription-VnfPackageChangeNotification$', PkgChangeNotificationView.as_view()),
+ url(r'^URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageChangeNotification$', PkgChangeNotificationView.as_view()),
# health check
url(r'^api/vnfpkgm/v1/health_check$', HealthCheckView.as_view()),