This document describes the procedure for sending notifications related to VNF package management.

Precondition: The subscribed API consumer has subscribed previously for notifications related to VNF package management.

If an event occurs that matches the filtering criteria which are part of the subscription, Etsicatalog will generate notification that includes information about the event, and sends it in the body of a POST request to the URI
which the subscribed API consumer has registered as part of the subscription request. 

The subscribed API consumer should acknowledges the successful delivery of the notification by returning a "204 No Content" response.

1.VnfPackage Onboarding Notification

When onboarding VNF package successfully, Etsicatalog will filter all Subscriptions records:

  • notificationTypes == “VnfPackageOnboardingNotification”

     &&

  • VnfPackage‘s vnfdId / vnfPkgId / vnfProductsFromProviders matching subscription.filters

If there are matching subscription records,  Etsicatalog will send a notification to the URI which is provided by the Client in its subscription request.

1.1 Flow of VnfPackage Onboarding Notification

Client Client ETSICatalog ETSICatalog Post /Subscriptions(callbackUri=/URI-is-provided-by-the-clientfilters.notificationTypes=VnfPackageOnboardingNotification) test notification endpoint Get /URI-is-provided-by-the-client 204 No Content Creates a new subscription 201 Created alt Put /vnf_packages/(vnfPkgId)/package_content Put /vnf_packages/(vnfPkgId)/package_content/upload_from_uri 202 Accepted Uploading of VNF package content Filter Subscriptions alt[Filted by Subscriptions.filters] Post /URI-is-provided-by-the-client 204 No Content

1.2 Subscribe API example:

curl -X POST 
  http://{{baseUrl}}//api/vnfpkgm/v1/subscriptions 
  -H 'Content-Type: application/json' 
  -d '{
    "filters": {
        "notificationTypes": [
            "VnfPackageOnboardingNotification"
        ],
        "vnfdId": [
            "uuid_vnfdid"
        ]
    },
    "callbackUri": "http://www.vnf1.com/notification",    
    "authentication": {
        "authType": [
            "BASIC"
        ],
        "paramsBasic": {
            "userName": "username",
            "password": "userpwd"
        }
    }
}'

1.3 Notification API example:

POST URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageOnboardingNotification

For this example, the URI provided by client is http://www.vnf1.com/notification according to the subscription request above.

curl -X POST -u username:userpwd http://www.vnf1.com/notification
  http:// 
  -H 'Content-Type: application/json' 
  -d '{
  "id":"notify_id",
  "notificationType":"VnfPackageOnboardingNotification",
  "timeStamp":"2019-12-16 14:41:16",
  "vnfPkgId":"vnfPackage_uuid",
  "vnfdId":"vnfdId_uuid",
  "subscriptionId":"subscription_id",
  "_links":{
    "subscription":{
      "href":"http://subscriptionuri"
    },
    "vnfPackage":{
      "href":"http://vnfPackageuri"
    }
  }
}'



2.VnfPackage Change Notification

When the VNF package is modified or deleted, Etsicatalog will filter all Subscriptions records:

  • notificationTypes == “VnfPackageChangeNotification”

     &&

  • VnfPackage’s vnfdId / vnfPkgId / vnfProductsFromProviders matching subscription.filters

If there are some matching subscription records,  Etsicatalog will send a notification to the URI which is provided by the Client in its subscription request.

2.1 Flow of VnfPackage Change Notification

Client Client ETSICatalog ETSICatalog Post /Subscriptions(callbackUri=/URI-is-provided-by-the-clientfilters.notificationTypes=VnfPackageChangeNotification) test notification endpoint Get /URI-is-provided-by-the-client 204 No Content Creates a new subscription 201 Created alt Delete /vnf_packages/(vnfPkgId) Deletes the VNF package 200 OK Patch /vnf_packages/(vnfPkgId) Updates the information of the VNF package 204 No Content Filter Subscriptions alt[Filted by Subscriptions.filters] Post /URI-is-provided-by-the-client 204 No Content

2.2 Subscribe API example:

curl -X POST 
  http://{{baseUrl}}/api/vnfpkgm/v1/subscriptions 
  -H 'Content-Type: application/json' 
  -d '{
    "filters": {
        "notificationTypes": [
            "VnfPackageChangeNotification"
        ],
        "vnfdId": [
            "uuid_vnfdid"
        ]
    },
    "callbackUri": "http://www.vnf1.com/notification",
    "authentication": {
        "authType": [
            "BASIC"
        ],
        "paramsBasic": {
            "userName": "username",
            "password": "userpwd"
        }
    }
}'

2.3 Notification API example:

POST URI-is-provided-by-the-client-when-creating-the-subscription-VnfPackageChangeNotification 

For this example, the URI provided by client is http://www.vnf1.com/notification according to the subscription request above.

curl -X POST -u username:userpwd
  http://www.vnf1.com/notification 
  -H 'Content-Type: application/json' \
  -d '{
  "id":"notify_id",
  "notificationType":"VnfPackageChangeNotification",
  "timeStamp":"2019-12-16 14:41:16",
  "vnfPkgId":"vnfPackage_uuid",
  "vnfdId":"uuid_vnfdid",
  "subscriptionId":"subscription_id",
  "changeType":"OP_STATE_CHANGE",
  "operationalState":"ENABLED",
  "_links":{
    "subscription":{
      "href":"http://subscriptionuri"
    },
    "vnfPackage":{
      "href":"http://vnfPackageuri"
    }
  }
}'

3. Client APIs 

The client should implement the followed APIs when creating the subscription:

Client_API_notify_v1.yaml

  • No labels