...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
~/oom/kubernetes# kubectl edit cm dev-so-bpmn-infra-app-configmap ## replace "workflow:\n CreateGenericVNFV1:\n" ## with "workflow:\n custom:\n BBS_E2E_Service:\n sdnc:\n need: true\n CreateGenericVNFV1:\n" ## Restart the pod ~/oom/kubernetes# kubectl delete po dev-so-so-bpmn-infra-7556d7f6bc-8fthk |
Info |
---|
Beware: The spaces in the code segment above should be exactly as shown, otherwise SO BPMN infra POD will crash upon bring-up. |
Mapping between resource model and BPMN template: SO : How it works between API and BPMN
...
Code Block | ||||
---|---|---|---|---|
| ||||
## Fetch mariadb root password root@onap-rancher-daily:/home/ubuntu# kubectl get secrets/dev-mariadb-galera-db-root-password --template={{.data.password}} | base64 -d root@onap-rancher-daily:/home/ubuntu# kubectl exec -ti dev-mariadb-galera-0 sh sh-4.2$ mysql -u root -p MariaDB [(none)]> use catalogdb; MariaDB [catalogdb]> INSERT INTO vnf_recipe (NF_ROLE, ACTION, SERVICE_TYPE, VERSION_STR, DESCRIPTION, ORCHESTRATION_URI, VNF_PARAM_XSD, RECIPE_TIMEOUT) VALUES ("InternetProfile", "createInstance", "NF", "1.0", "create InternetProfile", "/mso/async/services/CreateSDNCNetworkResource", '{"operationType":"AccessConnectivityInternetProfile"}', 180000), ("AccessConnectivity", "createInstance", "NF", "1.0", "create AccessConnectivity", "/mso/async/services/CreateSDNCNetworkResource", '{"operationType":"InternetProfileAccessConnectivity"}', 180000), ("CPE", "createInstance", "NF", "1.0", "create CPE", "/mso/async/services/HandlePNF", NULL, 180000); MariaDB [catalogdb]> select * from vnf_recipe where NF_ROLE IN ('AccessConnectivity','InternetProfile', 'CPE'); +-------+--------------------+----------------+--------------+-------------+---------------------------+-----------------------------------------------+----------------------------------------+----------------+---------------------+--------------+ | id | NF_ROLE | ACTION | SERVICE_TYPE | VERSION_STR | DESCRIPTION | ORCHESTRATION_URI | VNF_PARAM_XSD | RECIPE_TIMEOUT | CREATION_TIMESTAMP | VF_MODULE_ID | +-------+--------------------+----------------+--------------+-------------+---------------------------+-----------------------------------------------+----------------------------------------+----------------+---------------------+--------------+ | 10048 | InternetProfile | createInstance | NF | 1.0 | create InternetProfile | /mso/async/services/CreateSDNCNetworkResource | {"operationType":"InternetProfile"} | 1800000 | 2020-01-20 17:43:07 | NULL | | 10051 | AccessConnectivity | createInstance | NF | 1.0 | create AccessConnectivity | /mso/async/services/CreateSDNCNetworkResource | {"operationType":"AccessConnectivity"} | 1800000 | 2020-01-20 17:43:07 | NULL | | 10054 | CPE | createInstance | NF | 1.0 | create CPE | /mso/async/services/HandlePNF | NULL | 1800000 | 2020-01-20 17:43:07 | NULL | +-------+--------------------+----------------+--------------+-------------+---------------------------+-----------------------------------------------+----------------------------------------+----------------+---------------------+--------------+ 3 rows in set (0.00 sec) |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl --silent --location --request GET k 'https://mr.api.simpledemo.openecomp.org:30226/topics' \ --header 'Content-Type: application/json' \ --data-raw '' { "topics": [ "org.onap.dmaap.mr.PNF_REGISTRATION", "unauthenticated.DCAE_CL_OUTPUT", "AAI-EVENT", "SDC-DISTR-STATUS-TOPIC-AUTO", "SDC-DISTR-NOTIF-TOPIC-AUTO", "org.onap.dmaap.mr.PNF_READY", "unauthenticated.PNF_READY", "POLICY-PDP-PAP", "unauthenticated.CPE_AUTHENTICATION", "unauthenticated.VES_MEASUREMENT_OUTPUT", "unauthenticated.PNF_UPDATE", "org.onap.dmaap.mr.mirrormakeragent", "__consumer_offsets" ] } |
...
BBS event processor blueprints (ElAlto):
- https://git.onap.org/dcaegen2/platform/servicesblueprints/plain/components/bbs-event-processor/dpo/blueprints/k8s-bbs-event-processor.yaml-template?h=elalto
- https://git.onap.org/dcaegen2/services/plain/components/bbs-event-processor/dpo/blueprints/bbs-event-processor-input.yaml?h=elalto
BBS event processor deployment procedure:
NOTE: k8splugin version: https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
~/oom/kubernetes#root@onap-nfs:/home/ubuntu# kubectl exec -ti dev-dcaegen2-dcae-bootstrap-7599b45c77-85f664d489-54pmtczxsx -n onap bash bash-4.2$ cfy blueprintsinstall validate /blueprints/k8s-bbs-event-processor.yaml Validating blueprint: /blueprints/k8s-bbs-event-processor.yaml Blueprint validated successfully bash-4.2$ cfy blueprints upload -b -b bbs-ep -d bbs-ep /blueprints/k8s-bbs-event-processor.yaml Uploading blueprint /blueprints/k8s-bbs-event-processor.yaml... k8s-bbs-event-pro... |################################################| 100.0% Blueprint uploaded. The blueprint's id is bbs-ep bash-4.2$ cfy deployments create -b bbs-ep bbs-ep Creating new deployment from blueprint bbs-ep... Deployment created. The deployment's id is bbs-ep [root@dev-dcaegen2-dcae-bootstrap-85f664d489-54pmt /]# cfy executions start -d bbs-ep install Executing workflow install on deployment bbs-ep [timeout=900 seconds] 2019-05-01 11:35:32.007 Deployment environment creation is pending... 2020-03-26 13:31:51.512 CFY <bbs-ep> Starting 'installcreate_deployment_environment' workflow execution 20192020-0503-0126 1113:3531:3252.587112 CFY <bbs-ep> [bbs-event-processor_yd5ucp] Creating node instance 2019-05-01 11:35:32.587Installing deployment plugins 2020-03-26 13:31:52.112 CFY <bbs-ep> [bbs-event-processor_yd5ucp.create] Sending task 'k8splugin.create_for_components' 2019-05-01 11:35:33.953 LOGcloudify_agent.operations.install_plugins' 2020-03-26 13:31:52.112 CFY <bbs-ep> [bbs-event-processor_yd5ucp.create] INFO: Added config for s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor 2019-05-01 11:35:33.953Task started 'cloudify_agent.operations.install_plugins' 2020-03-26 13:31:52.706 LOG <bbs-ep> [bbs-event-processor_yd5ucp.create] INFO: AddedInstalling configplugin: fork8s s4d51b24f52264857b7ef520be9efc46b2020-bbs03-event-processor 2019-05-01 11:35:34.596 CFY26 13:31:52.706 LOG <bbs-ep> [bbs-event-processor_yd5ucp.create] INFO: Using existing installation of managed plugin: c567dae6-35df-426a-a677-45ac51175b73 [package_name: k8splugin, package_version: 1.7.2, supported_platform: linux_x86_64, distribution: centos, distribution_release: core] 2020-03-26 13:31:52.706 CFY <bbs-ep> Task succeeded 'k8splugin.create_for_components' 2019-05-01 11:35:34.596cloudify_agent.operations.install_plugins' 2020-03-26 13:31:52.706 CFY <bbs-ep> [bbs-event-processor_yd5ucp] Node instance created 2019-05-01 11:35:34.596 Skipping starting deployment policy engine core - no policies defined 2020-03-26 13:31:52.706 CFY <bbs-ep> [bbs-event-processor_yd5ucp] Configuring node instance: nothing to do 2019-05-01 11:35:35.227Creating deployment work directory 2020-03-26 13:31:52.706 CFY <bbs-ep> 'create_deployment_environment' workflow execution succeeded 2020-03-26 13:31:55.575 CFY <bbs-ep> [bbs-event-processor_yd5ucp] Starting node instance 2019-05-01 11:35:35.227Starting 'install' workflow execution 2020-03-26 13:31:56.242 CFY <bbs-ep> [bbs-event-processor_yd5ucp.start76rp5k] Creating node instance 2020-03-26 13:31:56.910 CFY <bbs-ep> [bbs-event-processor_76rp5k.create] Sending task 'k8splugin.create_and_start_container_for_components' 20192020-0503-0126 1113:3531:3659.193795 LOG <bbs-ep> [bbs-event-processor_yd5ucp76rp5k.startcreate] INFO: StartingDone k8ssetting deployment for s4d51b24f52264857b7ef520be9efc46bup: s636058386c6042289eaf4f55ada78500-bbs-event-processor, image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components. 2020-03-26 13:31:59.165 LOG <bbs-ep> [bbs-event-processor:1.0.0, env: {'CONSUL_HOST': u'consul-server.onap', 'SERVICE_TAGS': 'bbs-ep', 'CONFIG_BINDING_SERVICE': 'config-binding-service'}, kwargs: {'readiness': {u'endpoint': u'/heartbeat', u'type': u'http', u'timeout': u'5s', u'interval': u'180s'}, 'labels': {'cfydeployment': u'bbs-ep', 'cfynodeinstance': u'bbs-event-processor_yd5ucp', 'cfynode': u'bbs-event-processor'}, 'tls_info': {u'use_tls': True, u'cert_directory': u'/opt/app/bbs-event-processor/etc/cert'}, 'envs': {'SERVICE_TAGS': 'bbs-ep'}, 'liveness': {}, 'resource_config': {}, 'volumes': [], 'log_info': {u'log_directory': u'/opt/app/bbs-event-processor/logs'}, 'ports': [u'8100:30810'], 'k8s_location': u'central'} 2019-05-01 11:35:36.818_76rp5k.create] INFO: Added config for s636058386c6042289eaf4f55ada78500-bbs-event-processor 2020-03-26 13:31:59.795 CFY <bbs-ep> [bbs-event-processor_76rp5k.create] Task succeeded 'k8splugin.create_for_components' 2020-03-26 13:31:59.795 CFY <bbs-ep> [bbs-event-processor_76rp5k] Node instance created 2020-03-26 13:32:00.390 CFY <bbs-ep> [bbs-event-processor_76rp5k] Configuring node instance: nothing to do 2020-03-26 13:32:00.390 CFY <bbs-ep> [bbs-event-processor_76rp5k] Starting node instance 2020-03-26 13:32:00.390 CFY <bbs-ep> [bbs-event-processor_76rp5k.start] Sending task 'k8splugin.create_and_start_container_for_components' 2020-03-26 13:32:01.719 LOG <bbs-ep> [bbs-event-processor_yd5ucp76rp5k.start] INFO: PassingStarting k8sconfig: {'tls': {u'cert_path': u'/opt/tls/shared', u'image': u'k8s deployment for s636058386c6042289eaf4f55ada78500-bbs-event-processor, image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.deploymentscomponents.tlsbbs-initevent-containerprocessor:12.0.3-STAGING-latest'}, 'filebeat': {u'config_map': u'dcae-filebeat-configmap', u'config_path': u'/usr/share/filebeat/filebeat.yml', u'log_path0, env: {'DCAE_CA_CERTPATH': '/opt/app/bbs-event-processor/etc/cert/cacert.pem', 'CONSUL_HOST': u'consul-server.onap', u'SERVICE_TAGS': u'', 'CONFIG_BINDING_SERVICE': 'config-binding-service', 'CBS_CONFIG_URL': 'https://config-binding-service:10443/service_component_all/s636058386c6042289eaf4f55ada78500-bbs-event-processor'}, kwargs: {'readiness': {u'endpoint': u'/var/log/onapheartbeat', u'imagetype': u'docker.elastic.co/beats/filebeat:5.5.0http', u'data_pathtimeout': u'/usr/share/filebeat/data5s', u'config_subpathinterval': u'filebeat.yml180s'}, 'consul_dns_namelabels': {'cfydeployment': u'consulbbs-server.onapep', 'image_pull_secretscfynodeinstance': [u'onapbbs-docker-registry-key']event-processor_76rp5k', 'namespacecfynode': u'onapbbs-event-processor'}, 'consultls_hostinfo': 'consul-server:8500', 'default_k8s_location{u'use_tls': True, u'cert_directory': u'central'} 2019-05-01 11:35:36.818 LOG <bbs-ep> [bbs-event-processor_yd5ucp.start] INFO: k8s deployment initiated successfully for s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor: {'services': ['s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor', 'xs4d51b24f52264857b7ef520be9efc46b-bbs-event-processor'], 'namespace': u'onap', '/opt/app/bbs-event-processor/etc/cert'}, 'envs': {u'SERVICE_TAGS': u''}, 'liveness': {}, 'resource_config': {}, 'volumes': [], 'log_info': {u'log_directory': u'/opt/app/bbs-event-processor/logs'}, 'ports': [u'8100:30413'], 'k8s_location': u'central', 'deployment': 'dep-s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor'} 20192020-0503-0126 1113:3532:3602.818435 LOG <bbs-ep> [bbs-event-processor_yd5ucp76rp5k.start] INFO: WaitingPassing up to 1800 secs for s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor to become ready 2019-05-01 11:36:58.376 LOG <bbs-ep> [bbs-event-processor_yd5ucp.start] INFO: Done starting: s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor 2019-05-01 11:36:57.873 LOG <bbs-ep> [bbs-event-processor_yd5ucp.start] INFO: k8s deployment is ready for: s4d51b24f52264857b7ef520be9efc46b-bbs-event-processor 2019-05-01 11:36:59.119 CFY <bbs-ep> [bbs-event-processor_yd5ucp.start] Task succeeded 'k8splugin.create_and_start_container_for_components' 2019-05-01 11:36:59.119 CFYk8sconfig: {'tls': {u'component_cert_dir': u'/opt/dcae/cacert', u'cert_path': u'/opt/app/osaaf', u'image': u'nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tls-init-container:2.1.0', u'ca_cert_configmap': u'dev-dcae-bootstrap-dcae-cacert', u'component_ca_cert_path': u'/opt/dcae/cacert/cacert.pem'}, 'filebeat': {u'config_map': u'dev-dcae-filebeat-configmap', u'config_path': u'/usr/share/filebeat/filebeat.yml', u'log_path': u'/var/log/onap', u'image': u'docker.elastic.co/beats/filebeat:5.5.0', u'data_path': u'/usr/share/filebeat/data', u'config_subpath': u'filebeat.yml'}, 'consul_dns_name': u'consul-server.onap', 'image_pull_secrets': [u'onap-docker-registry-key'], 'namespace': u'onap', 'consul_host': 'consul-server:8500', 'cbs': {'base_url': 'https://config-binding-service:10443/service_component_all'}, 'default_k8s_location': u'central'} 2020-03-26 13:32:02.435 LOG <bbs-ep> [bbs-event-processor_yd5ucp] Node instance started 2019-05-01 11:36:59.119 CFY <bbs-ep> 'install' workflow execution succeeded Finished executing workflow install on deployment bbs-ep * Run 'cfy events list -e 7f285182-4f85-478c-95f3-b8b6970f7c8d' to retrieve the execution's events/logs |
RESTCONF Collector
Description: RESTConf Collector (BBS Usecase)
RESTCONF Collector blueprint:
RESTCONF Collector deployment procedure:
Code Block | ||||
---|---|---|---|---|
| ||||
root@onap-nfs:/home/ubuntu# kubectl exec -ti dev-dcae-bootstrap-7599b45c77-czxsx -n onap bash
bash-4.2$ cfy install -b restconf -d restconf /blueprints/k8s-restconf.yaml |
VES mapper
Description: VESMapper (BBS Usecase)
VES Mapper blueprint:
Code Block | ||||
---|---|---|---|---|
| ||||
bash-4.2$ cfy deployments create -b ves-mapper ves-mapper
Creating new deployment from blueprint ves-mapper...
Unable to create deployment. Not all deployment plugins are installed on the Manager.
* Use 'cfy plugins upload' to upload the missing plugins to the Manager, or use 'cfy deployments create' with the '--skip-plugins-validation' flag to skip this validation.
400: Required plugin k8splugin, version 1.4.13 is not installed on the manager |
VES Collector
Configure mapping VES event domain to DMaaP topic: ves-statechange --> unauthenticated.CPE_AUTHENTICATION
1) Access Consul UI: http://<consul_server_ui>:30270/ui/#/dc1/services
...
76rp5k.start] INFO: k8s deployment initiated successfully for s636058386c6042289eaf4f55ada78500-bbs-event-processor: {'services': ['s636058386c6042289eaf4f55ada78500-bbs-event-processor', 'xs636058386c6042289eaf4f55ada78500-bbs-event-processor'], 'namespace': u'onap', 'location': u'central', 'deployment': 'dep-s636058386c6042289eaf4f55ada78500-bbs-event-processor'}
2020-03-26 13:32:02.435 LOG <bbs-ep> [bbs-event-processor_76rp5k.start] INFO: Waiting up to 1800 secs for s636058386c6042289eaf4f55ada78500-bbs-event-processor to become ready
2020-03-26 13:33:25.482 LOG <bbs-ep> [bbs-event-processor_76rp5k.start] INFO: Done starting: s636058386c6042289eaf4f55ada78500-bbs-event-processor
2020-03-26 13:33:24.802 LOG <bbs-ep> [bbs-event-processor_76rp5k.start] INFO: k8s deployment is ready for: s636058386c6042289eaf4f55ada78500-bbs-event-processor
2020-03-26 13:33:25.482 CFY <bbs-ep> [bbs-event-processor_76rp5k.start] Task succeeded 'k8splugin.create_and_start_container_for_components'
2020-03-26 13:33:25.482 CFY <bbs-ep> [bbs-event-processor_76rp5k] Node instance started
2020-03-26 13:33:26.201 CFY <bbs-ep> 'install' workflow execution succeeded
Finished executing workflow install on deployment bbs-ep
* Run 'cfy events list -e 3c6d4861-4e15-4738-931d-60121a662a45' to retrieve the execution's events/logs
|
RESTCONF Collector
Description: RESTConf Collector (BBS Usecase)
RESTCONF Collector blueprint:
RESTCONF Collector deployment procedure:
Code Block | ||||
---|---|---|---|---|
| ||||
"vesroot@onap-statechange": {"type": "message_router", "dmaap_info": {"topic_url": "http://message-router:3904/events/unauthenticated.CPE_AUTHENTICATION"}} |
3) Click on UPDATE to apply the new configuration
SDNC
Make sure that BBS DGs in SDNC DGBuilder are in Active state
bbs-access-connectivity-vnf-topology-operation-create-huawei
bbs-access-connectivity-vnf-topology-operation-delete-huawei
bbs-internet-profile-vnf-topology-operation-change-huawei
bbs-internet-profile-vnf-topology-operation-common-huawei
bbs-internet-profile-vnf-topology-operation-create-huawei
bbs-internet-profile-vnf-topology-operation-delete-huawei
validate-bbs-vnf-input-parameters
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Access SDN M&C DG
Configure Access SDN M&C IP address in SDNC DG using dgbuilder. For instance:
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-create-huawei.json
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-delete-huawei.json
1) Export the relevant DG
2) Modify the IP address
3) Import back the DG and Activate it
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Edge SDN M&C DG
Configure Edge SDN M&C IP address in SDNC DG using dgbuilder. For instance:
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-common-huawei.json
1) Export the relevant DG
2) Modify the IP address
3) Import back the DG and Activate it
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Ref: Swisscom Edge SDN M&C and virtual BNG
Add SSL certificate of the 3rd party controller into the SDNC trust store
Code Block | ||||
---|---|---|---|---|
| ||||
kubectl exec -ti dev-sdnc-sdnc-0 -n onap -- bash
openssl s_client -connect <IP_ADDRESS_EXT_CTRL>:<PORT>
# copy server certificate and paste in /tmp/<CA_CERT_NAME>.crt
sudo keytool -importcert -file /tmp/<CA_CERT_NAME>.crt -alias <CA_CERT_NAME>_key -keystore truststore.onap.client.jks -storepass adminadmin
keytool -list -keystore truststore.onap.client.jks -storepass adminadmin | grep <CA_CERT_NAME> |
See
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Policy
Deploy BBS APEX Policy (master, apex-pdp image v2.3+)
1) Make Sure APEX PDP is running and in Active state
Code Block | ||||
---|---|---|---|---|
| ||||
API: GET
URL: {{POLICY-PAP-URL}}/policy/pap/v1/pdps |
2) Create the operational control loop APEX policy type
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST
URL: {{POLICY-API-URL}}/policy/api/v1/policytypes |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{
"tosca_definitions_version": "tosca_simple_yaml_1_0_0",
"policy_types": {
"onap.policies.controlloop.operational.Apex": {
"version": "1.0.0",
"description": "Operational Policy for Control Loops using the APEX PDP",
"properties": {
"engine_service": {
"type": "onap.datatypes.policies.controlloop.operational.apex.EngineService",
"description": "APEX Engine Service Parameters"
},
"inputs": {
"type": "map",
"description": "Inputs for handling events coming into the APEX engine",
"entry_schema": {
"type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
}
},
"outputs": {
"type": "map",
"description": "Outputs for handling events going out of the APEX engine",
"entry_schema": {
"type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler"
}
},
"environment": {
"type": "list",
"description": "Envioronmental parameters for the APEX engine",
"entry_schema": {
"type": "onap.datatypes.policies.controlloop.operational.apex.Environment"
}
}
}
}
},
"data_types": {
"onap.datatypes.policies.controlloop.operational.apex.EngineService": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"name": {
"type": "string",
"description": "Specifies the engine name",
"required": false,
"default": "ApexEngineService"
},
"version": {
"type": "string",
"description": "Specifies the engine version in double dotted format",
"required": false,
"default": "1.0.0"
},
"id": {
"type": "int",
"description": "Specifies the engine id",
"required": true
},
"instance_count": {
"type": "int",
"description": "Specifies the number of engine threads that should be run",
"required": true
},
"deployment_port": {
"type": "int",
"description": "Specifies the port to connect to for engine administration",
"required": false,
"default": 1
},
"policy_model_file_name": {
"type": "string",
"description": "The name of the file from which to read the APEX policy model",
"required": false,
"default": ""
},
"policy_type_impl": {
"type": "string",
"description": "The policy type implementation from which to read the APEX policy model",
"required": false,
"default": ""
},
"periodic_event_period": {
"type": "string",
"description": "The time interval in milliseconds for the periodic scanning event, 0 means \"don't scan\"",
"required": false,
"default": 0
},
"engine": {
"type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine",
"description": "The parameters for all engines in the APEX engine service",
"required": true
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.EventHandler": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"name": {
"type": "string",
"description": "Specifies the event handler name, if not specified this is set to the key name",
"required": false
},
"carrier_technology": {
"type": "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology",
"description": "Specifies the carrier technology of the event handler (such as REST/Web Socket/Kafka)",
"required": true
},
"event_protocol": {
"type": "onap.datatypes.policies.controlloop.operational.apex.EventProtocol",
"description": "Specifies the event protocol of events for the event handler (such as Yaml/JSON/XML/POJO)",
"required": true
},
"event_name": {
"type": "string",
"description": "Specifies the event name for events on this event handler, if not specified, the event name is read from or written to the event being received or sent",
"required": false
},
"event_name_filter": {
"type": "string",
"description": "Specifies a filter as a regular expression, events that do not match the filter are dropped, the default is to let all events through",
"required": false
},
"synchronous_mode": {
"type": "bool",
"description": "Specifies the event handler is syncronous (receive event and send response)",
"required": false,
"default": false
},
"synchronous_peer": {
"type": "string",
"description": "The peer event handler (output for input or input for output) of this event handler in synchronous mode, this parameter is mandatory if the event handler is in synchronous mode",
"required": false,
"default": ""
},
"synchronous_timeout": {
"type": "int",
"description": "The timeout in milliseconds for responses to be issued by APEX torequests, this parameter is mandatory if the event handler is in synchronous mode",
"required": false,
"default": ""
},
"requestor_mode": {
"type": "bool",
"description": "Specifies the event handler is in requestor mode (send event and wait for response mode)",
"required": false,
"default": false
},
"requestor_peer": {
"type": "string",
"description": "The peer event handler (output for input or input for output) of this event handler in requestor mode, this parameter is mandatory if the event handler is in requestor mode",
"required": false,
"default": ""
},
"requestor_timeout": {
"type": "int",
"description": "The timeout in milliseconds for wait for responses to requests, this parameter is mandatory if the event handler is in requestor mode",
"required": false,
"default": ""
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"label": {
"type": "string",
"description": "The label (name) of the carrier technology (such as REST, Kafka, WebSocket)",
"required": true
},
"plugin_parameter_class_name": {
"type": "string",
"description": "The class name of the class that overrides default handling of event input or output for this carrier technology, defaults to the supplied input or output class",
"required": false
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.EventProtocol": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"label": {
"type": "string",
"description": "The label (name) of the event protocol (such as Yaml, JSON, XML, or POJO)",
"required": true
},
"event_protocol_plugin_class": {
"type": "string",
"description": "The class name of the class that overrides default handling of the event protocol for this carrier technology, defaults to the supplied event protocol class",
"required": false
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.Environmental": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"name": {
"type": "string",
"description": "The name of the environment variable",
"required": true
},
"value": {
"type": "string",
"description": "The value of the environment variable",
"required": true
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"context": {
"type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context",
"description": "The properties for handling context in APEX engines, defaults to using Java maps for context",
"required": false
},
"executors": {
"type": "map",
"description": "The plugins for policy executors used in engines such as javascript, MVEL, Jython",
"required": true,
"entry_schema": {
"description": "The plugin class path for this policy executor",
"type": "string"
}
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"distributor": {
"type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
"description": "The plugin to be used for distributing context between APEX PDPs at runtime",
"required": false
},
"schemas": {
"type": "map",
"description": "The plugins for context schemas available in APEX PDPs such as Java and Avro",
"required": false,
"entry_schema": {
"type": "onap.datatypes.policies.controlloop.operational.apex.Plugin"
}
},
"locking": {
"type": "onap.datatypes.policies.controlloop.operational.apex.plugin",
"description": "The plugin to be used for locking context in and between APEX PDPs at runtime",
"required": false
},
"persistence": {
"type": "onap.datatypes.policies.controlloop.operational.apex.Plugin",
"description": "The plugin to be used for persisting context for APEX PDPs at runtime",
"required": false
}
}
},
"onap.datatypes.policies.controlloop.operational.apex.Plugin": {
"derived_from": "tosca.datatypes.Root",
"properties": {
"name": {
"type": "string",
"description": "The name of the executor such as Javascript, Jython or MVEL",
"required": true
},
"plugin_class_name": {
"type": "string",
"description": "The class path of the plugin class for this executor"
}
}
}
}
}
|
3) Create BBS APEX policy
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST
URL: {{POLICY-API-URL}}/policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ "tosca_definitions_version": "tosca_simple_yaml_1_0_0", "topology_template": { "policies": [ { "operational.onapbbs": { "type": "onap.policies.controlloop.operational.Apex", "typeVersion": "1.0.0", "name": "onap.policies.controlloop.operational.apex.onapbbs", "version": "1.0.0", "properties": { "engineServiceParameters": { "name": "NomadicONTPolicyModelEngine", "version": "0.0.1", "id": 101, "instanceCount": 4, "deploymentPort": 12345, "engineParameters": { "executorParameters": { "MVEL": { "parameterClassName": "org.onap.policy.apex.plugins.executor.mvel.MvelExecutorParameters" }, "JAVASCRIPT": { "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" } }, "contextParameters": { "parameterClassName": "org.onap.policy.apex.context.parameters.ContextParameters", "schemaParameters": { "Avro": { "parameterClassName": "org.onap.policy.apex.plugins.context.schema.avro.AvroSchemaHelperParameters" }, "Java": { "parameterClassName": "org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters", "jsonAdapters": { "Instant": { "adaptedClass": "java.time.Instant", "adaptorClass": "org.onap.policy.controlloop.util.Serialization$GsonInstantAdapter" } } } } } }, "policy_type_impl": { "apexPolicyModel": { "key": { "name": "NomadicONTPolicyModel", "version": "1.0.2" }, "keyInformation": { "key": { "name": "NomadicONTPolicyModel_KeyInfo", "version": "1.0.2" }, "keyInfoMap": { "entry": [ { "key": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "value": { "key": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "UUID": "2af956bf-4c3f-370b-8112-44d7eca870a7", "description": "Generated description for concept referred to by key \"AAIServiceAssignedTask:0.0.1\"" } }, { "key": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "value": { "key": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "UUID": "e1fcaf11-adce-3d40-90e2-9b74d523b7ba", "description": "Generated description for concept referred to by key \"AAIServiceCreateTask:0.0.1\"" } }, { "key": { "name": "AAI_CPE_AUTH_UPDATE", "version": "1.0.0" }, "value": { "key": { "name": "AAI_CPE_AUTH_UPDATE", "version": "1.0.0" }, "UUID": "11fbba56-9d56-398b-aa9f-8f1242384de5", "description": "Generated description for concept referred to by key \"AAI_CPE_AUTH_UPDATE:1.0.0\"" } }, { "key": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "value": { "key": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "UUID": "91964d94-023a-3039-bb27-da28d38206e6", "description": "Generated description for concept referred to by key \"AAI_SERVICE_ASSIGNED:1.0.0\"" } }, { "key": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "value": { "key": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "UUID": "5ee7ee54-2155-3e11-b899-8af74d8044ce", "description": "Generated description for concept referred to by key \"AAI_SERVICE_CREATE:1.0.0\"" } }, { "key": { "name": "CPEAuthenticationPolicy", "version": "0.0.1" }, "value": { "key": { "name": "CPEAuthenticationPolicy", "version": "0.0.1" }, "UUID": "f8c31efd-6755-3bd8-8720-b622e7e61a4d", "description": "Generated description for concept referred to by key \"CPEAuthenticationPolicy:0.0.1\"" } }, { "key": { "name": "CPE_Authentication", "version": "1.0.2" }, "value": { "key": { "name": "CPE_Authentication", "version": "1.0.2" }, "UUID": "7fe1283a-ff26-3fdc-9856-bcebd2f7b3d2", "description": "Generated description for concept referred to by key \"CPE_Authentication:1.0.2\"" } }, { "key": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "value": { "key": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "UUID": "e5b7f639-1586-3a51-a968-6315e0b79f27", "description": "Generated description for concept referred to by key \"END_CONTROL_LOOP:1.0.0\"" } }, { "key": { "name": "END_EVENT", "version": "1.0.0" }, "value": { "key": { "name": "END_EVENT", "version": "1.0.0" }, "UUID": "0378736c-46f7-39fb-9e89-3c34e124ade1", "description": "Generated description for concept referred to by key \"END_EVENT:1.0.0\"" } }, { "key": { "name": "ERROR_LOG", "version": "1.0.0" }, "value": { "key": { "name": "ERROR_LOG", "version": "1.0.0" }, "UUID": "a220439e-cc77-3a05-8ac9-773ab68f417e", "description": "Generated description for concept referred to by key \"ERROR_LOG:1.0.0\"" } }, { "key": { "name": "ErrorAAIServiceAssignedLogTask", "version": "0.0.1" }, "value": { "key": { "name": "ErrorAAIServiceAssignedLogTask", "version": "0.0.1" }, "UUID": "4b5311bb-b3e8-31f6-9ea1-0fd026d739d7", "description": "Generated description for concept referred to by key \"ErrorAAIServiceAssignedLogTask:0.0.1\"" } }, { "key": { "name": "ErrorSdncResourceUpdateTaskLogTask", "version": "0.0.1" }, "value": { "key": { "name": "ErrorSdncResourceUpdateTaskLogTask", "version": "0.0.1" }, "UUID": "daa86721-a761-334f-96bf-6f5c781f65ed", "description": "Generated description for concept referred to by key \"ErrorSdncResourceUpdateTaskLogTask:0.0.1\"" } }, { "key": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "value": { "key": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "UUID": "0791e26f-5d94-3cee-991c-31f226e83c4e", "description": "Generated description for concept referred to by key \"GetBBSCloseLoopEventTask:0.0.1\"" } }, { "key": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "value": { "key": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "UUID": "6fe3e6f7-a429-3979-9146-db0fa239591b", "description": "Generated description for concept referred to by key \"NomadicEventSuccessTask:0.0.1\"" } }, { "key": { "name": "NomadicONTContextAlbum", "version": "0.0.1" }, "value": { "key": { "name": "NomadicONTContextAlbum", "version": "0.0.1" }, "UUID": "3d9cf947-a5ef-3781-8c70-ec0e94f65693", "description": "Generated description for concept referred to by key \"NomadicONTContextAlbum:0.0.1\"" } }, { "key": { "name": "NomadicONTContextType", "version": "0.0.1" }, "value": { "key": { "name": "NomadicONTContextType", "version": "0.0.1" }, "UUID": "b9508c97-79b6-35ec-8e45-731eac9d37cc", "description": "Generated description for concept referred to by key \"NomadicONTContextType:0.0.1\"" } }, { "key": { "name": "NomadicONTPolicyModel", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel", "version": "1.0.2" }, "UUID": "457e3fcf-a901-37b2-bfc0-14d56abfc507", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_Albums", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_Albums", "version": "1.0.2" }, "UUID": "9a0edd63-7d9b-3122-8750-d6a17c248f0f", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_Albums:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_Events", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_Events", "version": "1.0.2" }, "UUID": "82ff2635-a05e-3b3e-ae59-526735db78fc", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_Events:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_KeyInfo", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_KeyInfo", "version": "1.0.2" }, "UUID": "530bcf35-a3cb-305a-8b41-0499945b510f", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_KeyInfo:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_Policies", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_Policies", "version": "1.0.2" }, "UUID": "9223db37-fb3b-3b3f-a85b-eb7e7b3a4e10", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_Policies:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_Schemas", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_Schemas", "version": "1.0.2" }, "UUID": "41ba496f-6bfb-31e7-972e-6b2fab3e7d52", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_Schemas:1.0.2\"" } }, { "key": { "name": "NomadicONTPolicyModel_Tasks", "version": "1.0.2" }, "value": { "key": { "name": "NomadicONTPolicyModel_Tasks", "version": "1.0.2" }, "UUID": "c337fda0-0a48-3329-af48-ed710214c092", "description": "Generated description for concept referred to by key \"NomadicONTPolicyModel_Tasks:1.0.2\"" } }, { "key": { "name": "Nomadic_ONT", "version": "1.0.2" }, "value": { "key": { "name": "Nomadic_ONT", "version": "1.0.2" }, "UUID": "b375c6f5-19ca-390f-ba19-2a0a49f233af", "description": "Generated description for concept referred to by key \"Nomadic_ONT:1.0.2\"" } }, { "key": { "name": "ONTRegistrationPolicy", "version": "0.0.1" }, "value": { "key": { "name": "ONTRegistrationPolicy", "version": "0.0.1" }, "UUID": "45773f7e-e1f6-3286-8f82-144836629edb", "description": "Generated description for concept referred to by key \"ONTRegistrationPolicy:0.0.1\"" } }, { "key": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "value": { "key": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "UUID": "c8fe0156-80c7-3e8d-8aa8-56be04fb1147", "description": "Generated description for concept referred to by key \"SDNC_RESOURCE_UPDATE:1.0.0\"" } }, { "key": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "value": { "key": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "UUID": "db7d3e67-12a8-35c8-b063-bc2a1fd77662", "description": "Generated description for concept referred to by key \"SdncResourceUpdateTask:0.0.1\"" } }, { "key": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "value": { "key": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "UUID": "78fa10b8-23e9-3362-893a-0dd7a656c7b6", "description": "Generated description for concept referred to by key \"ServiceUpdateStateCpeAuthTask:0.0.1\"" } }, { "key": { "name": "SimpleBooleanType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleBooleanType", "version": "0.0.1" }, "UUID": "7218fb2f-59e3-321d-9ae1-bc97b19eb4ae", "description": "Generated description for concept referred to by key \"SimpleBooleanType:0.0.1\"" } }, { "key": { "name": "SimpleLongType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleLongType", "version": "0.0.1" }, "UUID": "2dfcd9ec-a6f9-3f9f-958f-9b36cf4ac574", "description": "Generated description for concept referred to by key \"SimpleLongType:0.0.1\"" } }, { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "UUID": "8a4957cf-9493-3a76-8c22-a208e23259af", "description": "Generated description for concept referred to by key \"SimpleStringType:0.0.1\"" } }, { "key": { "name": "UUIDType", "version": "0.0.1" }, "value": { "key": { "name": "UUIDType", "version": "0.0.1" }, "UUID": "6a8cc68e-dfc8-3403-9c6d-071c886b319c", "description": "Generated description for concept referred to by key \"UUIDType:0.0.1\"" } }, { "key": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "value": { "key": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "UUID": "15aca887-8f6c-3713-8114-0f49f03adab7", "description": "Generated description for concept referred to by key \"VirtualControlLoopEventType:0.0.1\"" } } ] } }, "policies": { "key": { "name": "NomadicONTPolicyModel_Policies", "version": "1.0.2" }, "policyMap": { "entry": [ { "key": { "name": "CPEAuthenticationPolicy", "version": "0.0.1" }, "value": { "policyKey": { "name": "CPEAuthenticationPolicy", "version": "0.0.1" }, "template": "Freestyle", "state": { "entry": [ { "key": "INIT", "value": { "stateKey": { "parentKeyName": "CPEAuthenticationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "INIT" }, "trigger": { "name": "CPE_Authentication", "version": "1.0.2" }, "stateOutputs": { "entry": [ { "key": "ServiceUpdateCpeAuthOutPut", "value": { "key": { "parentKeyName": "CPEAuthenticationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "ServiceUpdateCpeAuthOutPut" }, "outgoingEvent": { "name": "AAI_CPE_AUTH_UPDATE", "version": "1.0.0" }, "nextState": { "parentKeyName": "NULL", "parentKeyVersion": "0.0.0", "parentLocalName": "NULL", "localName": "NULL" } } } ] }, "contextAlbumReference": [], "taskSelectionLogic": { "key": "NULL", "logicFlavour": "UNDEFINED", "logic": "" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "CPEAuthenticationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "CPEAuthenticationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "CPEAuthenticationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "ServiceUpdateCpeAuthOutPut" } } } ] } } } ] }, "firstState": "INIT" } }, { "key": { "name": "ONTRegistrationPolicy", "version": "0.0.1" }, "value": { "policyKey": { "name": "ONTRegistrationPolicy", "version": "0.0.1" }, "template": "Freestyle", "state": { "entry": [ { "key": "AAI_SERVICE_ASSIGN", "value": { "stateKey": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "AAI_SERVICE_ASSIGN" }, "trigger": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "stateOutputs": { "entry": [ { "key": "AAIServiceAssignedOutput", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_ASSIGN", "localName": "AAIServiceAssignedOutput" }, "outgoingEvent": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "nextState": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "SDNC_RES_UPDATE" } } } ] }, "contextAlbumReference": [], "taskSelectionLogic": { "key": "NULL", "logicFlavour": "UNDEFINED", "logic": "" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_ASSIGN", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_ASSIGN", "localName": "AAIServiceAssignedOutput" } } } ] } } }, { "key": "AAI_SERVICE_CREATE", "value": { "stateKey": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "AAI_SERVICE_CREATE" }, "trigger": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "stateOutputs": { "entry": [ { "key": "AAIServiceCreateTaskOutput", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "AAIServiceCreateTaskOutput" }, "outgoingEvent": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "nextState": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "NOMADIC_ONT_REG_SUCCESS" } } }, { "key": "SdncResourceUpdateErrorLogOutput", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "SdncResourceUpdateErrorLogOutput" }, "outgoingEvent": { "name": "ERROR_LOG", "version": "1.0.0" }, "nextState": { "parentKeyName": "NULL", "parentKeyVersion": "0.0.0", "parentLocalName": "NULL", "localName": "NULL" } } } ] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskSelectionLogic": { "key": "TaskSelectionLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nexecutor.logger.info(\"Begin Execution SU2orInitStateSelect.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar returnValue = executor.isTrue;\nvar result = null;\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(\n attachmentPoint);\n\nexecutor.logger.info(executor.inFields);\n\nresult = NomadicONTContext.get(\"result\");\n\nif (result === \"SUCCESS\") {\n executor.subject.getTaskKey(\"AAIServiceCreateTask\").copyTo(executor.selectedTask);\n} else {\n executor.subject.getTaskKey(\"SdncResourceUpdateErrorLogOutput\").copyTo(\n executor.selectedTask);\n onsetFlag = executor.isFalse;\n}\n\nexecutor.logger.info(\"State Selected Task:\" + executor.selectedTask);\nexecutor.logger.info(\"End Execution SU2orInitStateSelect.js\");" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "AAIServiceCreateTaskOutput" } } }, { "key": { "name": "ErrorSdncResourceUpdateTaskLogTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "AAI_SERVICE_CREATE", "localName": "SdncResourceUpdateErrorLogOutput" } } } ] } } }, { "key": "INIT", "value": { "stateKey": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "INIT" }, "trigger": { "name": "Nomadic_ONT", "version": "1.0.2" }, "stateOutputs": { "entry": [ { "key": "BBSCloseLoopEventOutPut", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "BBSCloseLoopEventOutPut" }, "outgoingEvent": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "nextState": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "AAI_SERVICE_ASSIGN" } } } ] }, "contextAlbumReference": [], "taskSelectionLogic": { "key": "NULL", "logicFlavour": "UNDEFINED", "logic": "" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "INIT", "localName": "BBSCloseLoopEventOutPut" } } } ] } } }, { "key": "NOMADIC_ONT_REG_SUCCESS", "value": { "stateKey": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "NOMADIC_ONT_REG_SUCCESS" }, "trigger": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "stateOutputs": { "entry": [ { "key": "NomadicEventSuccessOutPut", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NOMADIC_ONT_REG_SUCCESS", "localName": "NomadicEventSuccessOutPut" }, "outgoingEvent": { "name": "END_EVENT", "version": "1.0.0" }, "nextState": { "parentKeyName": "NULL", "parentKeyVersion": "0.0.0", "parentLocalName": "NULL", "localName": "NULL" } } } ] }, "contextAlbumReference": [], "taskSelectionLogic": { "key": "NULL", "logicFlavour": "UNDEFINED", "logic": "" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NOMADIC_ONT_REG_SUCCESS", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NOMADIC_ONT_REG_SUCCESS", "localName": "NomadicEventSuccessOutPut" } } } ] } } }, { "key": "SDNC_RES_UPDATE", "value": { "stateKey": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "SDNC_RES_UPDATE" }, "trigger": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "stateOutputs": { "entry": [ { "key": "AAIServiceAssignedErrorLogOutput", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "AAIServiceAssignedErrorLogOutput" }, "outgoingEvent": { "name": "ERROR_LOG", "version": "1.0.0" }, "nextState": { "parentKeyName": "NULL", "parentKeyVersion": "0.0.0", "parentLocalName": "NULL", "localName": "NULL" } } }, { "key": "SdncResourceUpdateOutput", "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "SdncResourceUpdateOutput" }, "outgoingEvent": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "nextState": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "AAI_SERVICE_CREATE" } } } ] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskSelectionLogic": { "key": "TaskSelectionLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nexecutor.logger.info(\"Begin Execution RUorInitStateSelect.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar returnValue = executor.isTrue;\nvar result = null;\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(\n attachmentPoint);\n\nresult = NomadicONTContext.get(\"result\");\n\nif (result === \"SUCCESS\") {\n executor.subject.getTaskKey(\"SdncResourceUpdateTask\").copyTo(executor.selectedTask);\n} else {\n executor.subject.getTaskKey(\"ErrorAAIServiceAssignedLogTask\").copyTo(\n executor.selectedTask);\n onsetFlag = executor.isFalse;\n}\n\nexecutor.logger.info(\"State Selected Task:\" + executor.selectedTask);\nexecutor.logger.info(\"End Execution RUorInitStateSelect.js\");" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "ErrorAAIServiceAssignedLogTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "AAIServiceAssignedErrorLogOutput" } } }, { "key": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "ONTRegistrationPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "ONTRegistrationPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "SDNC_RES_UPDATE", "localName": "SdncResourceUpdateOutput" } } } ] } } } ] }, "firstState": "INIT" } } ] } }, "tasks": { "key": { "name": "NomadicONTPolicyModel_Tasks", "version": "1.0.2" }, "taskMap": { "entry": [ { "key": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "value": { "key": { "name": "AAIServiceAssignedTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * Modifications Copyright (C) 2019 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.apache.avro.Schema);\nimportClass(java.io.BufferedReader);\nimportClass(java.io.IOException);\nimportClass(java.nio.file.Files);\nimportClass(java.nio.file.Paths);\n\nexecutor.logger.info(\"Begin Execution AAIServiceAssignedTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar requestID = executor.inFields.get(\"requestID\");\nvar serviceInstanceId = executor.inFields.get(\"serviceInstanceId\");\n\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(attachmentPoint);\nexecutor.logger.info(NomadicONTContext);\n\nvar jsonObj;\nvar aaiUpdateResult = true;\n\nvar wbClient = Java.type(\"org.onap.policy.apex.examples.bbs.WebClient\");\nvar client = new wbClient();\n\n/* Get AAI URL from Configuration file. */\nvar AAI_URL = \"localhost:8080\";\nvar CUSTOMER_ID = requestID;\nvar SERVICE_INSTANCE_ID = serviceInstanceId;\nvar AAI_VERSION = \"v14\";\nvar resource_version;\nvar relationship_list;\nvar HTTP_PROTOCOL = \"https://\";\nvar results;\nvar putUrl;\nvar service_instance;\ntry {\n var br = Files.newBufferedReader(Paths.get(\"/home/apexuser/examples/config/ONAPBBS/config.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n if (line.startsWith(\"AAI_URL\")) {\n var str = line.split(\"=\");\n AAI_URL = str[str.length - 1];\n } else if (line.startsWith(\"AAI_USERNAME\")) {\n var str = line.split(\"=\");\n AAI_USERNAME = str[str.length - 1];\n } else if (line.startsWith(\"AAI_PASSWORD\")) {\n var str = line.split(\"=\");\n AAI_PASSWORD = str[str.length - 1];\n } else if (line.startsWith(\"AAI_VERSION\")) {\n var str = line.split(\"=\");\n AAI_VERSION = str[str.length - 1];\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\n\nexecutor.logger.info(\"AAI_URL \" + AAI_URL);\n\n/* Get service instance Id from AAI */\ntry {\n var urlGet = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION + \"/nodes/service-instances/service-instance/\"\n + SERVICE_INSTANCE_ID + \"?format=resource_and_url\";\n\n executor.logger.info(\"Query url\" + urlGet);\n\n result = client.httpRequest(urlGet, \"GET\", null, AAI_USERNAME, AAI_PASSWORD, \"application/json\");\n executor.logger.info(\"Data received From \" + urlGet + \" \" + result);\n jsonObj = JSON.parse(result.toString());\n\n executor.logger.info(JSON.stringify(jsonObj, null, 4));\n /* Retrieve the service instance id */\n results = jsonObj['results'][0];\n putUrl = results['url'];\n service_instance = results['service-instance'];\n service_instance_id = service_instance['service-instance-id'];\n resource_version = service_instance['resource-version'];\n relationship_list = service_instance['relationship-list'];\n executor.logger.info(\"After Parse service_instance \" + JSON.stringify(service_instance, null, 4) + \"\\n url \"\n + putUrl + \"\\n Service instace Id \" + service_instance_id);\n\n if (result == \"\") {\n aaiUpdateResult = false;\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\n/* BBS Policy updates orchestration status of {{bbs-cfs-service-instance-UUID}} [ active --> assigned ] */\nvar putUpddateServInstance;\nputUpddateServInstance = service_instance;\ntry {\n if (aaiUpdateResult == true) {\n putUpddateServInstance[\"orchestration-status\"] = \"active\";\n executor.logger.info(\"ready to putAfter Parse \" + JSON.stringify(putUpddateServInstance, null, 4));\n var urlPut = HTTP_PROTOCOL + AAI_URL + putUrl + \"?resource_version=\" + resource_version;\n result = client.httpRequest(urlPut, \"PUT\", JSON.stringify(putUpddateServInstance), AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Data received From \" + urlPut + \" \" + result);\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\nif (!service_instance.hasOwnProperty('input-parameters') || !service_instance.hasOwnProperty('metadata')) {\n aaiUpdateResult = false;\n executor.logger.info(\"Validate data failed. input-parameters or metadata is missing\");\n}\n\n/* update logical link in pnf */\nvar oldLinkName = \"\";\ntry {\n if (aaiUpdateResult == true) {\n var pnfName = \"\";\n var pnfResponse;\n var pnfUpdate;\n var relationShips = relationship_list[\"relationship\"];\n\n for (var i = 0; i < relationShips.length; i++) {\n if (relationShips[i][\"related-to\"] == \"pnf\") {\n var relationship_data = relationShips[i][\"relationship-data\"];\n for (var j = 0; j < relationship_data.length; j++) {\n if (relationship_data[j][\"relationship-key\"] == \"pnf.pnf-name\") {\n pnfName = relationship_data[j]['relationship-value'];\n break;\n }\n }\n }\n }\n executor.logger.info(\"pnf-name found \" + pnfName);\n\n /* 1. Get PNF */\n var urlGetPnf = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION + \"/network/pnfs/pnf/\" + pnfName;\n pnfResponse = client.httpRequest(urlGetPnf, \"GET\", null, AAI_USERNAME, AAI_PASSWORD, \"application/json\");\n executor.logger.info(\"Data received From \" + urlGetPnf + \" \" + pnfResponse);\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n pnfUpdate = JSON.parse(pnfResponse.toString());\n executor.logger.info(JSON.stringify(pnfUpdate, null, 4));\n\n /* 2. Create logical link */\n var link_name = attachmentPoint;\n var logicalLink = {\n \"link-name\" : link_name,\n \"in-maint\" : false,\n \"link-type\" : \"attachment-point\"\n };\n var urlNewLogicalLink = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION\n + \"/network/logical-links/logical-link/\" + link_name;\n result = client.httpRequest(urlNewLogicalLink, \"PUT\", JSON.stringify(logicalLink), AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Data received From \" + urlNewLogicalLink + \" \" + result);\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n\n /* 3. Update pnf with new relation */\n for (var i = 0; i < pnfUpdate[\"relationship-list\"][\"relationship\"].length; i++) {\n if (pnfUpdate[\"relationship-list\"][\"relationship\"][i]['related-to'] == 'logical-link') {\n pnfUpdate[\"relationship-list\"][\"relationship\"][i]['related-link'] = \"/aai/\" + AAI_VERSION\n + \"/network/logical-links/logical-link/\" + link_name;\n for (var j = 0; j < pnfUpdate[\"relationship-list\"][\"relationship\"][i]['relationship-data'].length; j++) {\n if (pnfUpdate[\"relationship-list\"][\"relationship\"][i]['relationship-data'][j]['relationship-key'] == \"logical-link.link-name\") {\n oldLinkName = pnfUpdate[\"relationship-list\"][\"relationship\"][i]['relationship-data'][j]['relationship-value'];\n pnfUpdate[\"relationship-list\"][\"relationship\"][i]['relationship-data'][j]['relationship-value'] = link_name;\n break;\n }\n }\n break;\n }\n }\n\n executor.logger.info(\"Put pnf to aai \" + JSON.stringify(pnfUpdate, null, 4));\n var urlPutPnf = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION + \"/network/pnfs/pnf/\" + pnfName;\n result = client.httpRequest(urlPutPnf, \"PUT\", JSON.stringify(pnfUpdate), AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Data received From \" + urlPutPnf + \" \" + result);\n\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n\n /* Get and Delete the Stale logical link */\n var oldLinkResult;\n var linkResult;\n var urlOldLogicalLink = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION\n + \"/network/logical-links/logical-link/\" + oldLinkName;\n linkResult = client.httpRequest(urlOldLogicalLink, \"GET\", null, AAI_USERNAME, AAI_PASSWORD, \"application/json\");\n executor.logger.info(\"Data received From \" + urlOldLogicalLink + \" \" + linkResult + \" \"\n + linkResult.hasOwnProperty(\"link-name\"));\n oldLinkResult = JSON.parse(linkResult.toString());\n if (oldLinkResult.hasOwnProperty(\"link-name\") == true) {\n var res_version = oldLinkResult[\"resource-version\"];\n var urlDelOldLogicalLink = urlOldLogicalLink + \"?resource-version=\" + res_version;\n executor.logger.info(\"Delete called for \" + urlDelOldLogicalLink);\n result = client.httpRequest(urlDelOldLogicalLink, \"DELETE\", null, AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Delete called for \" + urlDelOldLogicalLink + \" result \" + result);\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\n/* If Success then Fill output schema */\nif (aaiUpdateResult === true) {\n executor.outFields.put(\"result\", \"SUCCESS\");\n NomadicONTContext.put(\"result\", \"SUCCESS\");\n NomadicONTContext.put(\"aai_message\", JSON.stringify(service_instance));\n NomadicONTContext.put(\"url\", putUrl);\n} else {\n executor.outFields.put(\"result\", \"FAILURE\");\n NomadicONTContext.put(\"result\", \"FAILURE\");\n}\n\nexecutor.outFields.put(\"requestID\", requestID);\nexecutor.outFields.put(\"attachmentPoint\", attachmentPoint);\nexecutor.outFields.put(\"serviceInstanceId\", executor.inFields.get(\"serviceInstanceId\"));\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(executor.outFields);\nexecutor.logger.info(\"End Execution AAIServiceAssignedTask.js\");\n\n/* Utility functions Begin */\nfunction IsValidJSONString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}\n/* Utility functions End */" } } }, { "key": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "value": { "key": { "name": "AAIServiceCreateTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * Modifications Copyright (C) 2019 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.apache.avro.Schema);\nimportClass(java.io.BufferedReader);\nimportClass(java.io.IOException);\nimportClass(java.nio.file.Files);\nimportClass(java.nio.file.Paths);\n\nexecutor.logger.info(\"Begin Execution AAIServiceCreateTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar requestID = executor.inFields.get(\"requestID\");\nvar serviceInstanceId = executor.inFields.get(\"serviceInstanceId\");\n\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(attachmentPoint);\nexecutor.logger.info(NomadicONTContext);\n\n// Get the AAI URL from configuraiotn file\nvar AAI_URL = \"localhost:8080\";\nvar CUSTOMER_ID = requestID;\nvar BBS_CFS_SERVICE_TYPE = \"BBS-CFS-Access_Test\";\nvar SERVICE_INSTANCE_ID = serviceInstanceId;\nvar AAI_VERSION = \"v14\";\nvar HTTP_PROTOCOL = \"https://\";\nvar wbClient = Java.type(\"org.onap.policy.apex.examples.bbs.WebClient\");\nvar client = new wbClient();\nvar AAI_USERNAME = null;\nvar AAI_PASSWORD = null;\ntry {\n var br = Files.newBufferedReader(Paths.get(\"/home/apexuser/examples/config/ONAPBBS/config.txt\"));\n // read line by line\n var line;\n while ((line = br.readLine()) != null) {\n if (line.startsWith(\"AAI_URL\")) {\n var str = line.split(\"=\");\n AAI_URL = str[str.length - 1];\n } else if (line.startsWith(\"AAI_USERNAME\")) {\n var str = line.split(\"=\");\n AAI_USERNAME = str[str.length - 1];\n } else if (line.startsWith(\"AAI_PASSWORD\")) {\n var str = line.split(\"=\");\n AAI_PASSWORD = str[str.length - 1];\n } else if (line.startsWith(\"AAI_VERSION\")) {\n var str = line.split(\"=\");\n AAI_VERSION = str[str.length - 1];\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\nexecutor.logger.info(\"AAI_URL \" + AAI_URL);\nvar aaiUpdateResult = true;\n/* Get service instance Id from AAI */\ntry {\n var urlGet = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION + \"/nodes/service-instances/service-instance/\"\n + SERVICE_INSTANCE_ID + \"?format=resource_and_url\";\n\n executor.logger.info(\"Query url\" + urlGet);\n\n result = client.httpRequest(urlGet, \"GET\", null, AAI_USERNAME, AAI_PASSWORD, \"application/json\");\n executor.logger.info(\"Data received From \" + urlGet + \" \" + result);\n jsonObj = JSON.parse(result);\n\n executor.logger.info(JSON.stringify(jsonObj, null, 4));\n /* Retrieve the service instance id */\n results = jsonObj['results'][0];\n putUrl = results['url'];\n service_instance = results['service-instance'];\n executor.logger.info(\"After Parse service_instance \" + JSON.stringify(service_instance, null, 4) + \"\\n url \"\n + putUrl + \"\\n Service instace Id \" + SERVICE_INSTANCE_ID);\n\n if (result == \"\") {\n aaiUpdateResult = false;\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\nvar putUpddateServInstance = service_instance;\nputUpddateServInstance['orchestration-status'] = \"created\";\nexecutor.logger.info(\" string\" + JSON.stringify(putUpddateServInstance, null, 4));\nvar resource_version = putUpddateServInstance['resource-version'];\nvar putUrl = NomadicONTContext.get(\"url\");\n\n/* BBS Policy updates {{bbs-cfs-service-instance-UUID}} orchestration-status [ assigned --> created ] */\ntry {\n if (aaiUpdateResult == true) {\n executor.logger.info(\"ready to putAfter Parse \" + JSON.stringify(putUpddateServInstance, null, 4));\n var urlPut = HTTP_PROTOCOL + AAI_URL + putUrl + \"?resource_version=\" + resource_version;\n result = client.httpRequest(urlPut, \"PUT\", JSON.stringify(putUpddateServInstance), AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Data received From \" + urlPut + \" \" + result);\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n/* If Success then Fill output schema */\nif (aaiUpdateResult === true) {\n NomadicONTContext.put(\"result\", \"SUCCESS\");\n} else {\n NomadicONTContext.put(\"result\", \"FAILURE\");\n\n}\n\nexecutor.outFields.put(\"requestID\", requestID);\nexecutor.outFields.put(\"attachmentPoint\", attachmentPoint);\nexecutor.outFields.put(\"serviceInstanceId\", executor.inFields.get(\"serviceInstanceId\"));\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(executor.outFields);\nexecutor.logger.info(\"End Execution AAIServiceCreateTask.js\");" } } }, { "key": { "name": "ErrorAAIServiceAssignedLogTask", "version": "0.0.1" }, "value": { "key": { "name": "ErrorAAIServiceAssignedLogTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "errorLogParam", "value": { "key": "errorLogParam", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nexecutor.logger.info(\"Begin Execution ErrorServiceUpdateOneLogTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nexecutor.logger.info(executor.outFields);\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(\"Begin Execution ErrorServiceUpdateOneLogTask.js\");" } } }, { "key": { "name": "ErrorSdncResourceUpdateTaskLogTask", "version": "0.0.1" }, "value": { "key": { "name": "ErrorSdncResourceUpdateTaskLogTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "errorLogParam", "value": { "key": "errorLogParam", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nexecutor.logger.info(\"Begin Execution ErrorResourceUpdateLogTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(\"End Execution ErrorResourceUpdateLogTask.js\");" } } }, { "key": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "value": { "key": { "name": "GetBBSCloseLoopEventTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "VirtualControlLoopEvent", "value": { "key": "VirtualControlLoopEvent", "fieldSchemaKey": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "optional": false } } ] }, "outputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\n\nexecutor.logger.info(\"Begin Execution GetBBSCloseLoopEventTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\nvar returnValue = executor.isTrue;\n\nvar clEventType = Java.type(\n \"org.onap.policy.controlloop.VirtualControlLoopEvent\");\nvar clEvent = executor.inFields.get(\"VirtualControlLoopEvent\");\nexecutor.logger.info(clEvent.toString());\nexecutor.logger.info(clEvent.getClosedLoopControlName());\n\nvar requestID = clEvent.getRequestId();\nexecutor.logger.info(\"requestID = \" + requestID);\nvar attachmentPoint = null;\nvar NomadicONTContext = null;\nvar serviceInstanceId = null;\n\nif (clEvent.getAai().get(\"attachmentPoint\") != null) {\n attachmentPoint = clEvent.getAai().get(\"attachmentPoint\");\n executor.logger.info(\"attachmentPoint = \" + attachmentPoint);\n NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(\n attachmentPoint);\n serviceInstanceId = clEvent.getAai().get(\n \"service-information.hsia-cfs-service-instance-id\");\n executor.logger.info(\"serviceInstanceId = \" + serviceInstanceId);\n\n if (NomadicONTContext == null) {\n executor.logger.info(\n \"Creating context information for new ONT Device \\\"\" +\n attachmentPoint.toString() + \"\\\"\");\n\n NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").getSchemaHelper()\n .createNewInstance();\n\n NomadicONTContext.put(\"closedLoopControlName\", clEvent.getClosedLoopControlName());\n NomadicONTContext.put(\"closedLoopAlarmStart\", clEvent.getClosedLoopAlarmStart()\n .toEpochMilli());\n NomadicONTContext.put(\"closedLoopEventClient\", clEvent.getClosedLoopEventClient());\n NomadicONTContext.put(\"closedLoopEventStatus\", clEvent.getClosedLoopEventStatus()\n .toString());\n NomadicONTContext.put(\"version\", clEvent.getVersion());\n NomadicONTContext.put(\"requestID\", clEvent.getRequestId().toString());\n NomadicONTContext.put(\"target_type\", clEvent.getTargetType().toString());\n NomadicONTContext.put(\"target\", clEvent.getTarget());\n NomadicONTContext.put(\"from\", clEvent.getFrom());\n NomadicONTContext.put(\"policyScope\", \"Nomadic ONT\");\n NomadicONTContext.put(\"policyName\", clEvent.getPolicyName());\n NomadicONTContext.put(\"policyVersion\", \"1.0.0\");\n NomadicONTContext.put(\"notificationTime\", java.lang.System.currentTimeMillis());\n NomadicONTContext.put(\"message\", \"\");\n NomadicONTContext.put(\"result\", \"SUCCESS\");\n var aaiInfo = executor.getContextAlbum(\"NomadicONTContextAlbum\").getSchemaHelper()\n .createNewSubInstance(\"VCPE_AAI_Type\");\n\n aaiInfo.put(\"attachmentPoint\", clEvent.getAai().get(\"attachmentPoint\"));\n aaiInfo.put(\"cvlan\", clEvent.getAai().get(\"cvlan\"));\n aaiInfo.put(\"service_information_hsia_cfs_service_instance_id\", clEvent\n .getAai().get(\n \"service-information.hsia-cfs-service-instance-id\"));\n aaiInfo.put(\"svlan\", clEvent.getAai().get(\"svlan\"));\n aaiInfo.put(\"remoteId\", clEvent.getAai().get(\"remoteId\"));\n\n\n NomadicONTContext.put(\"AAI\", aaiInfo);\n\n if (clEvent.getClosedLoopAlarmEnd() != null) {\n NomadicONTContext.put(\"closedLoopAlarmEnd\", clEvent.getClosedLoopAlarmEnd()\n .toEpochMilli());\n } else {\n NomadicONTContext.put(\"closedLoopAlarmEnd\", java.lang.Long.valueOf(\n 0));\n }\n\n executor.getContextAlbum(\"NomadicONTContextAlbum\").put(attachmentPoint.toString(),\n NomadicONTContext);\n executor.logger.info(\"Created context information for new vCPE VNF \\\"\" +\n attachmentPoint.toString() + \"\\\"\");\n }\n\n executor.outFields.put(\"requestID\", requestID);\n executor.outFields.put(\"attachmentPoint\", attachmentPoint);\n executor.outFields.put(\"serviceInstanceId\", serviceInstanceId);\n executor.logger.info(executor.outFields);\n executor.logger.info(\"Event Successfully Received and stored in album\");\n}\nelse\n{\n executor.message = \"Received NULL attachment-point\";\n returnValue = executor.isFalse;\n}" } } }, { "key": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "value": { "key": { "name": "NomadicEventSuccessTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.apache.avro.Schema);\n\nexecutor.logger.info(\"Begin Execution NomadicEventSuccess.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(\n attachmentPoint);\n\nexecutor.logger.info(executor.outFields);\nexecutor.logger.info(executor.inFields);\n\nresult = NomadicONTContext.get(\"result\");\n\nif (result === \"SUCCESS\") {\n returnValue = executor.isTrue;\n executor.outFields.put(\"result\", \"SUCCCESS\");\n executor.logger.info(\"BBS policy Execution Done\");\n} else {\n executor.logger.info(\"BBS policy Execution Failed\");\n executor.outFields.put(\"result\", \"FAILURE\");\n returnValue = executor.isFalse;\n}\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(\"End Execution NomadicEventSuccess.js\");" } } }, { "key": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "value": { "key": { "name": "SdncResourceUpdateTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "outputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.apache.avro.Schema);\nimportClass(java.io.BufferedReader);\nimportClass(java.io.IOException);\nimportClass(java.nio.file.Files);\nimportClass(java.nio.file.Paths);\n\nimportPackage(org.json.XML);\n\nexecutor.logger.info(\"Begin Execution SdncResourceUpdateTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar attachmentPoint = executor.inFields.get(\"attachmentPoint\");\nvar requestID = executor.inFields.get(\"requestID\");\nvar serviceInstanceId = executor.inFields.get(\"serviceInstanceId\");\nvar uuidType = Java.type(\"java.util.UUID\");\n\nvar wbClient = Java.type(\"org.onap.policy.apex.examples.bbs.WebClient\");\nvar client = new wbClient();\n\nvar NomadicONTContext = executor.getContextAlbum(\"NomadicONTContextAlbum\").get(attachmentPoint);\nvar sdncUUID = uuidType.randomUUID();\nexecutor.logger.info(NomadicONTContext);\nvar jsonObj;\nvar aaiUpdateResult = true;\nvar SDNC_URL = \"localhost:8080\";\nvar HTTP_PROTOCOL = \"http://\"\nvar SVC_NOTIFICATION_URL;\nvar putUpddateServInstance = JSON.parse(NomadicONTContext.get(\"aai_message\"));\nvar input_param = JSON.parse(putUpddateServInstance['input-parameters']);\ntry {\n var br = Files.newBufferedReader(Paths.get(\"/home/apexuser/examples/config/ONAPBBS/config.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n if (line.startsWith(\"SDNC_URL\")) {\n var str = line.split(\"=\");\n SDNC_URL = str[str.length - 1];\n } else if (line.startsWith(\"SVC_NOTIFICATION_URL\")) {\n var str = line.split(\"=\");\n SVC_NOTIFICATION_URL = str[str.length - 1];\n } else if (line.startsWith(\"SDNC_USERNAME\")) {\n var str = line.split(\"=\");\n SDNC_USERNAME = str[str.length - 1];\n } else if (line.startsWith(\"SDNC_PASSWORD\")) {\n var str = line.split(\"=\");\n SDNC_PASSWORD = str[str.length - 1];\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\nexecutor.logger.info(\"SDNC_URL \" + SDNC_URL);\n\nvar result;\nvar jsonObj;\nvar sdncUpdateResult = true;\n\n/* BBS Policy calls SDN-C GR-API to delete AccessConnectivity VF ID */\n/* Prepare Data */\nvar xmlDeleteAccess = \"\";\ntry {\n var br = Files.newBufferedReader(Paths\n .get(\"/home/apexuser/examples/config/ONAPBBS/sdnc_DeleteAccessConnectivityInstance.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n xmlDeleteAccess += line;\n }\n\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\n\n/* BBS Policy calls SDN-C GR-API to delete AccessConnectivity */\nxmlDeleteAccess = xmlDeleteAccess.replace(\"svc_request_id_value\", sdncUUID);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"svc_notification_url_value\", SVC_NOTIFICATION_URL);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"request_id_value\", sdncUUID);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"service_id_value\", sdncUUID);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"service_instance_id_value\", putUpddateServInstance['service-instance-id']);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"service_type_value\", input_param['service']['serviceType']);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"customer_id_value\", input_param['service']['globalSubscriberId']);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"customer_name_value\", input_param['service']['globalSubscriberId']);\n\nxmlDeleteAccess = xmlDeleteAccess.replace(\"srv_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"srv_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"srv_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"srv_info_model_name_value\", \"AccessConnectivity\");\nxmlDeleteAccess = xmlDeleteAccess.replace(\"network_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"network_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"network_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlDeleteAccess = xmlDeleteAccess.replace(\"network_info_model_name_value\", \"AccessConnectivity\");\n\nxmlDeleteAccess = xmlDeleteAccess.replace(\"vendor_value\",\n input_param['service']['parameters']['requestInputs']['ont_ont_manufacturer']);\nxmlDeleteAccess = xmlDeleteAccess.replace(\"service_id_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'controller-service-id'));\nexecutor.logger.info(client.toPrettyString(xmlDeleteAccess, 4));\n\ntry {\n var urlPost1 = HTTP_PROTOCOL + SDNC_URL + \"/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation\";\n result = client.httpRequest(urlPost1, \"POST\", xmlDeleteAccess, SDNC_USERNAME, SDNC_PASSWORD, \"application/xml\");\n executor.logger.info(\"Data received From \" + urlPost1 + \" \" + result);\n if (result == \"\") {\n sdncUpdateResult = false;\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n sdncUpdateResult = false;\n}\n\n/* BBS Policy calls SDN-C GR-API to create new AccessConnectivity VF */\n\n/* Prepare Data */\nvar xmlCreateAccess = \"\";\ntry {\n var br = Files.newBufferedReader(Paths\n .get(\"/home/apexuser/examples/config/ONAPBBS/sdnc_CreateAccessConnectivityInstance.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n xmlCreateAccess += line;\n }\n\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\nxmlCreateAccess = xmlCreateAccess.replace(\"svc_request_id_value\", sdncUUID);\nxmlCreateAccess = xmlCreateAccess.replace(\"svc_notification_url_value\", SVC_NOTIFICATION_URL);\nxmlCreateAccess = xmlCreateAccess.replace(\"request_id_value\", requestID);\nxmlCreateAccess = xmlCreateAccess.replace(\"service_id_value\", sdncUUID);\nxmlCreateAccess = xmlCreateAccess.replace(\"service_instance_id_value\", putUpddateServInstance['service-instance-id']);\nxmlCreateAccess = xmlCreateAccess.replace(\"service_type_value\", input_param['service']['serviceType']);\nxmlCreateAccess = xmlCreateAccess.replace(\"customer_id_value\", input_param['service']['globalSubscriberId']);\nxmlCreateAccess = xmlCreateAccess.replace(\"customer_name_value\", input_param['service']['globalSubscriberId']);\n\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_name_value\", \"AccessConnectivity\");\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'AccessConnectivity'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_name_value\", \"AccessConnectivity\");\n\nxmlCreateAccess = xmlCreateAccess.replace(\"vendor_value\",\n input_param['service']['parameters']['requestInputs']['ont_ont_manufacturer']);\nxmlCreateAccess = xmlCreateAccess.replace(\"ont_sn_value\",\n input_param['service']['parameters']['requestInputs']['ont_ont_serial_num']);\nxmlCreateAccess = xmlCreateAccess.replace(\"s_vlan_value\", getMetaValue(putUpddateServInstance['metadata']['metadatum'],\n 'svlan'));\nxmlCreateAccess = xmlCreateAccess.replace(\"c_vlan_value\", getMetaValue(putUpddateServInstance['metadata']['metadatum'],\n 'cvlan'));\nxmlCreateAccess = xmlCreateAccess.replace(\"remote_id_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'remote-id'));\nexecutor.logger.info(client.toPrettyString(xmlCreateAccess, 4));\n\ntry {\n if (sdncUpdateResult == true) {\n var urlPost2 = HTTP_PROTOCOL + SDNC_URL\n + \"/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation\";\n result = client.httpRequest(urlPost2, \"POST\", xmlCreateAccess, SDNC_USERNAME, SDNC_PASSWORD, \"application/xml\");\n executor.logger.info(\"Data received From \" + urlPost2 + \" \" + result);\n if (result == \"\") {\n sdncUpdateResult = false;\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n sdncUpdateResult = false;\n}\n\n/* BBS Policy calls SDN-C GR-API to create change Internet Profile */\nvar xmlChangeProfile = \"\";\ntry {\n var br = Files.newBufferedReader(Paths\n .get(\"/home/apexuser/examples/config/ONAPBBS/sdnc_ChangeInternetProfileInstance.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n xmlChangeProfile += line;\n }\n\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\n\nxmlChangeProfile = xmlChangeProfile.replace(\"svc_request_id_value\", sdncUUID);\nxmlChangeProfile = xmlChangeProfile.replace(\"svc_notification_url_value\", SVC_NOTIFICATION_URL);\nxmlChangeProfile = xmlChangeProfile.replace(\"request_id_value\", requestID);\nxmlChangeProfile = xmlChangeProfile.replace(\"service_id_value\", sdncUUID);\nxmlChangeProfile = xmlChangeProfile.replace(\"service_instance_id_value\", putUpddateServInstance['service-instance-id']);\nxmlChangeProfile = xmlChangeProfile.replace(\"service_type_value\", input_param['service']['serviceType']);\nxmlChangeProfile = xmlChangeProfile.replace(\"customer_id_value\", input_param['service']['globalSubscriberId']);\nxmlChangeProfile = xmlChangeProfile.replace(\"customer_name_value\", input_param['service']['globalSubscriberId']);\n\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"srv_info_model_name_value\", \"InternetProfile\");\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_inv_uuid_value\", getResourceInvariantUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_custom_uuid_value\", getResourceCustomizationUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_uuid_value\", getResourceUuid(\n input_param['service']['parameters']['resources'], 'InternetProfile'));\nxmlCreateAccess = xmlCreateAccess.replace(\"network_info_model_name_value\", \"InternetProfile\");\n\nxmlChangeProfile = xmlChangeProfile.replace(\"vendor_value\",\n input_param['service']['parameters']['requestInputs']['ont_ont_manufacturer']);\nxmlChangeProfile = xmlChangeProfile.replace(\"service_id_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'controller-service-id'));\nxmlChangeProfile = xmlChangeProfile.replace(\"remote_id_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'remote-id'));\nxmlChangeProfile = xmlChangeProfile.replace(\"ont_sn_value\",\n input_param['service']['parameters']['requestInputs']['ont_ont_serial_num']);\nxmlChangeProfile = xmlChangeProfile.replace(\"service_type_value\", input_param['service']['serviceType']);\nxmlChangeProfile = xmlChangeProfile.replace(\"mac_value\", getMetaValue(putUpddateServInstance['metadata']['metadatum'],\n 'rgw-mac-address'));\nxmlChangeProfile = xmlChangeProfile.replace(\"up_speed_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'up-speed'));\nxmlChangeProfile = xmlChangeProfile.replace(\"down_speed_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'down-speed'));\nxmlChangeProfile = xmlChangeProfile.replace(\"s_vlan_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'svlan'));\nxmlChangeProfile = xmlChangeProfile.replace(\"c_vlan_value\", getMetaValue(\n putUpddateServInstance['metadata']['metadatum'], 'cvlan'));\n\nexecutor.logger.info(client.toPrettyString(xmlChangeProfile, 4));\ntry {\n if (sdncUpdateResult == true) {\n var urlPost3 = HTTP_PROTOCOL + SDNC_URL\n + \"/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation\";\n result = client\n .httpRequest(urlPost3, \"POST\", xmlChangeProfile, SDNC_USERNAME, SDNC_PASSWORD, \"application/xml\");\n executor.logger.info(\"Data received From \" + urlPost3 + \" \" + result);\n if (result == \"\") {\n sdncUpdateResult = false;\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n sdncUpdateResult = false;\n}\n\n/* If Success then Fill output schema */\n\nif (sdncUpdateResult === true) {\n NomadicONTContext.put(\"result\", \"SUCCESS\");\n executor.outFields.put(\"result\", \"SUCCESS\");\n} else {\n NomadicONTContext.put(\"result\", \"FAILURE\");\n executor.outFields.put(\"result\", \"FAILURE\");\n}\n\nexecutor.outFields.put(\"requestID\", requestID);\nexecutor.outFields.put(\"attachmentPoint\", attachmentPoint);\nexecutor.outFields.put(\"serviceInstanceId\", executor.inFields.get(\"serviceInstanceId\"));\n\nvar returnValue = executor.isTrue;\nexecutor.logger.info(executor.outFields);\nexecutor.logger.info(\"End Execution SdncResourceUpdateTask.js\");\n\nfunction getMetaValue(metaJson, metaname) {\n for (var i = 0; i < metaJson.length; i++) {\n if (metaJson[i]['metaname'] == metaname) {\n var metaValue = metaJson[i]['metaval'];\n return metaValue;\n }\n }\n\n}\n\nfunction getResourceInvariantUuid(resJson, resourceName) {\n for (var i = 0; i < resJson.length; i++) {\n if (resJson[i]['resourceName'] == resourceName) {\n var resValue = resJson[i]['resourceInvariantUuid'];\n return resValue;\n }\n }\n\n}\n\nfunction getResourceUuid(resJson, resourceName) {\n for (var i = 0; i < resJson.length; i++) {\n if (resJson[i]['resourceName'] == resourceName) {\n var resValue = resJson[i]['resourceUuid'];\n return resValue;\n }\n }\n\n}\n\nfunction getResourceCustomizationUuid(resJson, resourceName) {\n for (var i = 0; i < resJson.length; i++) {\n if (resJson[i]['resourceName'] == resourceName) {\n var resValue = resJson[i]['resourceCustomizationUuid'];\n return resValue;\n }\n }\n\n}\n\n/* Utility functions Begin */\nfunction IsValidJSONString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}\n/* Utility functions End */" } } }, { "key": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "value": { "key": { "name": "ServiceUpdateStateCpeAuthTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "VirtualControlLoopEvent", "value": { "key": "VirtualControlLoopEvent", "fieldSchemaKey": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "optional": false } } ] }, "outputFields": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [ { "name": "NomadicONTContextAlbum", "version": "0.0.1" } ], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2019 Huawei. All rights reserved.\n * Modifications Copyright (C) 2019 Nordix Foundation.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\nload(\"nashorn:mozilla_compat.js\");\nimportClass(java.io.BufferedReader);\nimportClass(java.io.IOException);\nimportClass(java.nio.file.Files);\nimportClass(java.nio.file.Paths);\n\nexecutor.logger.info(\"Begin Execution ServiceUpdateStateCpeAuthTask.js\");\nexecutor.logger.info(executor.subject.id);\nexecutor.logger.info(executor.inFields);\n\nvar clEventType = Java.type(\"org.onap.policy.controlloop.VirtualControlLoopEvent\");\nvar clEvent = executor.inFields.get(\"VirtualControlLoopEvent\");\n\nvar serviceInstanceId = clEvent.getAai().get(\"service-information.hsia-cfs-service-instance-id\");\nvar requestID = clEvent.getRequestId();\n\nvar jsonObj;\nvar aaiUpdateResult = true;\nvar wbClient = Java.type(\"org.onap.policy.apex.examples.bbs.WebClient\");\nvar client = new wbClient();\nvar oldState = clEvent.getAai().get(\"cpe.old-authentication-state\");\nvar newState = clEvent.getAai().get(\"cpe.new-authentication-state\");\n/* Get AAI URL from Configuration file. */\nvar AAI_URL = \"localhost:8080\";\nvar CUSTOMER_ID = requestID;\nvar SERVICE_INSTANCE_ID = serviceInstanceId;\nvar resource_version;\nvar HTTP_PROTOCOL = \"https://\";\nvar results;\nvar putUrl;\nvar service_instance;\nvar AAI_VERSION = \"v14\";\ntry {\n var br = Files.newBufferedReader(Paths.get(\"/home/apexuser/examples/config/ONAPBBS/config.txt\"));\n var line;\n while ((line = br.readLine()) != null) {\n if (line.startsWith(\"AAI_URL\")) {\n var str = line.split(\"=\");\n AAI_URL = str[str.length - 1];\n } else if (line.startsWith(\"AAI_USERNAME\")) {\n var str = line.split(\"=\");\n AAI_USERNAME = str[str.length - 1];\n } else if (line.startsWith(\"AAI_PASSWORD\")) {\n var str = line.split(\"=\");\n AAI_PASSWORD = str[str.length - 1];\n } else if (line.startsWith(\"AAI_VERSION\")) {\n var str = line.split(\"=\");\n AAI_VERSION = str[str.length - 1];\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n}\n\nexecutor.logger.info(\"AAI_URL=>\" + AAI_URL);\n\n/* Get service instance Id from AAI */\ntry {\n var urlGet = HTTP_PROTOCOL + AAI_URL + \"/aai/\" + AAI_VERSION + \"/nodes/service-instances/service-instance/\"\n + SERVICE_INSTANCE_ID + \"?format=resource_and_url\"\n executor.logger.info(\"Query url\" + urlGet);\n\n result = client.httpRequest(urlGet, \"GET\", null, AAI_USERNAME, AAI_PASSWORD, \"application/json\");\n executor.logger.info(\"Data received From \" + urlGet + \" \" + result);\n jsonObj = JSON.parse(result);\n\n /* Retrieve the service instance id */\n results = jsonObj['results'][0];\n putUrl = results[\"url\"];\n service_instance = results['service-instance'];\n resource_version = service_instance['resource-version'];\n executor.logger.info(\"After Parse service_instance \" + JSON.stringify(service_instance, null, 4) + \"\\n url \"\n + putUrl + \"\\n Service instace Id \" + SERVICE_INSTANCE_ID);\n\n if (result == \"\") {\n aaiUpdateResult = false;\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\n/* BBS Policy updates orchestration status of {{bbs-cfs-service-instance-UUID}} [ active --> assigned ] */\nvar putUpddateServInstance;\nputUpddateServInstance = service_instance;\nif (newState == 'inService') {\n putUpddateServInstance['orchestration-status'] = \"active\";\n} else {\n putUpddateServInstance['orchestration-status'] = \"inActive\";\n}\ntry {\n if (aaiUpdateResult == true) {\n executor.logger.info(\"ready to put After Parse \" + JSON.stringify(putUpddateServInstance, null, 4));\n var urlPut = HTTP_PROTOCOL + AAI_URL + putUrl + \"?resource_version=\" + resource_version;\n result = client.httpRequest(urlPut, \"PUT\", JSON.stringify(putUpddateServInstance), AAI_USERNAME, AAI_PASSWORD,\n \"application/json\");\n executor.logger.info(\"Data received From \" + urlPut + \" \" + result);\n /* If failure to retrieve data proceed to Failure */\n if (result != \"\") {\n aaiUpdateResult = false;\n }\n }\n} catch (err) {\n executor.logger.info(\"Failed to retrieve data \" + err);\n aaiUpdateResult = false;\n}\n\nif (aaiUpdateResult == true) {\n executor.outFields.put(\"result\", \"SUCCCESS\");\n} else {\n executor.outFields.put(\"result\", \"FAILURE\");\n}\n\nexecutor.logger.info(executor.outFields);\nvar returnValue = executor.isTrue;\nexecutor.logger.info(\"End Execution ServiceUpdateStateCpeAuthTask.js\");" } } } ] } }, "events": { "key": { "name": "NomadicONTPolicyModel_Events", "version": "1.0.2" }, "eventMap": { "entry": [ { "key": { "name": "AAI_CPE_AUTH_UPDATE", "version": "1.0.0" }, "value": { "key": { "name": "AAI_CPE_AUTH_UPDATE", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "DCAE", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } }, { "key": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "value": { "key": { "name": "AAI_SERVICE_ASSIGNED", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "APEX", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } }, { "key": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "value": { "key": { "name": "AAI_SERVICE_CREATE", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "APEX", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } }, { "key": { "name": "CPE_Authentication", "version": "1.0.2" }, "value": { "key": { "name": "CPE_Authentication", "version": "1.0.2" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "DCAE", "target": "APEX", "parameter": { "entry": [ { "key": "VirtualControlLoopEvent", "value": { "key": "VirtualControlLoopEvent", "fieldSchemaKey": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "optional": false } } ] } } }, { "key": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "value": { "key": { "name": "END_CONTROL_LOOP", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "APEX", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } }, { "key": { "name": "END_EVENT", "version": "1.0.0" }, "value": { "key": { "name": "END_EVENT", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "DCAE", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } }, { "key": { "name": "ERROR_LOG", "version": "1.0.0" }, "value": { "key": { "name": "ERROR_LOG", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "APEX", "parameter": { "entry": [ { "key": "errorLogParam", "value": { "key": "errorLogParam", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } } ] } } }, { "key": { "name": "Nomadic_ONT", "version": "1.0.2" }, "value": { "key": { "name": "Nomadic_ONT", "version": "1.0.2" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "DCAE", "target": "APEX", "parameter": { "entry": [ { "key": "VirtualControlLoopEvent", "value": { "key": "VirtualControlLoopEvent", "fieldSchemaKey": { "name": "VirtualControlLoopEventType", "version": "0.0.1" }, "optional": false } } ] } } }, { "key": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "value": { "key": { "name": "SDNC_RESOURCE_UPDATE", "version": "1.0.0" }, "nameSpace": "org.onap.policy.apex.onap.bbs", "source": "APEX", "target": "APEX", "parameter": { "entry": [ { "key": "attachmentPoint", "value": { "key": "attachmentPoint", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "UUIDType", "version": "0.0.1" }, "optional": false } }, { "key": "result", "value": { "key": "result", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "serviceInstanceId", "value": { "key": "serviceInstanceId", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": true } } ] } } } ] } }, "albums": { "key": { "name": "NomadicONTPolicyModel_Albums", "version": "1.0.2" }, "albums": { "entry": [ { "key": { "name": "NomadicONTContextAlbum", "version": "0.0.1" }, "value": { "key": { "name": "NomadicONTContextAlbum", "version": "0.0.1" }, "scope": "policy", "isWritable": true, "itemSchema": { "name": "NomadicONTContextType", "version": "0.0.1" } } } ] } }, "schemas": { "key": { "name": "NomadicONTPolicyModel_Schemas", "version": "1.0.2" }, "schemas": { "entry": [ { "key": { "name": "NomadicONTContextType", "version": "0.0.1" }, "value": { "key": { "name": "NomadicONTContextType", "version": "0.0.1" }, "schemaFlavour": "Avro", "schemaDefinition": "{\n \"type\": \"record\",\n \"name\": \"NomadicONTContext\",\n \"fields\": [\n {\n \"name\": \"AAI\",\n \"type\": {\n \"type\": \"record\",\n \"name\": \"VCPE_AAI_Type\",\n \"namespace\": \"org.onap.policy.apex.onap.vcpe\",\n \"fields\": [\n {\n \"name\": \"attachmentPoint\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service_information_hsia_cfs_service_instance_id\",\n \"type\": \"string\"\n },\n {\n \"name\": \"cvlan\",\n \"type\": \"string\"\n },\n {\n \"name\": \"svlan\",\n \"type\": \"string\"\n },\n {\n \"name\": \"remoteId\",\n \"type\": \"string\"\n }\n ]\n }\n },\n {\n \"name\": \"closedLoopAlarmStart\",\n \"type\": \"long\"\n },\n {\n \"name\": \"closedLoopAlarmEnd\",\n \"type\": \"long\"\n },\n {\n \"name\": \"closedLoopControlName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"requestID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"closedLoopEventClient\",\n \"type\": \"string\"\n },\n {\n \"name\": \"closedLoopEventStatus\",\n \"type\": \"string\"\n },\n {\n \"name\": \"target_type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"target\",\n \"type\": \"string\"\n },\n {\n \"name\": \"from\",\n \"type\": \"string\"\n },\n {\n \"name\": \"policyScope\",\n \"type\": \"string\"\n },\n {\n \"name\": \"policyName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"policyVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"notification\",\n \"type\": \"string\"\n },\n {\n \"name\": \"notificationTime\",\n \"type\": \"long\"\n },\n {\n \"name\": \"result\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"url\",\n \"type\": \"string\"\n },\n {\n \"name\": \"aai_message\",\n \"type\": \"string\"\n }\n ]\n}" } }, { "key": { "name": "SimpleBooleanType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleBooleanType", "version": "0.0.1" }, "schemaFlavour": "Java", "schemaDefinition": "java.lang.Boolean" } }, { "key": { "name": "SimpleLongType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleLongType", "version": "0.0.1" }, "schemaFlavour": "Java", "schemaDefinition": "java.lang.Long" } }, { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "schemaFlavour": "Java", nfs:/home/ubuntu# kubectl exec -ti dev-dcae-bootstrap-7599b45c77-czxsx -n onap bash bash-4.2$ cfy install -b restconf -d restconf /blueprints/k8s-restconf.yaml Uploading blueprint /blueprints/k8s-restconf.yaml... k8s-restconf.yaml |###################################################| 100.0% Blueprint uploaded. The blueprint's id is restconf Creating new deployment from blueprint restconf... Deployment created. The deployment's id is restconf Executing workflow install on deployment restconf [timeout=900 seconds] Deployment environment creation is pending... 2020-03-26 13:35:09.015 CFY <restconf> Starting 'create_deployment_environment' workflow execution 2020-03-26 13:35:09.660 CFY <restconf> Installing deployment plugins 2020-03-26 13:35:09.660 CFY <restconf> Sending task 'cloudify_agent.operations.install_plugins' 2020-03-26 13:35:09.660 CFY <restconf> Task started 'cloudify_agent.operations.install_plugins' 2020-03-26 13:35:10.269 LOG <restconf> INFO: Installing plugin: k8s 2020-03-26 13:35:10.269 LOG <restconf> INFO: Using existing installation of managed plugin: c567dae6-35df-426a-a677-45ac51175b73 [package_name: k8splugin, package_version: 1.7.2, supported_platform: linux_x86_64, distribution: centos, distribution_release: core] 2020-03-26 13:35:10.269 CFY <restconf> Task succeeded 'cloudify_agent.operations.install_plugins' 2020-03-26 13:35:10.269 CFY <restconf> Skipping starting deployment policy engine core - no policies defined 2020-03-26 13:35:10.269 CFY <restconf> Creating deployment work directory 2020-03-26 13:35:10.986 CFY <restconf> 'create_deployment_environment' workflow execution succeeded 2020-03-26 13:35:13.053 CFY <restconf> Starting 'install' workflow execution 2020-03-26 13:35:13.672 CFY <restconf> [rcc_k8s_1bgtbl] Creating node instance 2020-03-26 13:35:14.338 CFY <restconf> [rcc_k8s_1bgtbl.create] Sending task 'k8splugin.create_for_platforms' 2020-03-26 13:35:16.559 LOG <restconf> [rcc_k8s_1bgtbl.create] INFO: Added config for dcaegen2-collectors-rcc 2020-03-26 13:35:17.277 LOG <restconf> [rcc_k8s_1bgtbl.create] INFO: Done setting up: dcaegen2-collectors-rcc 2020-03-26 13:35:17.277 CFY <restconf> [rcc_k8s_1bgtbl.create] Task succeeded 'k8splugin.create_for_platforms' 2020-03-26 13:35:17.277 CFY <restconf> [rcc_k8s_1bgtbl] Node instance created 2020-03-26 13:35:17.277 CFY <restconf> [rcc_k8s_1bgtbl] Configuring node instance: nothing to do 2020-03-26 13:35:17.916 CFY <restconf> [rcc_k8s_1bgtbl] Starting node instance 2020-03-26 13:35:17.916 CFY <restconf> [rcc_k8s_1bgtbl.start] Sending task 'k8splugin.create_and_start_container_for_platforms' 2020-03-26 13:35:19.132 LOG <restconf> [rcc_k8s_1bgtbl.start] INFO: Starting k8s deployment for dcaegen2-collectors-rcc, image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.restconfcollector:1.1.1, env: {'CONSUL_HOST': u'consul-server.onap.svc.cluster.local', 'CBS_CONFIG_URL': 'https://config-binding-service:10443/service_component_all/dcaegen2-collectors-rcc', u'DMAAPHOST': u'message-router.onap.svc.cluster.local', 'CONFIG_BINDING_SERVICE': u'config_binding_service', u'CBS_HOST': u'config-binding-service.dcae.svc.cluster.local', 'DCAE_CA_CERTPATH': u'/opt/dcae/cacert/cacert.pem', u'DMAAPPORT': u'3904', u'CBS_PORT': u'10000', u'CONSUL_PORT': u'8500', u'DMAAPPUBTOPIC': u'unauthenticated.DCAE_RCC_OUTPUT'}, kwargs: {'readiness': {u'endpoint': u'/healthcheck', u'type': u'http', u'timeout': u'1s', u'interval': u'15s'}, 'tls_info': {}, 'replicas': 1, u'envs': {u'CONSUL_HOST': u'consul-server.onap.svc.cluster.local', u'DMAAPHOST': u'message-router.onap.svc.cluster.local', u'CONFIG_BINDING_SERVICE': u'config_binding_service', u'CBS_HOST': u'config-binding-service.dcae.svc.cluster.local', u'DMAAPPORT': u'3904', u'CBS_PORT': u'10000', u'CONSUL_PORT': u'8500', u'DMAAPPUBTOPIC': u'unauthenticated.DCAE_RCC_OUTPUT'}, 'labels': {'cfydeployment': u'restconf', 'cfynodeinstance': u'rcc_k8s_1bgtbl', 'cfynode': u'rcc_k8s'}, 'ctx': <cloudify.context.CloudifyContext object at 0x7fbc53614250>, 'always_pull_image': False, 'resource_config': {}, 'log_info': {u'log_directory': u'/opt/app/RCCollector/logs'}, u'ports': [u'8080:30416'], 'k8s_location': u'central'} 2020-03-26 13:35:19.848 LOG <restconf> [rcc_k8s_1bgtbl.start] INFO: Passing k8sconfig: {'tls': {u'component_cert_dir': u'/opt/dcae/cacert', u'cert_path': u'/opt/app/osaaf', u'image': u'nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tls-init-container:2.1.0', u'ca_cert_configmap': u'dev-dcae-bootstrap-dcae-cacert', u'component_ca_cert_path': u'/opt/dcae/cacert/cacert.pem'}, 'filebeat': {u'config_map': u'dev-dcae-filebeat-configmap', u'config_path': u'/usr/share/filebeat/filebeat.yml', u'log_path': u'/var/log/onap', u'image': u'docker.elastic.co/beats/filebeat:5.5.0', u'data_path': u'/usr/share/filebeat/data', u'config_subpath': u'filebeat.yml'}, 'consul_dns_name': u'consul-server.onap', 'image_pull_secrets': [u'onap-docker-registry-key'], 'namespace': u'onap', 'consul_host': 'consul-server:8500', 'cbs': {'base_url': 'https://config-binding-service:10443/service_component_all'}, 'default_k8s_location': u'central'} 2020-03-26 13:35:19.848 LOG <restconf> [rcc_k8s_1bgtbl.start] INFO: k8s deployment initiated successfully for dcaegen2-collectors-rcc: {'services': ['dcaegen2-collectors-rcc', 'xdcaegen2-collectors-rcc'], 'namespace': u'onap', 'location': u'central', 'deployment': 'dep-dcaegen2-collectors-rcc'} 2020-03-26 13:35:19.848 LOG <restconf> [rcc_k8s_1bgtbl.start] INFO: Waiting up to 1800 secs for dcaegen2-collectors-rcc to become ready 2020-03-26 13:35:45.794 LOG <restconf> [rcc_k8s_1bgtbl.start] INFO: k8s deployment is ready for: dcaegen2-collectors-rcc 2020-03-26 13:35:46.296 CFY <restconf> [rcc_k8s_1bgtbl.start] Task succeeded 'k8splugin.create_and_start_container_for_platforms' 2020-03-26 13:35:46.926 CFY <restconf> [rcc_k8s_1bgtbl] Node instance started 2020-03-26 13:35:46.926 CFY <restconf> 'install' workflow execution succeeded Finished executing workflow install on deployment restconf * Run 'cfy events list -e d9edf30f-0944-46f7-98af-8ec2a35499f3' to retrieve the execution's events/logs |
VES mapper
Description: VESMapper (BBS Usecase)
VES Mapper blueprint:
VES Mapper deployment procedure:
Code Block | ||||
---|---|---|---|---|
| ||||
root@onap-nfs:/home/ubuntu# kubectl exec -ti dev-dcae-bootstrap-7599b45c77-czxsx -n onap bash
bash-4.2$ cfy install -b ves-mapper -d ves-mapper /blueprints/k8s-ves-mapper.yaml
Uploading blueprint /blueprints/k8s-ves-mapper.yaml...
k8s-ves-mapper.yaml |#################################################| 100.0%
Blueprint uploaded. The blueprint's id is ves-mapper
Creating new deployment from blueprint ves-mapper...
Deployment created. The deployment's id is ves-mapper
Executing workflow install on deployment ves-mapper [timeout=900 seconds]
Deployment environment creation is pending...
2020-03-26 13:37:22.808 CFY <ves-mapper> Starting 'create_deployment_environment' workflow execution
2020-03-26 13:37:23.404 CFY <ves-mapper> Installing deployment plugins
2020-03-26 13:37:23.404 CFY <ves-mapper> Sending task 'cloudify_agent.operations.install_plugins'
2020-03-26 13:37:23.404 CFY <ves-mapper> Task started 'cloudify_agent.operations.install_plugins'
2020-03-26 13:37:24.051 LOG <ves-mapper> INFO: Installing plugin: k8s
2020-03-26 13:37:24.051 LOG <ves-mapper> INFO: Using existing installation of managed plugin: c567dae6-35df-426a-a677-45ac51175b73 [package_name: k8splugin, package_version: 1.7.2, supported_platform: linux_x86_64, distribution: centos, distribution_release: core]
2020-03-26 13:37:24.051 CFY <ves-mapper> Task succeeded 'cloudify_agent.operations.install_plugins'
2020-03-26 13:37:24.051 CFY <ves-mapper> Skipping starting deployment policy engine core - no policies defined
2020-03-26 13:37:24.051 CFY <ves-mapper> Creating deployment work directory
2020-03-26 13:37:24.724 CFY <ves-mapper> 'create_deployment_environment' workflow execution succeeded
2020-03-26 13:37:26.733 CFY <ves-mapper> Starting 'install' workflow execution
2020-03-26 13:37:27.363 CFY <ves-mapper> [universalvesadapter_3gckp9] Creating node instance
2020-03-26 13:37:27.363 CFY <ves-mapper> [universalvesadapter_3gckp9.create] Sending task 'k8splugin.create_for_components'
2020-03-26 13:37:29.831 LOG <ves-mapper> [universalvesadapter_3gckp9.create] INFO: Added config for s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper
2020-03-26 13:37:30.335 LOG <ves-mapper> [universalvesadapter_3gckp9.create] INFO: Done setting up: s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper
2020-03-26 13:37:30.986 CFY <ves-mapper> [universalvesadapter_3gckp9.create] Task succeeded 'k8splugin.create_for_components'
2020-03-26 13:37:30.986 CFY <ves-mapper> [universalvesadapter_3gckp9] Node instance created
2020-03-26 13:37:30.986 CFY <ves-mapper> [universalvesadapter_3gckp9] Configuring node instance: nothing to do
2020-03-26 13:37:30.986 CFY <ves-mapper> [universalvesadapter_3gckp9] Starting node instance
2020-03-26 13:37:31.654 CFY <ves-mapper> [universalvesadapter_3gckp9.start] Sending task 'k8splugin.create_and_start_container_for_components'
2020-03-26 13:37:33.026 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: Passing k8sconfig: {'tls': {u'component_cert_dir': u'/opt/dcae/cacert', u'cert_path': u'/opt/app/osaaf', u'image': u'nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tls-init-container:2.1.0', u'ca_cert_configmap': u'dev-dcae-bootstrap-dcae-cacert', u'component_ca_cert_path': u'/opt/dcae/cacert/cacert.pem'}, 'filebeat': {u'config_map': u'dev-dcae-filebeat-configmap', u'config_path': u'/usr/share/filebeat/filebeat.yml', u'log_path': u'/var/log/onap', u'image': u'docker.elastic.co/beats/filebeat:5.5.0', u'data_path': u'/usr/share/filebeat/data', u'config_subpath': u'filebeat.yml'}, 'consul_dns_name': u'consul-server.onap', 'image_pull_secrets': [u'onap-docker-registry-key'], 'namespace': u'onap', 'consul_host': 'consul-server:8500', 'cbs': {'base_url': 'https://config-binding-service:10443/service_component_all'}, 'default_k8s_location': u'central'}
2020-03-26 13:37:32.522 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: Starting k8s deployment for s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper, image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.mapper.vesadapter.universalvesadaptor:1.0.1, env: {'DCAE_CA_CERTPATH': u'/opt/dcae/cacert/cacert.pem', 'CONSUL_HOST': u'consul-server.onap', u'SERVICE_TAGS': u'', 'CBS_CONFIG_URL': 'https://config-binding-service:10443/service_component_all/s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper', 'CONFIG_BINDING_SERVICE': u'config_binding_service'}, kwargs: {'readiness': {}, 'labels': {'cfydeployment': u'ves-mapper', 'cfynodeinstance': u'universalvesadapter_3gckp9', 'cfynode': u'universalvesadapter'}, 'tls_info': {}, 'envs': {u'SERVICE_TAGS': u'', u'CONFIG_BINDING_SERVICE': u'config_binding_service'}, 'liveness': {}, 'resource_config': {}, 'volumes': [], 'log_info': {}, 'ports': [u'80:0'], 'k8s_location': u'central'}
2020-03-26 13:37:33.026 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: k8s deployment initiated successfully for s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper: {'services': ['s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper'], 'namespace': u'onap', 'location': u'central', 'deployment': 'dep-s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper'}
2020-03-26 13:37:33.026 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: Waiting up to 3600 secs for s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper to become ready
2020-03-26 13:37:35.743 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: k8s deployment is ready for: s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper
2020-03-26 13:37:36.390 LOG <ves-mapper> [universalvesadapter_3gckp9.start] INFO: Done starting: s76305937176b49619b24cb13ae1f5100-dcaegen2-svc-mapper
2020-03-26 13:37:36.390 CFY <ves-mapper> [universalvesadapter_3gckp9.start] Task succeeded 'k8splugin.create_and_start_container_for_components'
2020-03-26 13:37:36.390 CFY <ves-mapper> [universalvesadapter_3gckp9] Node instance started
2020-03-26 13:37:36.390 CFY <ves-mapper> 'install' workflow execution succeeded
Finished executing workflow install on deployment ves-mapper
* Run 'cfy events list -e 69ffeb61-3f09-4311-8483-6f4ab7a20806' to retrieve the execution's events/logs |
VES Collector
In Frankfurt by default VES Collector listens to secured port with HTTPS. To keep our code modifications to a minimum, we can use the HTTP-version of VES-Collector by deploying a separate Cloudify instance from within DCAE bootstrap POD.
Code Block | ||||
---|---|---|---|---|
| ||||
root@onap-nfs:/home/ubuntu# kubectl exec -ti dev-dcae-bootstrap-7599b45c77-czxsx -n onap bash
bash-4.2$ cfy install -b ves-http -d ves-http -i /inputs/k8s-ves-inputs.yaml /blueprints/k8s-ves.yaml |
Configure mapping VES event domain to DMaaP topic: ves-statechange --> unauthenticated.CPE_AUTHENTICATION
1) Access Consul UI: http://<consul_server_ui>:30270/ui/#/dc1/services
2) Modify dcae-ves-collector-http configuration by adding a new VES domain to DMaaP topic mapping
Code Block | ||||
---|---|---|---|---|
| ||||
"ves-statechange": {"type": "message_router", "dmaap_info": {"topic_url": "http://message-router:3904/events/unauthenticated.CPE_AUTHENTICATION"}} |
3) Click on UPDATE to apply the new configuration
SDNC
Make sure that BBS DGs in SDNC DGBuilder are in Active state
bbs-access-connectivity-vnf-topology-operation-create-huawei
bbs-access-connectivity-vnf-topology-operation-delete-huawei
bbs-internet-profile-vnf-topology-operation-change-huawei
bbs-internet-profile-vnf-topology-operation-common-huawei
bbs-internet-profile-vnf-topology-operation-create-huawei
bbs-internet-profile-vnf-topology-operation-delete-huawei
validate-bbs-vnf-input-parameters
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Access SDN M&C DG
Configure Access SDN M&C IP address in SDNC DG using dgbuilder. For instance:
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-create-huawei.json
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-delete-huawei.json
1) Export the relevant DG
2) Modify the IP address
3) Import back the DG and Activate it
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Edge SDN M&C DG
Configure Edge SDN M&C IP address in SDNC DG using dgbuilder. For instance:
> GENERIC-RESOURCE-API: bbs-access-connectivity-vnf-topology-operation-common-huawei.json
1) Export the relevant DG
2) Modify the IP address
3) Import back the DG and Activate it
DGBuilder URL: https://dguser:test123@sdnc.api.simpledemo.onap.org:30203
Ref: Swisscom Edge SDN M&C and virtual BNG
Add SSL certificate of the 3rd party controller into the SDNC trust store
Code Block | ||||
---|---|---|---|---|
| ||||
kubectl exec -ti dev-sdnc-0 -n onap -- bash
openssl s_client -connect <IP_ADDRESS_EXT_CTRL>:<PORT>
# copy server certificate and paste in /tmp/<CA_CERT_NAME>.crt
sudo keytool -importcert -file /tmp/<CA_CERT_NAME>.crt -alias <CA_CERT_NAME>_key -keystore truststore.onap.client.jks -storepass adminadmin
keytool -list -keystore truststore.onap.client.jks -storepass adminadmin | grep <CA_CERT_NAME> |
See
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Policy
Deploy BBS APEX Policy (master, apex-pdp image v2.3+)
Before Starting check POLICY-PAP and POLICY-API are exposed correctly.
Code Block | ||
---|---|---|
| ||
kubectl get svc | grep -i policy policy-apex-pdp "schemaDefinition": "java.lang.String" ClusterIP 10.43.154.141 } <none> }, 6969/TCP { "key": { 9d policy-api "name": "UUIDType", ClusterIP "version": "0.0.1"10.43.38.189 <none> }, 6969/TCP "value": { "key": { 9d policy-distribution "name": "UUIDType", ClusterIP 10.43.59.17 <none> "version": "0.0.1" 6969/TCP }, "schemaFlavour": "Java", 9d policy-handler "schemaDefinition": "java.util.UUID" ClusterIP } 10.43.26.210 <none> }, 80/TCP { "key": { 9d policy-mariadb "name": "VirtualControlLoopEventType", ClusterIP "version": "0.0.1" None <none> }, 3306/TCP "value": { "key": { 9d policy-pap "name": "VirtualControlLoopEventType", ClusterIP "version": "0.0.1" 10.43.32.178 <none> }, 6969/TCP "schemaFlavour": "Java", 9d policy-xacml-pdp "schemaDefinition": "org.onap.policy.controlloop.VirtualControlLoopEvent" } ClusterIP 10.43.45.35 <none> } ] 6969/TCP } } 9d } } }, "eventOutputParameters": { "FirstProducer": { "carrierTechnologyParameters": { |
If it's already exposed you will see Nodeport instead of ClusterIp.
Expose policy:
Code Block | ||
---|---|---|
| ||
kubectl edit svc policy-api
//change spec type to NodePort
spec:
clusterIP: {IP}
ports:
- name: policy-pap
port: 6969
protocol: TCP
targetPort: 6969
selector:
app: pap
release: frankfurt
sessionAffinity: None
type: NodePort
kubectl edit svc policy-pap |
Code Block | ||
---|---|---|
| ||
kubectl get svc | grep policy policy-apex-pdp ClusterIP 10.43.29.86 "carrierTechnology": "FILE", <none> "parameters": { 6969/TCP "standardIo": true } }, 9d policy-api "eventProtocolParameters": { NodePort 10.43.197.94 <none> "eventProtocol": "JSON" } 6969:30687/TCP } }, "eventInputParameters": { "DCAEConsumer": {9d policy-distribution ClusterIP 10.43.129.175 "carrierTechnologyParameters":<none> { "carrierTechnology": "RESTCLIENT", 6969/TCP "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { "url": "http://message-router:3904/events/unauthenticated.DCAE_CL_OUTPUT/g1/c1?timeout=60000"9d policy-handler ClusterIP } 10.43.149.5 <none> }, "eventProtocolParameters": { 80/TCP "eventProtocol": "JSON", "parameters": { 9d policy-mariadb "nameAlias": "policyName", ClusterIP None "versionAlias": "version", <none> "sourceAlias": "from", 3306/TCP "pojoField": "VirtualControlLoopEvent" } } 9d policy-pap } NodePort } 10.43.230.71 <none> } } } ] } } |
4) Deploy BBS policy
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST
URL: {{POLICY-PAP-URL}}/policy/pap/v1/pdps/deployments/batch |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ 6969:31620/TCP "groups": [ { "name": "defaultGroup", "deploymentSubgroups": [9d policy-xacml-pdp ClusterIP { 10.43.104.92 <none> "pdpType": "apex", 6969/TCP "action": "POST", "policies": [{ 9d |
Postman Collection: BBS APEX Policy API Frankfurt.postman_collection.json.zip
1) Make Sure APEX PDP is running and in Active state
Code Block | ||||
---|---|---|---|---|
| ||||
API: GET URL: {{POLICY-PAP-URL}}/policy/pap/v1/pdps |
2) Create the operational control loop APEX policy type
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST
URL: {{POLICY-API-URL}}/policy/api/v1/policytypes |
JSON payload: https://git.onap.org/integration/usecases/bbs/tree/policy/apex/json/bbs_policytypes.json
3) Create BBS APEX policy
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST "name": "URL: {{POLICY-API-URL}}/policy/api/v1/policytypes/onap.policies.controlloop.operational.apex.onapbbs", "version": "1.0.2" }] } ] } ] }.Apex/versions/1.0.0/policies |
JSON payload: https://git.onap.org/integration/usecases/bbs/tree/policy/apex/json/bbs_create_policy.json
4) Deploy BBS policy
Code Block | ||||
---|---|---|---|---|
| ||||
API: POST
URL: {{POLICY-PAP-URL}}/policy/pap/v1/pdps/policies |
JSON payload: https://git.onap.org/integration/usecases/bbs/tree/policy/apex/json/bbs_simple_deploy.json
5) Verify the deployment
Code Block | ||||
---|---|---|---|---|
| ||||
API: GET URL: {{POLICY-API-URL}}/policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies/ |
...
Multimedia | ||||
---|---|---|---|---|
|
Simplified E2E Service Model (Frankfurt):
Multimedia | ||
---|---|---|
|
BSS HSIA Service Order: Request Input
...