Refactor optimization policies
[policy/models.git] / models-examples / src / main / resources / policytypes / onap.policies.optimization.resource.DistancePolicy.yaml
diff --git a/models-examples/src/main/resources/policytypes/onap.policies.optimization.resource.DistancePolicy.yaml b/models-examples/src/main/resources/policytypes/onap.policies.optimization.resource.DistancePolicy.yaml
new file mode 100644 (file)
index 0000000..060c4f9
--- /dev/null
@@ -0,0 +1,56 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+policy_types:
+   onap.policies.optimization.resource.DistancePolicy:
+      derived_from: onap.policies.optimization.Resource
+      version: 1.0.0
+      properties:
+         applicableResources:
+            type: list
+            required: true
+            entry_schema:
+               type: string
+               constraints:
+               -  valid_values:
+                  - any
+                  - all
+         distanceProperties:
+            type: policy.data.distanceProperties_properties
+            required: true
+data_types:
+   policy.data.distanceProperties_properties:
+      derived_from: tosca.nodes.Root
+      properties:
+         locationInfo:
+            type: string
+            required: true
+         distance:
+            type: policy.data.distance_properties
+            required: true
+            entry_schema:
+               type: policy.data.distance_properties
+   policy.data.distance_properties:
+      derived_from: tosca.nodes.Root
+      properties:
+         value:
+            type: string
+            required: true
+         operator:
+            type: list
+            required: true
+            entry_schema:
+               type: string
+               constraints:
+               -  valid_values:
+                  - <
+                  - <=
+                  - '>'
+                  - '>='
+                  - =
+         unit:
+            type: list
+            required: true
+            entry_schema:
+               type: string
+               constraints:
+               -  valid_values:
+                  - km
\ No newline at end of file