aboutsummaryrefslogtreecommitdiffstats
path: root/models-examples
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-03-19 16:29:56 +0000
committerliamfallon <liam.fallon@est.tech>2019-03-19 16:29:56 +0000
commit9727c320342dfaffeb13c4b5894fb4a9047943d7 (patch)
treef329ab3d2de63de83945239370bfab55accbb3a6 /models-examples
parent998fb98e470205171ba9dc37674ea9d1c31e54ed (diff)
Move examples into separate module
Issue-ID: POLICY-1195 Change-Id: Id2dc5b5b490134648ca267e27b795f3f4c03bc7b Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-examples')
-rw-r--r--models-examples/pom.xml34
-rw-r--r--models-examples/src/main/resources/policies/README.txt25
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json50
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.yaml36
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.monitoring.output.tosca.yaml37
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.operational.input.json4
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.operational.input.tosca.yaml33
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.operational.output.json5
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.json46
-rw-r--r--models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.yaml34
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.input.json14
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.output.json23
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.input.json14
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.output.json10
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.json48
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.yaml36
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.monitoring.output.tosca.yaml37
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.input.json4
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.yaml35
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.output.json5
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.json49
-rw-r--r--models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.yaml36
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.json45
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.yaml36
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.monitoring.output.tosca.yaml37
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.input.json4
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json46
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.yaml35
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.output.json5
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.operational.output.tosca.yaml36
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml17
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml158
32 files changed, 1034 insertions, 0 deletions
diff --git a/models-examples/pom.xml b/models-examples/pom.xml
new file mode 100644
index 000000000..6eb8dabc1
--- /dev/null
+++ b/models-examples/pom.xml
@@ -0,0 +1,34 @@
+<!--
+ ============LICENSE_START=======================================================
+ Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ SPDX-License-Identifier: Apache-2.0
+ ============LICENSE_END=========================================================
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>policy-models-examples</artifactId>
+
+ <name>${project.artifactId}</name>
+ <description>Various examples of policy type and policy models in various formats</description>
+</project>
diff --git a/models-examples/src/main/resources/policies/README.txt b/models-examples/src/main/resources/policies/README.txt
new file mode 100644
index 000000000..942913d5c
--- /dev/null
+++ b/models-examples/src/main/resources/policies/README.txt
@@ -0,0 +1,25 @@
+The "input" prefix indicates that this is what the payload looks like on the POST. While the "output" prefix
+indicates that this is what the payload looks like when the response goes back to the caller.
+
+For each of the use cases, there is at least one configuration policy for DCAE Microservice.
+
+*.monitoring.input.[json|yaml] <-- POST request
+
+*.monitoring.output.[json|yaml] --> POST response
+
+The Operational Policies:
+
+*.operational.input.yaml --> Can Pam change this to JSON??
+
+*.operational.output.json --> POST response
+
+The Guard Policies:
+
+*.guard.[frequency|minmax].json <-- POST request
+
+*.guard.[frequency|minmax].json --> POST response
+
+For DBAO, the following are internal TOSCA Representations for the Operational and Guard policies, with the
+contents of the yaml or JSON URL Encoded:
+
+*.output.tosca.yaml
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json
new file mode 100644
index 000000000..0eabb573a
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.json
@@ -0,0 +1,50 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "topology_template": {
+ "policies": [
+ {
+ "onap.restart.tca": {
+ "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "onap.restart.tca"
+ },
+ "properties": {
+ "tca_policy" : {
+ "domain": "measurementsForVfScaling",
+ "metricsPerEventName": [
+ {
+ "eventName": "Measurement_vGMUX",
+ "controlLoopSchemaType": "VNF",
+ "policyScope": "DCAE",
+ "policyName": "DCAE.Config_tca-hi-lo",
+ "policyVersion": "v0.0.1",
+ "thresholds": [
+ {
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
+ "thresholdValue": 0,
+ "direction": "EQUAL",
+ "severity": "MAJOR",
+ "closedLoopEventStatus": "ABATED"
+ },
+ {
+ "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
+ "thresholdValue": 0,
+ "direction": "GREATER",
+ "severity": "CRITICAL",
+ "closedLoopEventStatus": "ONSET"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.yaml b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.yaml
new file mode 100644
index 000000000..00afec393
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.input.tosca.yaml
@@ -0,0 +1,36 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.restart.tca:
+ type: onap.policies.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.restart.tca
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: Measurement_vGMUX
+ controlLoopSchemaType: VNF
+ policyScope: DCAE
+ policyName: "DCAE.Config_tca-hi-lo"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ thresholdValue: 0
+ direction: EQUAL
+ severity: MAJOR
+ closedLoopEventStatus: ABATED
+ -
+ closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ thresholdValue: 0
+ direction: GREATER
+ severity: CRITICAL
+ closedLoopEventStatus: ONSET \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.monitoring.output.tosca.yaml b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.output.tosca.yaml
new file mode 100644
index 000000000..a8a1cdac1
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.monitoring.output.tosca.yaml
@@ -0,0 +1,37 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.restart.tca:
+ type: onap.policies.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.restart.tca
+ policy-version: 1
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: Measurement_vGMUX
+ controlLoopSchemaType: VNF
+ policyScope: DCAE
+ policyName: "DCAE.Config_tca-hi-lo"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ thresholdValue: 0
+ direction: EQUAL
+ severity: MAJOR
+ closedLoopEventStatus: ABATED
+ -
+ closedLoopControlName: "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e"
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value"
+ thresholdValue: 0
+ direction: GREATER
+ severity: CRITICAL
+ closedLoopEventStatus: ONSET \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.operational.input.json b/models-examples/src/main/resources/policies/vCPE.policy.operational.input.json
new file mode 100644
index 000000000..393cb0282
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.operational.input.json
@@ -0,0 +1,4 @@
+{
+ "policy-id" : "operational.restart",
+ "content" : "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0A%20%20trigger_policy%3A%20unique-policy-id-1-restart%0A%20%20timeout%3A%203600%0A%20%20abatement%3A%20true%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-restart%0A%20%20%20%20name%3A%20Restart%20the%20VM%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20APPC%0A%20%20%20%20recipe%3A%20Restart%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VM%0A%20%20%20%20retry%3A%203%0A%20%20%20%20timeout%3A%201200%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.operational.input.tosca.yaml b/models-examples/src/main/resources/policies/vCPE.policy.operational.input.tosca.yaml
new file mode 100644
index 000000000..dda0169f1
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.operational.input.tosca.yaml
@@ -0,0 +1,33 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.restart:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.restart
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
+ trigger_policy: unique-policy-id-1-restart
+ timeout: 3600
+ abatement: true
+
+ policies:
+ - id: unique-policy-id-1-restart
+ name: Restart the VM
+ description:
+ actor: APPC
+ recipe: Restart
+ target:
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.operational.output.json b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.json
new file mode 100644
index 000000000..7d26e8e67
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.json
@@ -0,0 +1,5 @@
+{
+ "policy-id" : "operational.restart",
+ "policy-version" : "1",
+ "content" : "controlLoop%3A%0A%20%20version%3A%202.0.0%0A%20%20controlLoopName%3A%20ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e%0A%20%20trigger_policy%3A%20unique-policy-id-1-restart%0A%20%20timeout%3A%203600%0A%20%20abatement%3A%20true%0A%20%0Apolicies%3A%0A%20%20-%20id%3A%20unique-policy-id-1-restart%0A%20%20%20%20name%3A%20Restart%20the%20VM%0A%20%20%20%20description%3A%0A%20%20%20%20actor%3A%20APPC%0A%20%20%20%20recipe%3A%20Restart%0A%20%20%20%20target%3A%0A%20%20%20%20%20%20type%3A%20VM%0A%20%20%20%20retry%3A%203%0A%20%20%20%20timeout%3A%201200%0A%20%20%20%20success%3A%20final_success%0A%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.json b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.json
new file mode 100644
index 000000000..d73853735
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.json
@@ -0,0 +1,46 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "topology_template": {
+ "policies": [
+ {
+ "operational.restart": {
+ "type": "onap.policies.controlloop.Operational",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "operational.restart",
+ "policy-version": 1
+ },
+ "properties": {
+ "controlLoop": {
+ "version": "2.0.0",
+ "controlLoopName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
+ "trigger_policy": "unique-policy-id-1-restart",
+ "timeout": 3600,
+ "abatement": true
+ },
+ "policies": [
+ {
+ "id": "unique-policy-id-1-restart",
+ "name": "Restart the VM",
+ "description": null,
+ "actor": "APPC",
+ "recipe": "Restart",
+ "target": {
+ "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"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.yaml b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.yaml
new file mode 100644
index 000000000..e4a06947f
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vCPE.policy.operational.output.tosca.yaml
@@ -0,0 +1,34 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.restart:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.restart
+ policy-version: 1
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
+ trigger_policy: unique-policy-id-1-restart
+ timeout: 3600
+ abatement: true
+
+ policies:
+ - id: unique-policy-id-1-restart
+ name: Restart the VM
+ description:
+ actor: APPC
+ recipe: Restart
+ target:
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.input.json b/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.input.json
new file mode 100644
index 000000000..442f3ec40
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.input.json
@@ -0,0 +1,14 @@
+{
+ "policy-id" : "guard.frequency.scaleout",
+ "content" : {
+ "actor": "SO",
+ "recipe": "scaleOut",
+ "targets": ".*",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "limit": "1",
+ "timeWindow": "10",
+ "timeUnits": "minute",
+ "guardActiveStart": "00:00:01-05:00",
+ "guardActiveEnd": "23:59:59-05:00"
+ }
+}
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.output.json b/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.output.json
new file mode 100644
index 000000000..48c92c3ba
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.guard.frequency.output.json
@@ -0,0 +1,23 @@
+{
+ "guard.frequency.scaleout": {
+ "type": "onap.policies.controlloop.guard.FrequencyLimiter",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "guard.frequency.scaleout",
+ "policy-version": 1
+ },
+ "properties": {
+ "content": {
+ "actor": "SO",
+ "recipe": "scaleOut",
+ "targets": ".*",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "limit": "1",
+ "timeWindow": "10",
+ "timeUnits": "minute",
+ "guardActiveStart": "00:00:01-05:00",
+ "guardActiveEnd": "23:59:59-05:00"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.input.json b/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.input.json
new file mode 100644
index 000000000..c62a229a6
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.input.json
@@ -0,0 +1,14 @@
+{
+{
+ "policy-id" : "guard.minmax.scaleout",
+ "contents" : {
+ "actor": "SO",
+ "recipe": "scaleOut",
+ "targets": ".*",
+ "clname": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "min": "1",
+ "max": "5",
+ "guardActiveStart": "00:00:01-05:00",
+ "guardActiveEnd": "23:59:59-05:00"
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.output.json b/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.output.json
new file mode 100644
index 000000000..83d2f272f
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.guard.minmax.output.json
@@ -0,0 +1,10 @@
+{
+ "guard.minmax.scaleout": {
+ "type": "onap.policies.controlloop.guard.MinMax",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "guard.minmax.scaleout",
+ "policy-version": 1
+ }
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.json b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.json
new file mode 100644
index 000000000..2188cb2e8
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.json
@@ -0,0 +1,48 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "policies": [
+ {
+ "onap.scaleout.tca": {
+ "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "onap.scaleout.tca"
+ },
+ "properties": {
+ "tca_policy": {
+ "domain": "measurementsForVfScaling",
+ "metricsPerEventName": [
+ {
+ "eventName": "vLoadBalancer",
+ "controlLoopSchemaType": "VNF",
+ "policyScope": "type=configuration",
+ "policyName": "onap.scaleout.tca",
+ "policyVersion": "v0.0.1",
+ "thresholds": [
+ {
+ "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "closedLoopEventStatus": "ONSET",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "thresholdValue": 500,
+ "direction": "LESS_OR_EQUAL",
+ "severity": "MAJOR"
+ },
+ {
+ "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "closedLoopEventStatus": "ONSET",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "thresholdValue": 5000,
+ "direction": "GREATER_OR_EQUAL",
+ "severity": "CRITICAL"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.yaml b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.yaml
new file mode 100644
index 000000000..6735c39c2
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.input.tosca.yaml
@@ -0,0 +1,36 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.scaleout.tca:
+ type: onap.policies.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.scaleout.tca
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: vLoadBalancer
+ controlLoopSchemaType: VNF
+ policyScope: "type=configuration"
+ policyName: "onap.scaleout.tca"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 500
+ direction: LESS_OR_EQUAL
+ severity: MAJOR
+ -
+ closedLoopControlName: "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 5000
+ direction: GREATER_OR_EQUAL
+ severity: CRITICAL
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.monitoring.output.tosca.yaml b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.output.tosca.yaml
new file mode 100644
index 000000000..669e8946c
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.monitoring.output.tosca.yaml
@@ -0,0 +1,37 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.scaleout.tca:
+ type: onap.policies.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.scaleout.tca
+ policy-version: 1
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: vLoadBalancer
+ controlLoopSchemaType: VNF
+ policyScope: "type=configuration"
+ policyName: "onap.scaleout.tca"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 500
+ direction: LESS_OR_EQUAL
+ severity: MAJOR
+ -
+ closedLoopControlName: "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 5000
+ direction: GREATER_OR_EQUAL
+ severity: CRITICAL
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.input.json b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.json
new file mode 100644
index 000000000..dabde0114
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.json
@@ -0,0 +1,4 @@
+{
+ "policy-id" : "operational.scaleout",
+ "content" : "controlLoop%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20version%3A%202.0.0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20%20%20%20%20%20%20%20%20%20%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20abatement%3A%20false%0A%20%20%20%20%20%20%20%20%20%20%20policies%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20actor%3A%20SO%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20target%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20VNF%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20payload%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20requestParameters%3A%20'%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20configurationParameters%3A%20'%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20retry%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20success%3A%20final_success%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.yaml b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.yaml
new file mode 100644
index 000000000..0f5498804
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.yaml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.scaleout:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.scaleout
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
+ trigger_policy: unique-policy-id-1-scale-up
+ timeout: 1200
+ abatement: false
+ policies:
+ - id: unique-policy-id-1-scale-up
+ name: Create a new VF Module
+ description:
+ actor: SO
+ recipe: VF Module Create
+ target:
+ type: VNF
+ payload:
+ requestParameters: '{"usePreload":true,"userParams":[]}'
+ configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
+ retry: 0
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.output.json b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.json
new file mode 100644
index 000000000..5ce44e0ba
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.json
@@ -0,0 +1,5 @@
+{
+ "policy-id" : "operational.scaleout",
+ "policy-version" : "1",
+ "content" : "controlLoop%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20version%3A%202.0.0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20controlLoopName%3A%20ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3%0A%20%20%20%20%20%20%20%20%20%20%20%20%20trigger_policy%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20abatement%3A%20false%0A%20%20%20%20%20%20%20%20%20%20%20policies%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20-%20id%3A%20unique-policy-id-1-scale-up%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name%3A%20Create%20a%20new%20VF%20Module%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20actor%3A%20SO%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20recipe%3A%20VF%20Module%20Create%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20target%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20VNF%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20payload%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20requestParameters%3A%20'%7B%22usePreload%22%3Atrue%2C%22userParams%22%3A%5B%5D%7D'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20configurationParameters%3A%20'%5B%7B%22ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B9%5D%22%2C%22oam-ip-addr%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B16%5D%22%2C%22enabled%22%3A%22%24.vf-module-topology.vf-module-parameters.param%5B23%5D%22%7D%5D'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20retry%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20success%3A%20final_success%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.json b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.json
new file mode 100644
index 000000000..2478ff07a
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.json
@@ -0,0 +1,49 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "topology_template": {
+ "policies": [
+ {
+ "operational.scaleout": {
+ "type": "onap.policies.controlloop.Operational",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "operational.scaleout",
+ "policy-version": 1
+ },
+ "properties": null,
+ "controlLoop": {
+ "version": "2.0.0",
+ "controlLoopName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
+ "trigger_policy": "unique-policy-id-1-scale-up",
+ "timeout": 1200,
+ "abatement": false
+ },
+ "policies": [
+ {
+ "id": "unique-policy-id-1-scale-up",
+ "name": "Create a new VF Module",
+ "description": null,
+ "actor": "SO",
+ "recipe": "VF Module Create",
+ "target": {
+ "type": "VNF"
+ },
+ "payload": {
+ "requestParameters": "{\"usePreload\":true,\"userParams\":[]}",
+ "configurationParameters": "[{\"ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[9]\",\"oam-ip-addr\":\"$.vf-module-topology.vf-module-parameters.param[16]\",\"enabled\":\"$.vf-module-topology.vf-module-parameters.param[23]\"}]"
+ },
+ "retry": 0,
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.yaml b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.yaml
new file mode 100644
index 000000000..a09a235a4
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vDNS.policy.operational.output.tosca.yaml
@@ -0,0 +1,36 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.scaleout:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.scaleout
+ policy-version: 1
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
+ trigger_policy: unique-policy-id-1-scale-up
+ timeout: 1200
+ abatement: false
+ policies:
+ - id: unique-policy-id-1-scale-up
+ name: Create a new VF Module
+ description:
+ actor: SO
+ recipe: VF Module Create
+ target:
+ type: VNF
+ payload:
+ requestParameters: '{"usePreload":true,"userParams":[]}'
+ configurationParameters: '[{"ip-addr":"$.vf-module-topology.vf-module-parameters.param[9]","oam-ip-addr":"$.vf-module-topology.vf-module-parameters.param[16]","enabled":"$.vf-module-topology.vf-module-parameters.param[23]"}]'
+ retry: 0
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.json b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.json
new file mode 100644
index 000000000..93545a0dd
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.json
@@ -0,0 +1,45 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "policies": [
+ {
+ "onap.vfirewall.tca": {
+ "type": "onap.policy.monitoring.cdap.tca.hi.lo.app",
+ "version": "1.0.0",
+ "properties": {
+ "tca_policy": {
+ "domain": "measurementsForVfScaling",
+ "metricsPerEventName": [
+ {
+ "eventName": "vLoadBalancer",
+ "controlLoopSchemaType": "VNF",
+ "policyScope": "resource=vLoadBalancer;type=configuration",
+ "policyName": "onap.vfirewall.tca",
+ "policyVersion": "v0.0.1",
+ "thresholds": [
+ {
+ "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
+ "closedLoopEventStatus": "ONSET",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "thresholdValue": 500,
+ "direction": "LESS_OR_EQUAL",
+ "severity": "MAJOR"
+ },
+ {
+ "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
+ "closedLoopEventStatus": "ONSET",
+ "version": "1.0.2",
+ "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated",
+ "thresholdValue": 5000,
+ "direction": "GREATER_OR_EQUAL",
+ "severity": "CRITICAL"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.yaml b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.yaml
new file mode 100644
index 000000000..bce8b366f
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.yaml
@@ -0,0 +1,36 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.vfirewall.tca:
+ type: onap.policy.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.vfirewall.tca
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: vLoadBalancer
+ controlLoopSchemaType: VNF
+ policyScope: "resource=vLoadBalancer;type=configuration"
+ policyName: "onap.vfirewall.tca"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 500
+ direction: LESS_OR_EQUAL
+ severity: MAJOR
+ -
+ closedLoopControlName: "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 5000
+ direction: GREATER_OR_EQUAL
+ severity: CRITICAL \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.output.tosca.yaml b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.output.tosca.yaml
new file mode 100644
index 000000000..eb3165f6e
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.monitoring.output.tosca.yaml
@@ -0,0 +1,37 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ onap.vfirewall.tca:
+ type: onap.policy.monitoring.cdap.tca.hi.lo.app
+ version: 1.0.0
+ metadata:
+ policy-id: onap.vfirewall.tca
+ policy-version: 1
+ properties:
+ tca_policy:
+ domain: measurementsForVfScaling
+ metricsPerEventName:
+ -
+ eventName: vLoadBalancer
+ controlLoopSchemaType: VNF
+ policyScope: "resource=vLoadBalancer;type=configuration"
+ policyName: "onap.vfirewall.tca"
+ policyVersion: "v0.0.1"
+ thresholds:
+ -
+ closedLoopControlName: "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 500
+ direction: LESS_OR_EQUAL
+ severity: MAJOR
+ -
+ closedLoopControlName: "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a"
+ closedLoopEventStatus: ONSET
+ version: "1.0.2"
+ fieldPath: "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated"
+ thresholdValue: 5000
+ direction: GREATER_OR_EQUAL
+ severity: CRITICAL \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.json b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.json
new file mode 100644
index 000000000..623a68992
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.json
@@ -0,0 +1,4 @@
+{
+ "policy-id" : "operational.modifyconfig",
+ "content" : "controlLoop%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20version%3A%202.0.0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20controlLoopName%3A%20ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0A%20%20%20%20%20%20%20%20%20%20%20%20%20trigger_policy%3A%20unique-policy-id-1-modifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20abatement%3A%20false%0A%20%0A%20%20%20%20%20%20%20%20%20%20%20policies%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%20id%3A%20unique-policy-id-1-modifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name%3A%20modify%20packet%20gen%20config%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20actor%3A%20APPC%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20recipe%3A%20ModifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20target%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20TBD%20-%20Cannot%20be%20known%20until%20instantiation%20is%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resourceID%3A%20Eace933104d443b496b8.nodes.heat.vpg%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20VNF%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20retry%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%20300%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20success%3A%20final_success%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json
new file mode 100644
index 000000000..63c0d8b85
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.json
@@ -0,0 +1,46 @@
+{
+ "tosca_definitions_version": "tosca_simple_yaml_1_0_0",
+ "topology_template": {
+ "policies": [
+ {
+ "operational.modifyconfig": {
+ "type": "onap.policies.controlloop.Operational",
+ "version": "1.0.0",
+ "metadata": {
+ "policy-id": "operational.modifyconfig"
+ },
+ "properties": {
+ "controlLoop": {
+ "version": "2.0.0",
+ "controlLoopName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
+ "trigger_policy": "unique-policy-id-1-modifyConfig",
+ "timeout": 1200,
+ "abatement": false
+ },
+ "policies": [
+ {
+ "id": "unique-policy-id-1-modifyConfig",
+ "name": "modify packet gen config",
+ "description": null,
+ "actor": "APPC",
+ "recipe": "ModifyConfig",
+ "target": {
+ "resourceID": "Eace933104d443b496b8.nodes.heat.vpg",
+ "type": "VNF"
+ },
+ "retry": 0,
+ "timeout": 300,
+ "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"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.yaml b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.yaml
new file mode 100644
index 000000000..ca36d5309
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.input.tosca.yaml
@@ -0,0 +1,35 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.modifyconfig:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.modifyconfig
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
+ trigger_policy: unique-policy-id-1-modifyConfig
+ timeout: 1200
+ abatement: false
+
+ policies:
+ - id: unique-policy-id-1-modifyConfig
+ name: modify packet gen config
+ description:
+ actor: APPC
+ recipe: ModifyConfig
+ target:
+ # TBD - Cannot be known until instantiation is done
+ resourceID: Eace933104d443b496b8.nodes.heat.vpg
+ type: VNF
+ retry: 0
+ timeout: 300
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.json b/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.json
new file mode 100644
index 000000000..bb8b907f8
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.json
@@ -0,0 +1,5 @@
+{
+ "policy-id" : "operational.modifyconfig",
+ "policy-version" : "1",
+ "content" : "controlLoop%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20version%3A%202.0.0%0A%20%20%20%20%20%20%20%20%20%20%20%20%20controlLoopName%3A%20ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a%0A%20%20%20%20%20%20%20%20%20%20%20%20%20trigger_policy%3A%20unique-policy-id-1-modifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%201200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20abatement%3A%20false%0A%20%0A%20%20%20%20%20%20%20%20%20%20%20policies%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20-%20id%3A%20unique-policy-id-1-modifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20name%3A%20modify%20packet%20gen%20config%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20description%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20actor%3A%20APPC%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20recipe%3A%20ModifyConfig%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20target%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20TBD%20-%20Cannot%20be%20known%20until%20instantiation%20is%20done%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20resourceID%3A%20Eace933104d443b496b8.nodes.heat.vpg%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20VNF%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20retry%3A%200%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20timeout%3A%20300%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20success%3A%20final_success%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure%3A%20final_failure%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_timeout%3A%20final_failure_timeout%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_retries%3A%20final_failure_retries%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_exception%3A%20final_failure_exception%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20failure_guard%3A%20final_failure_guard"
+} \ No newline at end of file
diff --git a/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.tosca.yaml b/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.tosca.yaml
new file mode 100644
index 000000000..42ea511d9
--- /dev/null
+++ b/models-examples/src/main/resources/policies/vFirewall.policy.operational.output.tosca.yaml
@@ -0,0 +1,36 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+topology_template:
+ policies:
+ -
+ operational.modifyconfig:
+ type: onap.policies.controlloop.Operational
+ version: 1.0.0
+ metadata:
+ policy-id: operational.modifyconfig
+ policy-version: 1
+ properties:
+ controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
+ trigger_policy: unique-policy-id-1-modifyConfig
+ timeout: 1200
+ abatement: false
+
+ policies:
+ - id: unique-policy-id-1-modifyConfig
+ name: modify packet gen config
+ description:
+ actor: APPC
+ recipe: ModifyConfig
+ target:
+ # TBD - Cannot be known until instantiation is done
+ resourceID: Eace933104d443b496b8.nodes.heat.vpg
+ type: VNF
+ retry: 0
+ timeout: 300
+ 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 \ No newline at end of file
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml b/models-examples/src/main/resources/policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml
new file mode 100644
index 000000000..5a093ddbf
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+ version: 1.0.0
+ onap.policies.Monitoring:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that govern monitoring provision
+ version: 1.0.0
+ onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server:
+ derived_from: policy.nodes.Root
+ version: 1.0.0
+ properties:
+ buscontroller_feed_publishing_endpoint:
+ type: string
+ description: DMAAP Bus Controller feed endpoint
+ datafile.policy:
+ type: string
+ description: datafile Policy JSON as string
diff --git a/models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml b/models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml
new file mode 100644
index 000000000..699cffd7e
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml
@@ -0,0 +1,158 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+ onap.policies.Monitoring:
+ derived_from: tosca.policies.Root
+ description: a base policy type for all policies that governs monitoring provisioning
+ onap.policy.monitoring.cdap.tca.hi.lo.app:
+ derived_from: onap.policies.Monitoring
+ version: 1.0.0
+ properties:
+ tca_policy:
+ type: map
+ description: TCA Policy JSON
+ entry_schema:
+ type: onap.datatypes.monitoring.tca_policy
+data_types:
+ onap.datatypes.monitoring.metricsPerEventName:
+ derived_from: tosca.datatypes.Root
+ properties:
+ controlLoopSchemaType:
+ type: string
+ required: true
+ description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM
+ constraints:
+ - valid_values:
+ - VM
+ - VNF
+ eventName:
+ type: string
+ required: true
+ description: Event name to which thresholds need to be applied
+ policyName:
+ type: string
+ required: true
+ description: TCA Policy Scope Name
+ policyScope:
+ type: string
+ required: true
+ description: TCA Policy Scope
+ policyVersion:
+ type: string
+ required: true
+ description: TCA Policy Scope Version
+ thresholds:
+ type: list
+ required: true
+ description: Thresholds associated with eventName
+ entry_schema:
+ type: onap.datatypes.monitoring.thresholds
+ onap.datatypes.monitoring.tca_policy:
+ derived_from: tosca.datatypes.Root
+ properties:
+ domain:
+ type: string
+ required: true
+ description: Domain name to which TCA needs to be applied
+ default: measurementsForVfScaling
+ constraints:
+ - equal: measurementsForVfScaling
+ metricsPerEventName:
+ type: list
+ required: true
+ description: Contains eventName and threshold details that need to be applied to given eventName
+ entry_schema:
+ type: onap.datatypes.monitoring.metricsPerEventName
+ onap.datatypes.monitoring.thresholds:
+ derived_from: tosca.datatypes.Root
+ properties:
+ closedLoopControlName:
+ type: string
+ required: true
+ description: Closed Loop Control Name associated with the threshold
+ closedLoopEventStatus:
+ type: string
+ required: true
+ description: Closed Loop Event Status of the threshold
+ constraints:
+ - valid_values:
+ - ONSET
+ - ABATED
+ direction:
+ type: string
+ required: true
+ description: Direction of the threshold
+ constraints:
+ - valid_values:
+ - LESS
+ - LESS_OR_EQUAL
+ - GREATER
+ - GREATER_OR_EQUAL
+ - EQUAL
+ fieldPath:
+ type: string
+ required: true
+ description: Json field Path as per CEF message which needs to be analyzed for TCA
+ constraints:
+ - valid_values:
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait
+ - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage
+ - $.event.measurementsForVfScalingFields.meanRequestLatency
+ - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered
+ - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached
+ - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured
+ - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree
+ - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed
+ - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value
+ severity:
+ type: string
+ required: true
+ description: Threshold Event Severity
+ constraints:
+ - valid_values:
+ - CRITICAL
+ - MAJOR
+ - MINOR
+ - WARNING
+ - NORMAL
+ thresholdValue:
+ type: integer
+ required: true
+ description: Threshold value for the field Path inside CEF message
+ version:
+ type: string
+ required: true
+ description: Version number associated with the threshold