Defining SDC ONAP Observer jobs

You configure SDC (Service Design and Creation) ONAP (Open Network Automation Platform) Observer jobs to dynamically load data from the SDC REST interface.

Before you begin

Important: The SDC ONAP Observer supports the SDC release 8.0.0.
Ensure you have the SDC ONAP service details to hand, such as username, password, hostname and port.
To obtain SDC ONAP system details:
To get port
kubectl describe svc --selector=app.kubernetes.io/name=sdc-be | grep NodePort
To get message bus port
kubectl describe svc --selector=app.kubernetes.io/name=message-router | grep NodePort
To copy trust store
kubectl cp <onap-sdc-be-*>:/var/lib/jetty/chef-solo/environments/org.onap.sdc.trust.jks ./org.onap.sdc.trust.jks
Or
kubectl cp <onap-sdc-be-*>:/app/jetty/chef-solo/environments/org.onap.sdc.trust.jks ./org.onap.sdc.trust.jks
To get trust store password
kubectl exec -it <onap-sdc-be-*> -- sh -c "cat /var/lib/jetty/chef-solo/environments/AUTO.json | grep truststore_pwd"
Or
kubectl exec -it <onap-sdc-be-*> -- sh -c "cat /app/jetty/chef-solo/environments/AUTO.json | grep truststore_pwd" 
The observer is installed as part of the core installation procedure.
Remember: Swagger documentation for the observer is available at the following default location: https://<your host>/1.0/sdconap-observer/swagger

About this task

SDC manages two levels of assets:
Resource
A fundamental capability, implemented either entirely in software, or as software that interacts with a hardware device. Each Resource is a combination of one or more Virtual Function Components (VFCs), along with all the information necessary to instantiate, update, delete, and manage the Resource. A resource also includes license-related information. There are three kinds of Resource:
  • Infrastructure: Cloud resources, such as Compute, Storage, etc
  • Network: Network connectivity functions & elements, for example a Virtual Network Function (VNF)
  • Application: Features and capabilities of a software application, for example a load-balancing function=
Service
A well-formed object comprising one or more resources.
Service designers create services from resources, and include all of the information about the service needed to instantiate, update, delete, and manage the service.
The SDC ONAP Observer job retrieves the service design data from the SDC server via REST. The observer loads and updates the resources and their relationships within the Agile Service Manager core topology service.
You define and start the following jobs:
Load
Run this job whenever you need SDC ONAP topology data refreshed.
By default, these jobs are one-off, transient jobs that perform a full upload of all requested topology data as soon as they are triggered.
You can also run these jobs (again) manually from the Observer UI, or schedule them to run at set times when configuring them.
Listen
A long-running job that consumes relevant messages from the SDC DMaaP broker continually until it is explicitly stopped, or until the observer is stopped.
You should run this job after a load job has been completed.
sdconap_observer_common.sh
The configuration file you use to customize SDC ONAP Observer settings.
The parameters defined here are then used by the relevant start scripts to trigger the SDC ONAP Observer jobs.
Tip: Alternatively, you can set the appropriate environment variables. If an environment variable is set, it takes precedence over the configuration file settings.

Procedure

To edit the parameters in the configuration file

  1. Open the sdconap_observer_common.sh configuration file and edit the following parameters:
    For encryption: Run the encrypt_password.sh script in the ASM_HOME/bin directory:
    ./bin/encrypt_password.sh
    Enter and then confirm the password. The encryption utility will return an encrypted version.
    Table 1. SDC ONAP Observer load job parameters
    Parameter Action Details
    Unique ID Enter a unique name for the job Required
    SDC Distribution Engine host Specify the host name of the SDC Distribution Engine Required
    SDC Distribution Engine port Specify the port number of the SDC Distribution Engine Required
    SDC username Specify the user name to use when connecting to the SDC Required
    SDC password Specify the password to use when connecting to the SDC Required. Must be encrypted.
    Target system Key Store file name Specify the key store name that contains either the CA certificate or the SDC's public key Required
    On-prem
    Create and store the certificate in the ASM_HOME/security directory.
    OCP
    Obtain the authentication certificate using OpenSSL and store it as a secret.
    For information on encrypting the contents of the key store file, see the following step.
    Target system Key Store password Specify the password to access the key store file Required. Must be encrypted.
    Job schedule

    Specify when the job should run, and whether it should run at regular intervals.

    By default the job runs immediately, and only once.

    Optionally you can specify a future date and time for the job to run, and then set it to run at regular intervals after that.

    Optional. Transient (one-off) jobs only.

    If you set a job schedule, the run intervals must be at least 90 seconds apart, and if you set them at less than 15 minutes, a warning is displayed, as the frequency can impact system performance.

    Observer job description Enter additional information to describe the job. Optional
    Table 2. SDC ONAP Observer listen job parameters
    Parameter Action Details
    Unique ID Enter a unique name for the job Required
    SDC Distribution Engine host Specify the host name of the SDC Distribution Engine Required
    SDC Distribution Engine port Specify the port number of the SDC Distribution Engine Required
    SDC username Specify the user name to use when connecting to the SDC Required
    SDC password Specify the password to use when connecting to the SDC Required. Must be encrypted.
    SDC environment name Specify the environment name configured on the SDC, for example TEST, PROD, AUTO, etc Required
    DMaaP message-router address Specify the DMaaP message bus addresses on which to listen for distribution events Required
    DMaaP message-router port Specify the DMaaP message bus port on which to listen for distribution events Required
    Target system Key Store file name Specify the Key Store name that contains either the CA certificate or the SDC's public key Required
    On-prem
    Create and store the certificate in the ASM_HOME/security directory.
    OCP
    Obtain the authentication certificate using OpenSSL and store it as a secret.
    For information on encrypting the contents of the key store file, see the following step.
    Target system Key Store password Enter the password to access key store file Required. Must be encrypted.
    DMaaP polling interval (in seconds) Specify how often (in seconds) to poll the DMaaP cluster for new model events Required. The default is 20s.
    DMaaP polling timeout (in seconds) Specify the timeout value (in seconds) when polling DMaaP for new model events Optional. The default is 20s.
    Observer job description Enter additional information to describe the job. Optional

To start a job

  1. To start the SDC ONAP jobs, use one of the following commands:
    Load
    $ASM_HOME/bin/sdconap_observer_load_start.sh
    Listen
    $ASM_HOME/bin/sdconap_observer_listen_start.sh

What to do next

You can also use the following scripts:
sdconap_observer_load_stop.sh
Stops the Load job
sdconap_observer_listen_stop.sh
Stops the Listen job
sdconap_observer_job_list.sh
Lists the status of current jobs
sdconap_observer_log_level.sh
Sets the log level
Remember: As an alternative to being configured using the Observer Configuration UI, observer jobs have scripts to start and stop all available jobs, to list the status of a current job, and to set its logging levels. These scripts can be run with -h or --help to display help information, and with -v or --verbose to print out the details of the actions performed by the script, including the full cURL command. For the on-prem version of Agile Service Manager, observer scripts are configured for specific jobs by editing the script configuration files.