summaryrefslogtreecommitdiffstats
path: root/models-examples/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-05-07 12:42:26 +0000
committerliamfallon <liam.fallon@est.tech>2019-05-07 12:42:26 +0000
commitf53879588a464c727ece62f87c7625b47e6de7f1 (patch)
tree980cddab937c38610587b50cc45a9c36540a2470 /models-examples/src/main
parente936413c9082afed0fef4646b8f12d351c87800c (diff)
Set default and check existance of Policy Type
The TOSCA specification has a "bug" in that it does not have a field to specify the version of a policy type to use. We already had introduced the "type_version" field for this. This review introduces setting of the default version of a policy type to be be used by a policy as the latest version of the policy type in the database. As a side effect of this, we now have to check for existence of the policy type of a policy in the database. This means that creation/update of a policy with a non-existant policy type specified will now fail. Issue-ID: POLICY-1738 Change-Id: I27080cf6cd358948810dab6897c72dfe4d41fe91 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-examples/src/main')
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.json2
-rw-r--r--models-examples/src/main/resources/policies/vFirewall.policy.monitoring.input.tosca.yaml2
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.controlloop.Operational.yaml6
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.Blacklist.yaml40
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml50
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.MinMax.yaml44
-rw-r--r--models-examples/src/main/resources/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml (renamed from models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml)2
7 files changed, 143 insertions, 3 deletions
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
index aef04c99c..cdc40eb5b 100644
--- 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
@@ -7,7 +7,7 @@
{
"onap.vfirewall.tca":
{
- "type": "onap.policy.monitoring.cdap.tca.hi.lo.app",
+ "type": "onap.policies.monitoring.cdap.tca.hi.lo.app",
"version": "1.0.0",
"metadata":
{
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
index bce8b366f..6ac547058 100644
--- 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
@@ -3,7 +3,7 @@ topology_template:
policies:
-
onap.vfirewall.tca:
- type: onap.policy.monitoring.cdap.tca.hi.lo.app
+ type: onap.policies.monitoring.cdap.tca.hi.lo.app
version: 1.0.0
metadata:
policy-id: onap.vfirewall.tca
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.controlloop.Operational.yaml b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.Operational.yaml
new file mode 100644
index 000000000..e18c16a6d
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.Operational.yaml
@@ -0,0 +1,6 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+ - onap.policies.controlloop.Operational:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ description: Operational Policy for Control Loops \ No newline at end of file
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.Blacklist.yaml b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.Blacklist.yaml
new file mode 100644
index 000000000..e09861428
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.Blacklist.yaml
@@ -0,0 +1,40 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+ - onap.policies.controlloop.Guard:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ description: Guard Policies for Control Loop Operational Policies
+ - onap.policies.controlloop.guard.Blacklist:
+ derived_from: onap.policies.controlloop.Guard
+ version: 1.0.0
+ description: Supports blacklist of VNF's from performing control loop actions on.
+ properties:
+ blacklist_policy:
+ type: map
+ description:
+ entry_schema:
+ type: onap.datatypes.guard.Blacklist
+data_types:
+ - onap.datatypes.guard.Blacklist:
+ derived_from: tosca.datatypes.Root
+ properties:
+ actor:
+ type: string
+ description: Specifies the Actor
+ required: true
+ recipe:
+ type: string
+ description: Specified the Recipe
+ required: true
+ time_range:
+ type: tosca.datatypes.TimeInterval
+ description: An optional range of time during the day the blacklist is valid for.
+ required: false
+ controlLoopName:
+ type: string
+ description: An optional specific control loop to apply this guard to.
+ required: false
+ blacklist:
+ type: list
+ description: List of VNF's
+ required: true \ No newline at end of file
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml
new file mode 100644
index 000000000..2a7b6247f
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.FrequencyLimiter.yaml
@@ -0,0 +1,50 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+ - onap.policies.controlloop.Guard:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ description: Guard Policies for Control Loop Operational Policies
+ - onap.policies.controlloop.guard.FrequencyLimiter:
+ derived_from: onap.policies.controlloop.Guard
+ version: 1.0.0
+ description: Supports limiting the frequency of actions being taken by a Actor.
+ properties:
+ frequency_policy:
+ type: map
+ description:
+ entry_schema:
+ type: onap.datatypes.guard.FrequencyLimiter
+data_types:
+ - onap.datatypes.guard.FrequencyLimiter:
+ derived_from: tosca.datatypes.Root
+ properties:
+ actor:
+ type: string
+ description: Specifies the Actor
+ required: true
+ recipe:
+ type: string
+ description: Specified the Recipe
+ required: true
+ time_window:
+ type: scalar-unit.time
+ description: The time window to count the actions against.
+ required: true
+ limit:
+ type: integer
+ description: The limit
+ required: true
+ constraints:
+ - greater_than: 0
+ time_range:
+ type: tosca.datatypes.TimeInterval
+ description: An optional range of time during the day the frequency is valid for.
+ required: false
+ controlLoopName:
+ type: string
+ description: An optional specific control loop to apply this guard to.
+ required: false
+ target:
+ type: string
+ description: An optional specific VNF to apply this guard to.
+ required: false \ No newline at end of file
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.MinMax.yaml b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.MinMax.yaml
new file mode 100644
index 000000000..0a1aa9b72
--- /dev/null
+++ b/models-examples/src/main/resources/policytypes/onap.policies.controlloop.guard.MinMax.yaml
@@ -0,0 +1,44 @@
+policy_types:
+ - onap.policies.controlloop.Guard:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ description: Guard Policies for Control Loop Operational Policies
+ - onap.policies.controlloop.guard.MinMax:
+ derived_from: onap.policies.controlloop.Guard
+ version: 1.0.0
+ description: Supports Min/Max number of VF Modules
+ properties:
+ minmax_policy:
+ type: map
+ description:
+ entry_schema:
+ type: onap.datatypes.guard.MinMax
+data_types:
+ - onap.datatypes.guard.MinMax:
+ derived_from: tosca.datatypes.Root
+ properties:
+ actor:
+ type: string
+ description: Specifies the Actor
+ required: true
+ recipe:
+ type: string
+ description: Specified the Recipe
+ required: true
+ time_range:
+ type: tosca.datatypes.TimeInterval
+ description: An optional range of time during the day the Min/Max limit is valid for.
+ required: false
+ controlLoopName:
+ type: string
+ description: An optional specific control loop to apply this guard to.
+ required: false
+ min_vf_module_instances:
+ type: integer
+ required: true
+ description: The minimum instances of this VF-Module
+
+ max_vf_module_instances:
+ type: integer
+ required: false
+ description: The maximum instances of this VF-Module \ No newline at end of file
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.policies.monitoring.cdap.tca.hi.lo.app.yaml
index f8e9b7521..2985603af 100644
--- a/models-examples/src/main/resources/policytypes/onap.policy.monitoring.cdap.tca.hi.lo.app.yaml
+++ b/models-examples/src/main/resources/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml
@@ -5,7 +5,7 @@ policy_types:
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:
+ onap.policies.monitoring.cdap.tca.hi.lo.app:
derived_from: onap.policies.Monitoring
version: 1.0.0
properties: