blob: 49c9a916c032740961b783de49d70b4d1ad86ce3 [file] [log] [blame]
Vijayc41a39d2017-10-27 20:14:28 +00001tosca_definitions_version: cloudify_dsl_1_3
2imports:
3- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dockerplugin/2/dockerplugin_types.yaml"
4- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/dcaepolicyplugin/1/dcaepolicyplugin_types.yaml"
5- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/type_files/relationshipplugin/1/relationshipplugin_types.yaml"
Vijay573499f2017-11-01 21:26:46 +00006- "{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/pgaas/pgaas_types.yaml"
Vijayc41a39d2017-10-27 20:14:28 +00007inputs:
Vijayc41a39d2017-10-27 20:14:28 +00008 docker_host_override:
9 type: string
10 default: "component_dockerhost"
11 dh_location_id:
12 type: string
13 default: "zone1"
14 msb_hostname:
15 type: string
16 default: ""
Vijay573499f2017-11-01 21:26:46 +000017 location_domain:
18 type: string
19 location_prefix:
20 type: string
21 pgaas_cluster_name:
22 type: string
23 # use the single-VM PG instance
24 default: pgvm
25 database_name:
26 type: string
27 default: holmes
Vijayc41a39d2017-10-27 20:14:28 +000028node_templates:
Vijay573499f2017-11-01 21:26:46 +000029 pgaasvm:
30 type: dcae.nodes.pgaas.database
31 properties:
32 writerfqdn: { concat: [ { get_input: location_prefix }, '-', { get_input: pgaas_cluster_name }, '-write.', { get_input: location_domain } ] }
33 name: { get_input: database_name }
Vijayc41a39d2017-10-27 20:14:28 +000034 docker_holmes_host:
35 type: dcae.nodes.SelectedDockerHost
36 properties:
37 docker_host_override:
38 get_input: docker_host_override
39 location_id:
40 get_input: dh_location_id
41 holmesrules:
42 type: dcae.nodes.DockerContainerForComponentsUsingDmaap
Vijay573499f2017-11-01 21:26:46 +000043 interfaces:
44 cloudify.interfaces.lifecycle:
45 start:
46 inputs:
47 envs:
48 URL_JDBC:
49 { get_attribute: [ pgaasvm, admin, host ] }
50 JDBC_PASSWORD:
51 { get_attribute: [ pgaasvm, admin, password ] }
52 JDBC_USERNAME:
53 { get_attribute: [ pgaasvm, admin, user ] }
54 MSB_ADDR:
55 get_input: msb_hostname
Vijayc41a39d2017-10-27 20:14:28 +000056 properties:
57 application_config:
Guangrong Fu621d6602017-11-09 16:01:38 +080058 holmes.default.rule.volte.scenario1: "ControlLoop-VOLTE-2179b738-fd36-4843-a71a-a8c24c70c55b$$$package org.onap.holmes.droolsRule;\n\nimport org.onap.holmes.common.dmaap.DmaapService;\nimport org.onap.holmes.common.api.stat.VesAlarm;\nimport org.onap.holmes.common.aai.CorrelationUtil;\nimport org.onap.holmes.common.dmaap.entity.PolicyMsg;\nimport org.onap.holmes.common.dropwizard.ioc.utils.ServiceLocatorHolder;\nimport org.onap.holmes.common.utils.DroolsLog;\n \n\nrule \"Relation_analysis_Rule\"\nsalience 200\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0,\n $sourceId: sourceId, sourceId != null && !sourceId.equals(\"\"),\n\t\t\t$sourceName: sourceName, sourceName != null && !sourceName.equals(\"\"),\n\t\t\t$startEpochMicrosec: startEpochMicrosec,\n eventName in (\"Fault_MultiCloud_VMFailure\"),\n $eventId: eventId)\n $child : VesAlarm( eventId != $eventId, parentId == null,\n CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId, $sourceName),\n eventName in (\"Fault_MME_eNodeB out of service alarm\"),\n startEpochMicrosec < $startEpochMicrosec + 60000 && startEpochMicrosec > $startEpochMicrosec - 60000 )\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"Relation_analysis_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\t$child.setParentId($root.getEventId());\n\t\tupdate($child);\n\t\t\nend\n\nrule \"root_has_child_handle_Rule\"\nsalience 150\nno-loop true\n\twhen\n\t\t$root : VesAlarm(alarmIsCleared == 0, rootFlag == 0, $eventId: eventId)\n\t\t$child : VesAlarm(eventId != $eventId, parentId == $eventId)\n\tthen\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_has_child_handle_Rule: rootId=\" + $root.getEventId() + \", childId=\" + $child.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, $child, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_no_child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 0, rootFlag == 0,\n sourceId != null && !sourceId.equals(\"\"),\n\t\t\tsourceName != null && !sourceName.equals(\"\"),\n eventName in (\"Fault_MultiCloud_VMFailure\"))\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_no_child_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\t$root.setRootFlag(1);\n\t\tupdate($root);\nend\n\nrule \"root_cleared_handle_Rule\"\nsalience 100\nno-loop true\n when\n $root : VesAlarm(alarmIsCleared == 1, rootFlag == 1)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"root_cleared_handle_Rule: rootId=\" + $root.getEventId());\n\t\tDmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);\n\t\tPolicyMsg policyMsg = dmaapService.getPolicyMsg($root, null, \"org.onap.holmes.droolsRule\");\n dmaapService.publishPolicyMsg(policyMsg, \"unauthenticated.DCAE_CL_OUTPUT\");\n\t\tretract($root);\nend\n\nrule \"child_handle_Rule\"\nsalience 100\nno-loop true\n when\n $child : VesAlarm(alarmIsCleared == 1, rootFlag == 0)\n then\n\t\tDroolsLog.printInfo(\"===========================================================\");\n\t\tDroolsLog.printInfo(\"child_handle_Rule: childId=\" + $child.getEventId());\n\t\tretract($child);\nend"
Vijayc41a39d2017-10-27 20:14:28 +000059 msb.hostname:
Vijay573499f2017-11-01 21:26:46 +000060 get_input: msb_hostname
Vijayc41a39d2017-10-27 20:14:28 +000061 msb.uri: /api/microservices/v1/services
62 services_calls: {}
63 streams_publishes: {}
Guangrong Fu621d6602017-11-09 16:01:38 +080064 streams_subscribes: {}
Vijayc41a39d2017-10-27 20:14:28 +000065 docker_config:
66 healthcheck:
Vijaydd825cb2017-11-06 00:46:28 +000067 endpoint: /api/holmes-rule-mgmt/v1/healthcheck
Vijayc41a39d2017-10-27 20:14:28 +000068 interval: 15s
69 timeout: 1s
70 type: http
71 ports:
72 - 9101:9101
Lusheng Jid1149a62017-11-15 17:08:02 -050073 image: "{{ ONAPTEMPLATE_DOCKERREGURL_org_onap_dcaegen2_releases }}/onap/holmes/rule-management:v1.0.0"
Vijayc41a39d2017-10-27 20:14:28 +000074 location_id:
75 get_input: dh_location_id
76 service_component_type: dcae-analytics-holmes-rule-management
77 relationships:
Vijay573499f2017-11-01 21:26:46 +000078 - type: cloudify.relationships.depends_on
79 target: pgaasvm
Vijayc41a39d2017-10-27 20:14:28 +000080 - target: docker_holmes_host
Vijay573499f2017-11-01 21:26:46 +000081 type: dcae.relationships.component_contained_in