- Created by Xin Miao (Unlicensed), last modified on Jul 06, 2020
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 13 Next »
Introduction
This CL story is specified here as inter domain link restoration process. It is considered as an extension of MDONS use case from ONAP Frankfurt release.
key | summary | type | created | updated | due | assignee | reporter | priority | status | resolution |
---|
Design & Implementation
The scope of code change will be very limited with the existing capability at ONAP CLAMP, DCAE and POLICY components. Given the fact that FNC Virtuora MSA support has already delivered
L0/L1 alarms and PM data in VES (CEDM) (7.0 version) format. However, those delivered through TAPI APIs are retrieved from FPM server and converted into TAPI standard in Json format.
HLD
Close Loop Diagram in MDONS
- SDC/DCAEMOD/Policy Portal design and activate policy.
- Policy config and activate the policy.
- SDC/DCAEMOD distribute the DCAE config.
- SDC/DCAEMOD/HOMES UI distribute the alarm correlation rules to Holmes.
- 3rd party domain controllers report link down alarm to DCAE
- DCAE will do data cleaning and filtering for the alarms
- DCAE keep track the data.
- Holmes do analysis for the alarms.
- Holmes notify the reroute event.
- Policy matching the reroute rules.
- Policy call SO or SDNC to delete the old services and create the new services. For the creation flow, a variable route will be recalculated.
Domain Controller APIs
MSA
TAPI
DCAE
Data Collection Diagram
Option 1 - RCC/VES Mapper
If the notification data is received from domain controller in non-VES format, such as, TAPI, and/or other JSON format, RCC is the data collection micro-service and VES Mapper micro-service is needed to convert the alarm notification into VES format.
RestConf Collector (RCC)
In MDONS use case, prior to subscribing to topics to get event notifications. We manually register 'DCAE' in the domain controller (DC). Once registration is successful, system can subscribe to different topics of DC to get event notification. It is mandatory to pass 'notification URL' to DC so that when event occurs it posts notification to that URL.
DCAEGEN2-2293 - Getting issue details... STATUS
Alarm Notification
- TAPI Alarm Notification[TAPI format]
{ "notification": [ { "notification-type": "ALARM_EVENT", "target-object-name": [ { "value-name": "node-id", "value": "S100-NODE2" }, { "value-name": "entity-type", "value": "slot" }, { "value-name": "entity-id", "value": "Slot-1/4" } ], "source-indicator": "RESOURCE_OPERATION", "uuid": "76234954-30a2-11e9-a785-dd6c51454c4e", "event-time-stamp": "20190208220426.3Z", "additional-text": "Equipment Removed:Type=PIS1-PG31", "alarm-info": { "service-affecting": "SERVICE_AFFECTING", "probable-cause": "al-types:equipmentRemoved", "is-transient": false, "pervceived-severity": "CRITICAL" }, "additional-info": [ { "value-name": "location", "value": "NEND" }, { "value-name": "direction", "value": "NA" } ], "target-object-identifier": "S100-NODE2:slot:Slot-1/4", "name": [ { "value-name": "alarm-id", "value": "S100-NODE2slotal-types:equipmentRemovedSlot-1/4NANEND" } ] }, ... ... ] }
- OpenRoadM Alarm Notification[VES format]
{ "event": { "commonEventHeader": { "sourceId": "owb-rdm-003", "startEpochMicrosec": 1469528413000, "eventId": "owb-rdm-003 1", "reportingEntityId": "127.0.1.1", "eventType": "fault_owb-rdm-003_lossOfSignal", "priority": "High", "version": 1.0, "reportingEntityName": "agilevm", "sequence": 0, "domain": "fault", "functionalRole": "rdm", "lastEpochMicrosec": 1469528413000, "sourceName": "owb-rdm-003" }, "faultFields": { "eventSeverity": "CRITICAL", "alarmCondition": "lossOfSignal", "faultFieldsVersion": 1.0, "specificProblem": "lossOfSignal", "alarmInterfaceA": "oms-1/0/0/E1", "alarmAdditionalInformation": [ { "name": "direction", "value": "rx" }, { "name": “location", "value": "NEND" }, { "name": "type", "value": "communication" }, { "name": "circuit-id", "value": "100 OMS DLLSTXRIS50 DLLSTXTAW10" }, { "name": "additional-detail", "value": "sample detail" }, { "name": "corrective-action", "value": "sample action" } ], "eventSourceType": "interface", "vfStatus": "Active" } } }
Since MSA notification is already in VES format, it could be posted directly on to DMAAP with relevant topic to be consumed by Hulmes directly. If RCC does not support such configuration, then a 1n1 attribute mirroring mapping xml file need to be designed to feed the data into the existing flow. Thus, VES Mapper plays the role of VES event validation as it is required functionality in VES collector.
MS Blueprint
This is the RCC blueprint which defines the initial configuration for alarm collection in MDONS close loop. RCC supports multiple DC connections.
rcc_policy: rcc_policy: '[{"controller_name":"VirtuoraNC","controller_restapiUrl":"167.254.204.181:8443","controller_restapiUser":"admin","controller_restapiPassword":"admin","controller_accessTokenUrl":"/rest/plat/smapp/v1/oauth/token","controller_accessTokenFile":"./etc/access-token.json","controller_accessTokenMethod":"put","controller_subsMethod":"post","controller_subscriptionUrl":"/cxf/subscriptions","controller_disableSsl":"true","event_details":[{"event_name":"MSA_Alarm_Subscription","event_description":"AlarmEvent","event_sseventUrlEmbed":"false","event_sseventsField":"null","event_sseventsUrl":"null","event_subscriptionTemplate":"./etc/MSA_Alarm_Subscription_template.json","event_unSubscriptionTemplate":"./etc/MSA_Alarm_Unsubscription_template.json","modifyData": "true","modifyMethod": "modifyMSAEvent"]}]'
RCC_Output Event
This event is the output to be posted on Dmaap by RCC and will be consumed by VES Mapper.
{ "tapi-notifyid":"example-mappingfile-id.x.1", "notification": [ { "notification-type": "ALARM_EVENT", "target-object-name": [ { "value-name": "node-id", "value": "S100-NODE2" }, { "value-name": "entity-type", "value": "slot" }, { "value-name": "entity-id", "value": "Slot-1/4" } ], "source-indicator": "RESOURCE_OPERATION", "uuid": "76234954-30a2-11e9-a785-dd6c51454c4e", "event-time-stamp": "20190208220426.3Z", "additional-text": "Equipment Removed:Type=PIS1-PG31", "alarm-info": { "service-affecting": "SERVICE_AFFECTING", "probable-cause": "al-types:equipmentRemoved", "is-transient": false, "pervceived-severity": "CRITICAL" }, "additional-info": [ { "value-name": "location", "value": "NEND" }, { "value-name": "direction", "value": "NA" } ], "target-object-identifier": "S100-NODE2:slot:Slot-1/4", "name": [ { "value-name": "alarm-id", "value": "S100-NODE2slotal-types:equipmentRemovedSlot-1/4NANEND" } ] }, ... ... ] }
VES Mapper
Mapping File
- TAPI Alarm to VES Mapping template
<?xml version="1.0" encoding="UTF-8"?><smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.4.xsd" xmlns:json="http://www.milyn.org/xsd/smooks/json-1.1.xsd"> <json:reader rootName="vesevent" keyWhitspaceReplacement="-"> <json:keyMap> <json:key from="date&time" to="date-and-time" /> </json:keyMap> </json:reader> <jb:bean class="org.onap.dcaegen2.ves.domain.ves54.VesEvent" beanId="vesEvent" createOnElement="vesevent"> <jb:wiring property="event" beanIdRef="event" /> </jb:bean> <jb:bean class="org.onap.dcaegen2.ves.domain.ves54.Event" beanId="event" createOnElement="vesevent"> <jb:wiring property="commonEventHeader" beanIdRef="commonEventHeader" /> <jb:wiring property="faultFields" beanIdRef="faultFields" /> </jb:bean> <jb:bean class="org.onap.dcaegen2.ves.domain.ves54.CommonEventHeader" beanId="commonEventHeader" createOnElement="vesevent"> <jb:expression property="version">'1.0'</jb:expression> <jb:expression property="eventType">'fault_OWB-RDM-NE1_equipmentFault'</jb:expression> <jb:expression property="eventId" execOnElement="vesevent">'QWB-RDM-NE1 23'</jb:expression> <jb:expression property="functionalRole">'NA'</jb:expression> <jb:expression property="reportingEntityName">'emf171195Cluster'</jb:expression> <jb:expression property="reportingEntityId">'10.249.26.175'</jb:expression> <jb:expression property="domain">'fault'</jb:expression> <jb:value property="sequence" data="0" default="0" decoder="Long" /> <jb:value property="lastEpochMicrosec" data="1487894721807000"/> <jb:value property="startEpochMicrosec" data="1487894721807000"/> <jb:expression property="priority">'Medium'</jb:expression> <jb:expression property="sourceName">'OWB-RDM-NE1'</jb:expression> <jb:expression property="sourceId">'OWB-RDM-NE1'</jb:expression> </jb:bean> <jb:bean class="org.onap.dcaegen2.ves.domain.ves54.FaultFields" beanId="faultFields" createOnElement="vesevent"> <jb:value property="faultFieldsVersion" data="1.0" default="1.0" decoder="Double" /> <jb:value property="alarmCondition" data="equipmentFault" /> <jb:Value property="alarmInterfaceA" data="2"/> <jb:expression property="specificProblem">'equipmentFault'</jb:expression> <jb:expression property="vfStatus">'Active'</jb:expression> <jb:expression property="eventSeverity">'MAJOR'</jb:expression> <jb:expression property="eventSourcTeype">'Shelf'</jb:expression> <jb:wiring property="alarmAdditionalInformation" beanIdRef="alarmAdditionalInformationroot" /> </jb:bean> <jb:bean class="java.util.ArrayList" beanId="alarmAdditionalInformationroot" createOnElement="vesevent"> <jb:wiring beanIdRef="alarmAdditionalInformation" /> </jb:bean> <jb:bean class="org.onap.dcaegen2.ves.domain.ves54.AlarmAdditionalInformation" beanId="alarmAdditionalInformation" createOnElement="varbinds/element"> <jb:value property="name" data="direction" /> <jb:value property="value" data="tx" /> <jb:value property="name" data="location" /> <jb:value property="value" data="NEND" /> <jb:value property="name" data="type" /> <jb:value property="value" data="equipment" /> <jb:value property="name" data="circuit-id" /> <jb:value property="value" data="" /> </jb:bean></smooks-resource-list>
- MSA Data are already in VES format. If VES Collector supports Rest API notification mode, MDONS can use VES collector for OpenRoadM data collection from domain controller.
VES Event
Mapper output as an VES event is posted back to Dmaap.
Option 2 - VES Colloctor
In case the domain controller acts like a VES client that can deliver the notification data in VES format, VES collector micro-service is needed and VES mapper could be skipped in the data collection flow in MDONS closed instance.
HOLMES
HOLMES-312 - Getting issue details... STATUS
AAI APIs
Upon receiving NNI down alarm:
- AAI APIs - APIs to update status of related NNI status, retrieve alarm correlation keys and related service instance IDs, etc.
Code change needs to be introduced for functions to adapt the above AAI APIs from the correlation rules.
Drools Rule - Alarm Correlation
- Alarm Correlation Rules - Drools rules design time from SDC or Holmes UI to correlate the alarms.
package org.onap.holmes.mdonsPnf; dialect "java" import org.onap.holmes.common.api.stat.VesAlarm; import org.onap.holmes.common.api.stat.AlarmAdditionalField; import org.onap.holmes.common.aai.AaiQueryMdons; import org.onap.holmes.common.exception.CorrelationException; import org.onap.holmes.common.dmaap.entity.PolicyMsg; import org.onap.holmes.common.dmaap.DmaapService; import org.onap.holmes.common.utils.DroolsLog; import org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.List; import java.util.Map; import java.util.ArrayList; import java.util.HashMap; import java.util.UUID; function Map<String, String> processAlarm(String sourceId) { AaiQueryMdons mdons = AaiQueryMdons.newInstance(); DroolsLog.printInfo("Alarm pnf id " + sourceId); String pnfName = mdons.getPnfNameFromPnfId(sourceId); DroolsLog.printInfo("Pnf name from AAI" + pnfName); mdons.updatePnfOperationalStatus(pnfName, "down"); Map<String, String> accessMap = mdons.processPnf(pnfName); DroolsLog.printInfo("Access List from AAI" + accessMap.toString()); mdons.updateLinksForAccessService(accessMap); return accessMap; } function void processAlarmCleared(String sourceId) { AaiQueryMdons mdons = AaiQueryMdons.newInstance(); DroolsLog.printInfo("Alarm pnf id " + sourceId); String pnfName = mdons.getPnfNameFromPnfId(sourceId); DroolsLog.printInfo("Pnf name from AAI" + pnfName); mdons.updatePnfOperationalStatus(pnfName, "up"); } function PolicyMsg createPolicyMsg(VesAlarm alarm, String serviceInstanceId, String serviceName) { PolicyMsg m = new PolicyMsg(); m.setPolicyVersion("1.0.0"); m.setVersion("0.0.1"); m.setPolicyName("mdons"); m.setPolicyScope("service=OTNService,type=SampleType,closedLoopControlName=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b"); m.setClosedLoopControlName("ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b"); m.setRequestID(UUID.randomUUID().toString()); m.setClosedLoopAlarmStart(alarm.getStartEpochMicrosec()); m.setClosedLoopAlarmEnd(alarm.getLastEpochMicrosec()); m.setTarget("vserver.vserver-name"); m.setAai(getAaiObjectPolicy(serviceName, serviceInstanceId)); DmaapService.alarmUniqueRequestID.put(alarm.getEventId(), m.getRequestID()); return m; } function Map<String, Object> getAaiObjectPolicy(String serviceName, String serviceInstanceId){ Map<String, Object> aaiMap = new HashMap<String, Object>(); aaiMap.put("service-name", serviceName); aaiMap.put("request-id" , serviceInstanceId); aaiMap.put("service-type" , "MDONS_OTN"); return aaiMap; } rule "Process Alarms MSA" no-loop true salience 200 when $a: VesAlarm(sourceId.contains("OWBSPDRNE"), rootFlag != 1, eventSeverity.equals("MAJOR")) then DroolsLog.printInfo("MSA Alarm: ID for alarm raised=" + $a.getEventId() + ", Event Name=" + $a.getSourceId()); Map<String, String> map = processAlarm($a.getSourceId() + "-XPDR1"); for(Map.Entry<String,String> entry : map.entrySet()){ PolicyMsg msg = createPolicyMsg($a, entry.getKey(), entry.getValue()); DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class); dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_Output_Event"); DroolsLog.printInfo("Published to policy=" + msg.toString()); } $a.setRootFlag(1); end rule "Process Alarms TAPI" no-loop true salience 200 when $a: VesAlarm(eventId.contains("FW950074SDN"), rootFlag != 1, eventSeverity.equals("MINOR")) then DroolsLog.printInfo("TAPI Alarm: ID for alarm raised=" + $a.getEventId() + ", Event Name=" + $a.getSourceId()); Map<String, String> map = processAlarm($a.getEventId()); for(Map.Entry<String,String> entry : map.entrySet()){ PolicyMsg msg = createPolicyMsg($a, entry.getKey(), entry.getValue()); DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class); dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_Output_Event"); DroolsLog.printInfo("Published to policy=" + msg.toString()); } $a.setRootFlag(1); end rule "Process Alarms cleared MSA" no-loop true salience 200 when $a: VesAlarm(sourceId.contains("OWBSPDRNE"), rootFlag != 1, eventSeverity.equals("NORMAL")) then DroolsLog.printInfo("MSA Alarm: ID for Alarm cleared =" + $a.getEventId() + ", Event Name=" + $a.getSourceId()); processAlarmCleared($a.getSourceId() + "-XPDR1"); $a.setRootFlag(1); end rule "Process Alarms cleared TAPI" no-loop true salience 200 when $a: VesAlarm(eventId.contains("FW950074SDN"), rootFlag != 1, eventSeverity.equals("NORMAL")) then DroolsLog.printInfo("TAPI Alarm: ID for Alarm cleared =" + $a.getEventId() + ", Event Name=" + $a.getSourceId()); processAlarmCleared($a.getEventId()); $a.setRootFlag(1); end
Upon receiving NNI up notification - update the status of the NNI in AAI.
Output
{ "closedLoopEventClient": "DCAE.MDONS-eventProcessor", "policyVersion": "1.0.0", "policyName": "MDONS", "policyScope": "service=OTNService", "target_type": "VM", "AAI": { "request-id":"1166bf8b-17a2-42ba-87c9-d05dc99799a1", "service-name":"ECHService1", "service-type":"MDONS_OTN" }, "closedLoopAlarmStart": 1484677482204798, "closedLoopEventStatus": "ONSET", "closedLoopControlName": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "1.0.2", "target": "vserver.vserver-name", "requestID": "97964e10-686e-4790-8c45-bdfa61df770f", "from": "DCAE" }
POLICY
Operational Policy
controlLoop: version: 2.0.0 controlLoopName: ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b trigger_policy: unique-policy-id-for-Reroute timeout: 3600 policies: - id: unique-policy-id-for-Reroute name: Domain Service Creation Reroute description: actor: SDNC recipe: Reroute target: resourceID: 2179b738-fd36-4843-a71a-a8c24c70c66b type: VM retry: 3 timeout: 1200 success: final_success failure: final_failure failure_timeout: final_failure_timeout failure_retries: final_failure_retries failure_exception: final_failure_exception failure_guard: final_failure_guard
Policy Engine - Apex
Apex Policy Engine is used in MDONS use case to execute the operational Policy.
Apex Configuration
{ "engineServiceParameters": { "name": "MDONSApexEngine", "version": "0.0.1", "id": 45, "instanceCount": 1, "deploymentPort": 12561, "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" } } } } } } }, "eventInputParameters": { "DCAEConsumer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { "url": "https://message-router:3905/events/unauthenticated.DCAE_Output_Event/g1/c1?timeout=60000" } }, "eventProtocolParameters": { "eventProtocol": "JSON", "parameters": { "nameAlias": "closedLoopControlName", "versionAlias": "version", "sourceAlias": "from" } } } }, "eventOutputParameters": { "logOutputter": { "carrierTechnologyParameters": { "carrierTechnology": "FILE", "parameters": { "fileName": "outputevents.log" } }, "eventProtocolParameters": { "eventProtocol": "JSON" } }, "SDNCRequestProducer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { "url": "http://sdnc-oam:8282/restconf/operations/SLI-API:execute-graph", "httpMethod": "POST", "httpHeaders" : [ ["Authorization", "Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=="], ["Accept","application/json"], ["Content-Type","application/json"] ] } }, "eventProtocolParameters": { "eventProtocol": "JSON", "parameters": { "pojoField": "SDNCInput" } } } } }
Apex Policy
model create name=ApexMDONSPolicy schema create name=SimpleStringType flavour=Java schema=java.lang.String schema create name=UUIDType flavour=Java schema=java.util.UUID schema create name=SimpleIntType flavour=Java schema=java.lang.Integer schema create name=VirtualControlLoopEvent flavour=Avro schema=LS #MACROFILE:"src/main/resources/schemas/VirtualControlLoopEvent.avsc" LE schema create name=SDNCInput flavour=Avro schema=LS #MACROFILE:"src/main/resources/schemas/SDNCInput.avsc" LE event create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b version=0.0.1 nameSpace=org.onap.policy.apex.onap.pmcontrol source=DCAE target=APEX event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=closedLoopEventClient schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=policyVersion schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=policyName schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=policyScope schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=target_type schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=closedLoopAlarmStart schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=closedLoopEventStatus schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=closedLoopControlName schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=version schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=target schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=requestID schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=from schemaName=SimpleStringType event parameter create name=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b parName=AAI schemaName=VirtualControlLoopEvent event create name=SDNCRequestEvent nameSpace=org.onap.policy.apex.onap.pmcontrol source=APEX target=SDNC event parameter create name=SDNCRequestEvent parName=SDNCInput schemaName=SDNCInput task create name=CreateSDNCRequestPayloadTask task inputfield create name=CreateSDNCRequestPayloadTask fieldName=AAI schemaName=VirtualControlLoopEvent task outputfield create name=CreateSDNCRequestPayloadTask fieldName=SDNCInput schemaName=SDNCInput task logic create name=CreateSDNCRequestPayloadTask logicFlavour=JAVASCRIPT logic=LS #MACROFILE:"src/main/resources/logic/CreateSDNCRequestPayloadTask.js" LE policy create name=CreateEventPolicy template=Freestyle firstState=CreateService policy state create name=CreateEventPolicy stateName=CreateService triggerName=ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b defaultTaskName=CreateSDNCRequestPayloadTask policy state output create name=CreateEventPolicy stateName=CreateService outputName=SDNCRequestOutput eventName=SDNCRequestEvent nextState=NULL policy state taskref create name=CreateEventPolicy stateName=CreateService taskName=CreateSDNCRequestPayloadTask outputType=DIRECT outputName=SDNCRequestOutput validate
Policy Tosca Json
{ "tosca_definitions_version": "tosca_simple_yaml_1_1_0", "topology_template": { "policies": [ { "onap.policies.native.apex.MDONS": { "type": "onap.policies.native.Apex", "type_version": "1.0.0", "name": "onap.policies.native.apex.MDONS", "version": "1.0.0", "properties": { "engineServiceParameters": { "name": "MDONSApexEngine", "version": "0.0.1", "id": 45, "instanceCount": 1, "deploymentPort": 12561, "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": "ApexMDONSPolicy", "version": "0.0.1" }, "keyInformation": { "key": { "name": "ApexMDONSPolicy_KeyInfo", "version": "0.0.1" }, "keyInfoMap": { "entry": [ { "key": { "name": "ApexMDONSPolicy", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy", "version": "0.0.1" }, "UUID": "10bde69d-ec18-3588-8d3a-466ffffc171d", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy:0.0.1\"" } }, { "key": { "name": "ApexMDONSPolicy_Events", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy_Events", "version": "0.0.1" }, "UUID": "11878f1e-c494-3a47-9d3b-82546509bd27", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Events:0.0.1\"" } }, { "key": { "name": "ApexMDONSPolicy_KeyInfo", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy_KeyInfo", "version": "0.0.1" }, "UUID": "27aa4d87-3bb9-398a-ac0c-18a42dde984d", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy_KeyInfo:0.0.1\"" } }, { "key": { "name": "ApexMDONSPolicy_Policies", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy_Policies", "version": "0.0.1" }, "UUID": "29c20a92-695a-3d0d-bd4c-477b9e89f442", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Policies:0.0.1\"" } }, { "key": { "name": "ApexMDONSPolicy_Schemas", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy_Schemas", "version": "0.0.1" }, "UUID": "df5e3e94-8581-375c-ae7c-53836351db1d", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Schemas:0.0.1\"" } }, { "key": { "name": "ApexMDONSPolicy_Tasks", "version": "0.0.1" }, "value": { "key": { "name": "ApexMDONSPolicy_Tasks", "version": "0.0.1" }, "UUID": "8b6d3c45-73f6-3337-886f-31105e11868a", "description": "Generated description for concept referred to by key \"ApexMDONSPolicy_Tasks:0.0.1\"" } }, { "key": { "name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "0.0.1" }, "value": { "key": { "name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "0.0.1" }, "UUID": "e1cbb2de-320d-31d5-91c5-1dc3e5434a64", "description": "Generated description for concept referred to by key \"ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b:0.0.1\"" } }, { "key": { "name": "CreateEventPolicy", "version": "0.0.1" }, "value": { "key": { "name": "CreateEventPolicy", "version": "0.0.1" }, "UUID": "0105451b-d7b5-3bab-99cb-afdd29c02d98", "description": "Generated description for concept referred to by key \"CreateEventPolicy:0.0.1\"" } }, { "key": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "value": { "key": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "UUID": "8f2c3cbb-a190-3783-96c4-1ebce78d1fa4", "description": "Generated description for concept referred to by key \"CreateSDNCRequestPayloadTask:0.0.1\"" } }, { "key": { "name": "SDNCInput", "version": "0.0.1" }, "value": { "key": { "name": "SDNCInput", "version": "0.0.1" }, "UUID": "1a7709ce-55fe-340a-90f9-dbb73a5cbcbf", "description": "Generated description for concept referred to by key \"SDNCInput:0.0.1\"" } }, { "key": { "name": "SDNCRequestEvent", "version": "0.0.1" }, "value": { "key": { "name": "SDNCRequestEvent", "version": "0.0.1" }, "UUID": "ae1d3c7c-37e0-30d9-8af8-1a7ae8407c86", "description": "Generated description for concept referred to by key \"SDNCRequestEvent:0.0.1\"" } }, { "key": { "name": "SimpleIntType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleIntType", "version": "0.0.1" }, "UUID": "153791fd-ae0a-36a7-88a5-309a7936415d", "description": "Generated description for concept referred to by key \"SimpleIntType: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": "VirtualControlLoopEvent", "version": "0.0.1" }, "value": { "key": { "name": "VirtualControlLoopEvent", "version": "0.0.1" }, "UUID": "600699f3-da4e-3d91-846c-c79953487679", "description": "Generated description for concept referred to by key \"VirtualControlLoopEvent:0.0.1\"" } } ] } }, "policies": { "key": { "name": "ApexMDONSPolicy_Policies", "version": "0.0.1" }, "policyMap": { "entry": [ { "key": { "name": "CreateEventPolicy", "version": "0.0.1" }, "value": { "policyKey": { "name": "CreateEventPolicy", "version": "0.0.1" }, "template": "Freestyle", "state": { "entry": [ { "key": "CreateService", "value": { "stateKey": { "parentKeyName": "CreateEventPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "NULL", "localName": "CreateService" }, "trigger": { "name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "0.0.1" }, "stateOutputs": { "entry": [ { "key": "SDNCRequestOutput", "value": { "key": { "parentKeyName": "CreateEventPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "CreateService", "localName": "SDNCRequestOutput" }, "outgoingEvent": { "name": "SDNCRequestEvent", "version": "0.0.1" }, "nextState": { "parentKeyName": "NULL", "parentKeyVersion": "0.0.0", "parentLocalName": "NULL", "localName": "NULL" } } } ] }, "contextAlbumReference": [], "taskSelectionLogic": { "key": "NULL", "logicFlavour": "UNDEFINED", "logic": "" }, "stateFinalizerLogicMap": { "entry": [] }, "defaultTask": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "taskReferences": { "entry": [ { "key": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "value": { "key": { "parentKeyName": "CreateEventPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "CreateService", "localName": "CreateEventPolicy" }, "outputType": "DIRECT", "output": { "parentKeyName": "CreateEventPolicy", "parentKeyVersion": "0.0.1", "parentLocalName": "CreateService", "localName": "SDNCRequestOutput" } } } ] } } } ] }, "firstState": "CreateService" } } ] } }, "tasks": { "key": { "name": "ApexMDONSPolicy_Tasks", "version": "0.0.1" }, "taskMap": { "entry": [ { "key": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "value": { "key": { "name": "CreateSDNCRequestPayloadTask", "version": "0.0.1" }, "inputFields": { "entry": [ { "key": "AAI", "value": { "key": "AAI", "fieldSchemaKey": { "name": "VirtualControlLoopEvent", "version": "0.0.1" }, "optional": false } } ] }, "outputFields": { "entry": [ { "key": "SDNCInput", "value": { "key": "SDNCInput", "fieldSchemaKey": { "name": "SDNCInput", "version": "0.0.1" }, "optional": false } } ] }, "taskParameters": { "entry": [] }, "contextAlbumReference": [], "taskLogic": { "key": "TaskLogic", "logicFlavour": "JAVASCRIPT", "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2020 Fujitsu. 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 */\n\nvar SDNCInput = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewInstance();\nvar input = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"input\");\n \nvar clEvent = executor.inFields.get(\"AAI\");\nexecutor.logger.info(clEvent.toString());\n\ninput.put(\"module_DasH_name\",\"optical-service\");\ninput.put(\"rpc_DasH_name\",\"mdons-closed-loop\");\ninput.put(\"mode\",\"sync\");\n\nvar sliParam1 = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"sli_DasH_parameter_record\");\nsliParam1.put(\"parameter_DasH_name\",\"service-name\");\nsliParam1.put(\"string_DasH_value\",clEvent.get(\"service_DasH_name\"));\n\nvar sliParam2 = executor.subject.getOutFieldSchemaHelper(\"SDNCInput\").createNewSubInstance(\"sli_DasH_parameter_record\");\nsliParam2.put(\"parameter_DasH_name\",\"access-service-id\");\nsliParam2.put(\"string_DasH_value\",clEvent.get(\"request_DasH_id\"));\n\nvar sliParamArray = [];\nsliParamArray.push(sliParam1);\nsliParamArray.push(sliParam2);\n\ninput.put(\"sli_DasH_parameter\",sliParamArray);\nSDNCInput.put(\"input\",input);\n\nexecutor.outFields.put(\"SDNCInput\", SDNCInput);\n\nexecutor.logger.info(SDNCInput.toString());\n\ntrue;" } } } ] } }, "events": { "key": { "name": "ApexMDONSPolicy_Events", "version": "0.0.1" }, "eventMap": { "entry": [ { "key": { "name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "0.0.1" }, "value": { "key": { "name": "ControlLoop-MDONS-2179b738-fd36-4843-a71a-a8c24c70c66b", "version": "0.0.1" }, "nameSpace": "org.onap.policy.apex.onap.pmcontrol", "source": "DCAE", "target": "APEX", "parameter": { "entry": [ { "key": "AAI", "value": { "key": "AAI", "fieldSchemaKey": { "name": "VirtualControlLoopEvent", "version": "0.0.1" }, "optional": false } }, { "key": "closedLoopAlarmStart", "value": { "key": "closedLoopAlarmStart", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "closedLoopControlName", "value": { "key": "closedLoopControlName", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "closedLoopEventClient", "value": { "key": "closedLoopEventClient", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "closedLoopEventStatus", "value": { "key": "closedLoopEventStatus", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "from", "value": { "key": "from", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "policyName", "value": { "key": "policyName", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "policyScope", "value": { "key": "policyScope", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "policyVersion", "value": { "key": "policyVersion", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "requestID", "value": { "key": "requestID", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "target", "value": { "key": "target", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "target_type", "value": { "key": "target_type", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } }, { "key": "version", "value": { "key": "version", "fieldSchemaKey": { "name": "SimpleStringType", "version": "0.0.1" }, "optional": false } } ] } } }, { "key": { "name": "SDNCRequestEvent", "version": "0.0.1" }, "value": { "key": { "name": "SDNCRequestEvent", "version": "0.0.1" }, "nameSpace": "org.onap.policy.apex.onap.pmcontrol", "source": "APEX", "target": "SDNC", "parameter": { "entry": [ { "key": "SDNCInput", "value": { "key": "SDNCInput", "fieldSchemaKey": { "name": "SDNCInput", "version": "0.0.1" }, "optional": false } } ] } } } ] } }, "schemas": { "key": { "name": "ApexMDONSPolicy_Schemas", "version": "0.0.1" }, "schemas": { "entry": [ { "key": { "name": "SDNCInput", "version": "0.0.1" }, "value": { "key": { "name": "SDNCInput", "version": "0.0.1" }, "schemaFlavour": "Avro", "schemaDefinition": "{\n \"name\": \"SDNCInput\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"input\",\n \"type\": {\n \"name\": \"input\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"module_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rpc_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sli_DasH_parameter\",\n \"type\": {\n \"type\": \"array\",\n \"items\": {\n \"name\": \"sli_DasH_parameter_record\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"parameter_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"string_DasH_value\",\n \"type\": \"string\"\n }\n ]\n }\n }\n }\n ]\n }\n }\n ]\n}" } }, { "key": { "name": "SimpleIntType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleIntType", "version": "0.0.1" }, "schemaFlavour": "Java", "schemaDefinition": "java.lang.Integer" } }, { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "value": { "key": { "name": "SimpleStringType", "version": "0.0.1" }, "schemaFlavour": "Java", "schemaDefinition": "java.lang.String" } }, { "key": { "name": "UUIDType", "version": "0.0.1" }, "value": { "key": { "name": "UUIDType", "version": "0.0.1" }, "schemaFlavour": "Java", "schemaDefinition": "java.util.UUID" } }, { "key": { "name": "VirtualControlLoopEvent", "version": "0.0.1" }, "value": { "key": { "name": "VirtualControlLoopEvent", "version": "0.0.1" }, "schemaFlavour": "Avro", "schemaDefinition": "{\n \"name\": \"AAI\",\n \"type\": \"record\",\n \"fields\": [\n {\n \"name\": \"request_DasH_id\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service_DasH_name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service_DasH_type\",\n \"type\": \"string\"\n }\n ]\n}" } } ] } } } } }, "eventInputParameters": { "DCAEConsumer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { "url": "https://message-router:3905/events/unauthenticated.DCAE_Output_Event/g1/c1?timeout=60000" } }, "eventProtocolParameters": { "eventProtocol": "JSON", "parameters": { "nameAlias": "closedLoopControlName", "versionAlias": "version", "sourceAlias": "from" } } } }, "eventOutputParameters": { "logOutputter": { "carrierTechnologyParameters": { "carrierTechnology": "FILE", "parameters": { "fileName": "outputevents.log" } }, "eventProtocolParameters": { "eventProtocol": "JSON" } }, "SDNCRequestProducer": { "carrierTechnologyParameters": { "carrierTechnology": "RESTCLIENT", "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restclient.RestClientCarrierTechnologyParameters", "parameters": { "url": "http://sdnc-oam:8282/restconf/operations/SLI-API:execute-graph", "httpMethod": "POST", "httpHeaders": [ [ "Authorization", "Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" ], [ "Accept", "application/json" ], [ "Content-Type", "application/json" ] ] } }, "eventProtocolParameters": { "eventProtocol": "JSON", "parameters": { "pojoField": "SDNCInput" } } } } } } } ] } }
Policy Logic
var SDNCInput = executor.subject.getOutFieldSchemaHelper("SDNCInput").createNewInstance(); var input = executor.subject.getOutFieldSchemaHelper("SDNCInput").createNewSubInstance("input"); var clEvent = executor.inFields.get("AAI"); executor.logger.info(clEvent.toString()); input.put("module_DasH_name","optical-service"); input.put("rpc_DasH_name","mdons-closed-loop"); input.put("mode","sync"); var sliParam1 = executor.subject.getOutFieldSchemaHelper("SDNCInput").createNewSubInstance("sli_DasH_parameter_record"); sliParam1.put("parameter_DasH_name","service-name"); sliParam1.put("string_DasH_value",clEvent.get("service_DasH_name")); var sliParam2 = executor.subject.getOutFieldSchemaHelper("SDNCInput").createNewSubInstance("sli_DasH_parameter_record"); sliParam2.put("parameter_DasH_name","access-service-id"); sliParam2.put("string_DasH_value",clEvent.get("request_DasH_id")); var sliParamArray = []; sliParamArray.push(sliParam1); sliParamArray.push(sliParam2); input.put("sli_DasH_parameter",sliParamArray); SDNCInput.put("input",input); executor.outFields.put("SDNCInput", SDNCInput); executor.logger.info(SDNCInput.toString()); true;
Policy Schema
{ "name": "SDNCInput", "type": "record", "fields": [ { "name": "input", "type": { "name": "input", "type": "record", "fields": [ { "name": "module_DasH_name", "type": "string" }, { "name": "rpc_DasH_name", "type": "string" }, { "name": "mode", "type": "string" }, { "name": "sli_DasH_parameter", "type": { "type": "array", "items": { "name": "sli_DasH_parameter_record", "type": "record", "fields": [ { "name": "parameter_DasH_name", "type": "string" }, { "name": "string_DasH_value", "type": "string" } ] } } } ] } } ] }
SDNC API
SDNC-1233 - Getting issue details... STATUS
Upon receiving the alarm event, DCAE_Output_Event, an SDNC API is called to do the following:
- Upda, te OTN service instance status.
- Lookup for available IDL
- Delete original domain services
- Create new domain service accordingly
- Associate the new IDL and domain services with the existing OTN service instance.
URL : http://sdnc-oam.onap:8282/restconf/operations/SLI-API:execute-graph METHOD : POST Request Body: { "input":{ "module-name":"optical-service", "rpc-name":"mdons-closed-loop", "mode":"sync", "sli-parameter":[ { "parameter-name":"service-name", "parameter-value":"inter" }, { "parameter-name":"access-service-id", "parameter-value":"456" } ] } }
Code change needs to be introduced to support this API at SDNC as well as new DG(s) to be defined for the action logic.
CLAMP
CL Template
The template is defined at SDC in design time by user.
CL Instance
Ideally, DCAE micro-services are deployed and can be configured at Close Loop instance instantiation at runtime while Apex policy defined above being created and deployed as well.
References
- CLAMP Description in Frankfurt
- DCAE MOD User Guide
- CCVPN Closed Loop
- BBS Closed Loop for PNF Re-registration and CPE Authentication Notification
- BBS Test Documentation (as reference on how to instantiate and configure DCAE micro-service at runtime)
- DCAE Service Component Deployment Instruction
- DCAE Documents
- DCAE Components
- VES Mapper in R6
- Holmes
- Policy Framework
- Policy Overview in ONAP R6
- ONAP in Frankfurt Release
- MDONS Extension in R7
- No labels