summaryrefslogtreecommitdiffstats
path: root/controlloop/common/policy-yaml/src
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/policy-yaml/src')
-rw-r--r--controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/Constraint.java78
-rw-r--r--controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/GuardPolicy.java73
-rw-r--r--controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/MatchParameters.java138
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/compiler/ControlLoopGuardCompilerTest.java13
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java31
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java4
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml19
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml14
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml~12
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml24
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml26
11 files changed, 289 insertions, 143 deletions
diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/Constraint.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/Constraint.java
index 54f230876..e13318089 100644
--- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/Constraint.java
+++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/Constraint.java
@@ -27,10 +27,9 @@ import java.util.Map;
public class Constraint {
- public Integer num;
- //public String duration;
- public Map<String, String> duration;
- public Map<String, String> time_in_range;
+ public Integer freq_limit_per_target;
+ public Map<String, String> time_window;
+ public Map<String, String> active_time_range;
public LinkedList<String> blacklist;
@@ -38,9 +37,11 @@ public class Constraint {
}
- public Constraint(Integer num, Map<String, String> duration) {
- this.num = num;
- this.duration = duration;
+ public Constraint(Integer freq_limit_per_target, Map<String, String> time_window) {
+ this.freq_limit_per_target = freq_limit_per_target;
+ if (time_window != null) {
+ this.time_window = Collections.unmodifiableMap(time_window);
+ }
}
public Constraint(List<String> blacklist) {
@@ -48,38 +49,43 @@ public class Constraint {
}
- public Constraint(Integer num, Map<String, String> duration, List<String> blacklist) {
- this.num = num;
- this.duration = Collections.unmodifiableMap(duration);
+ public Constraint(Integer freq_limit_per_target, Map<String, String> time_window, List<String> blacklist) {
+ this.freq_limit_per_target = freq_limit_per_target;
+ this.time_window = Collections.unmodifiableMap(time_window);
this.blacklist = new LinkedList<String>(blacklist);
}
- public Constraint(Integer num, Map<String, String> duration, Map<String, String> time_in_range, List<String> blacklist) {
- //this(num, duration);
- if (duration != null) {
- this.duration = Collections.unmodifiableMap(duration);
- }
- if (time_in_range != null) {
- this.time_in_range = Collections.unmodifiableMap(time_in_range);
+ public Constraint(Integer freq_limit_per_target, Map<String, String> time_window, Map<String, String> active_time_range, List<String> blacklist) {
+ this(freq_limit_per_target, time_window);
+ if (active_time_range != null) {
+ this.active_time_range = Collections.unmodifiableMap(active_time_range);
}
this.blacklist = new LinkedList<String>(blacklist);
}
+ public Constraint(Integer freq_limit_per_target, Map<String, String> time_window, Map<String, String> active_time_range) {
+ this(freq_limit_per_target, time_window);
+ if (active_time_range != null) {
+ this.active_time_range = Collections.unmodifiableMap(active_time_range);
+ }
+ }
+
public Constraint(Constraint constraint) {
- this.num = constraint.num;
- this.duration = constraint.duration;
- if (constraint.time_in_range != null) {
- this.time_in_range = Collections.unmodifiableMap(constraint.time_in_range);
+ this.freq_limit_per_target = constraint.freq_limit_per_target;
+ this.time_window = constraint.time_window;
+ if (constraint.active_time_range != null) {
+ this.active_time_range = Collections.unmodifiableMap(constraint.active_time_range);
}
this.blacklist = new LinkedList<String>(constraint.blacklist);
}
public boolean isValid() {
+ //System.out.println("freq_limit_per_target: " + freq_limit_per_target + " time_window" + time_window );
try {
- if (num == null && duration != null) {
+ if (freq_limit_per_target == null && time_window != null) {
throw new NullPointerException();
}
- if (duration == null && num != null) {
+ if (time_window == null && freq_limit_per_target != null) {
throw new NullPointerException();
}
} catch (Exception e) {
@@ -90,16 +96,16 @@ public class Constraint {
@Override
public String toString() {
- return "Constraint [num=" + num + ", duration=" + duration + ", time_in_range=" + time_in_range + ", blacklist=" + blacklist + "]";
+ return "Constraint [freq_limit_per_target=" + freq_limit_per_target + ", time_window=" + time_window + ", active_time_range=" + active_time_range + ", blacklist=" + blacklist + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((num == null) ? 0 : num.hashCode());
- result = prime * result + ((duration == null) ? 0 : duration.hashCode());
- result = prime * result + ((time_in_range == null) ? 0 : time_in_range.hashCode());
+ result = prime * result + ((freq_limit_per_target == null) ? 0 : freq_limit_per_target.hashCode());
+ result = prime * result + ((time_window == null) ? 0 : time_window.hashCode());
+ result = prime * result + ((active_time_range == null) ? 0 : active_time_range.hashCode());
result = prime * result + ((blacklist == null) ? 0 : blacklist.hashCode());
return result;
}
@@ -113,20 +119,20 @@ public class Constraint {
if (getClass() != obj.getClass())
return false;
Constraint other = (Constraint) obj;
- if (num == null) {
- if (other.num != null)
+ if (freq_limit_per_target == null) {
+ if (other.freq_limit_per_target != null)
return false;
- } else if (!num.equals(other.num))
+ } else if (!freq_limit_per_target.equals(other.freq_limit_per_target))
return false;
- if (duration == null) {
- if (other.duration != null)
+ if (time_window == null) {
+ if (other.time_window != null)
return false;
- } else if (!duration.equals(other.duration))
+ } else if (!time_window.equals(other.time_window))
return false;
- if (time_in_range == null) {
- if (other.time_in_range != null)
+ if (active_time_range == null) {
+ if (other.active_time_range != null)
return false;
- } else if (!time_in_range.equals(other.time_in_range))
+ } else if (!active_time_range.equals(other.active_time_range))
return false;
if (blacklist == null) {
if (other.blacklist != null)
diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/GuardPolicy.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/GuardPolicy.java
index a850b36ed..f0267b3ad 100644
--- a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/GuardPolicy.java
+++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/GuardPolicy.java
@@ -30,11 +30,11 @@ public class GuardPolicy {
public String id = UUID.randomUUID().toString();
public String name;
public String description;
- public String actor;
- public String recipe;
+ public MatchParameters match_parameters;
public LinkedList<Constraint> limit_constraints;
- public GuardPolicy() {
+
+public GuardPolicy() {
}
@@ -42,41 +42,45 @@ public class GuardPolicy {
this.id = id;
}
- public GuardPolicy(String name, String actor, String recipe) {
+ public GuardPolicy(String name, MatchParameters match_parameters) {
this.name = name;
- this.actor = actor;
- this.recipe = recipe;
+ System.out.println("match_parameters: " + match_parameters);
+ this.match_parameters = new MatchParameters(match_parameters);
}
- public GuardPolicy(String id, String name, String description, String actor, String recipe) {
- this(name, actor, recipe);
+ public GuardPolicy(String id, String name, String description, MatchParameters match_parameters) {
+ this(name, match_parameters);
this.id = id;
this.description = description;
}
- public GuardPolicy(String name, String actor, String recipe, List<Constraint> limit_constraints) {
- this(name, actor, recipe);
+ public GuardPolicy(String name, MatchParameters match_parameters, List<Constraint> limit_constraints) {
+ this(name, match_parameters);
if (limit_constraints != null) {
this.limit_constraints = (LinkedList<Constraint>) Collections.unmodifiableList(limit_constraints);
}
}
- public GuardPolicy(String name, String description, String actor, String recipe, List<Constraint> limit_constraints) {
- this(name, actor, recipe, limit_constraints);
+ public GuardPolicy(String name, String description, MatchParameters match_parameters, List<Constraint> limit_constraints) {
+ this(name, match_parameters, limit_constraints);
this.description = description;
}
- public GuardPolicy(String id, String name, String description, String actor, String recipe, List<Constraint> limit_constraints) {
- this(name, description, actor, recipe, limit_constraints);
+ public GuardPolicy(String id, String name, String description, MatchParameters match_parameters, List<Constraint> limit_constraints) {
+ this(name, description, match_parameters, limit_constraints);
this.id = id;
}
+
+
+
+
+
public GuardPolicy(GuardPolicy policy) {
this.id = policy.id;
this.name = policy.name;
this.description = policy.description;
- this.actor = policy.actor;
- this.recipe = policy.recipe;
+ this.match_parameters = new MatchParameters(policy.match_parameters);
if (policy.limit_constraints != null) {
this.limit_constraints = (LinkedList<Constraint>) Collections.unmodifiableList(policy.limit_constraints);
}
@@ -90,12 +94,7 @@ public class GuardPolicy {
if (name == null) {
throw new NullPointerException();
}
- if (actor == null) {
- throw new NullPointerException();
- }
- if (recipe == null) {
- throw new NullPointerException();
- }
+
} catch (Exception e) {
return false;
}
@@ -104,20 +103,19 @@ public class GuardPolicy {
@Override
public String toString() {
- return "Policy [id=" + id + ", name=" + name + ", description=" + description + ", actor=" + actor + ", recipe="
- + recipe + ", limit_constraints=" + limit_constraints + "]";
+ return "GuardPolicy [id=" + id + ", name=" + name + ", description=" + description + ", match_parameters="
+ + match_parameters + ", limit_constraints=" + limit_constraints + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((actor == null) ? 0 : actor.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((limit_constraints == null) ? 0 : limit_constraints.hashCode());
- result = prime * result + ((recipe == null) ? 0 : recipe.hashCode());
+ result = prime * result + ((match_parameters == null) ? 0 : match_parameters.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@@ -130,11 +128,6 @@ public class GuardPolicy {
if (getClass() != obj.getClass())
return false;
GuardPolicy other = (GuardPolicy) obj;
- if (actor == null) {
- if (other.actor != null)
- return false;
- } else if (!actor.equals(other.actor))
- return false;
if (description == null) {
if (other.description != null)
return false;
@@ -145,20 +138,20 @@ public class GuardPolicy {
return false;
} else if (!id.equals(other.id))
return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
if (limit_constraints == null) {
if (other.limit_constraints != null)
return false;
} else if (!limit_constraints.equals(other.limit_constraints))
return false;
- if (recipe == null) {
- if (other.recipe != null)
+ if (match_parameters == null) {
+ if (other.match_parameters != null)
+ return false;
+ } else if (!match_parameters.equals(other.match_parameters))
+ return false;
+ if (name == null) {
+ if (other.name != null)
return false;
- } else if (!recipe.equals(other.recipe))
+ } else if (!name.equals(other.name))
return false;
return true;
}
diff --git a/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/MatchParameters.java b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/MatchParameters.java
new file mode 100644
index 000000000..c96ecf710
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/main/java/org/onap/policy/controlloop/policy/guard/MatchParameters.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * policy-yaml
+ * ================================================================================
+ * Copyright (C) 2017 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.controlloop.policy.guard;
+
+import java.util.LinkedList;
+
+
+public class MatchParameters {
+
+ //public ControlLoopParameter controlLoop;
+ public String controlLoopName;
+ public String actor;
+ public String recipe;
+ public LinkedList<String> targets;
+
+
+ public MatchParameters() {
+
+ }
+
+ public MatchParameters(String actor, String recipe) {
+ this.actor = actor;
+ this.recipe = recipe;
+ }
+
+ public MatchParameters(String actor, String recipe, LinkedList<String> targets) {
+ this(actor, recipe);
+ if (targets != null) {
+ this.targets = new LinkedList<String>(targets);
+ }
+ }
+
+
+ public MatchParameters(String controlLoopName, String actor, String recipe, LinkedList<String> targets) {
+ this(actor, recipe, targets);
+ this.controlLoopName = controlLoopName;
+ }
+
+
+
+
+
+ public MatchParameters(MatchParameters matchParameters) {
+
+ this.controlLoopName = matchParameters.controlLoopName;
+ this.actor = matchParameters.actor;
+ this.recipe = matchParameters.recipe;
+ if (matchParameters.targets != null) {
+ //this.targets = (LinkedList<String>) Collections.unmodifiableList(matchParameters.targets);
+ this.targets = new LinkedList<String>(matchParameters.targets);
+ }
+ }
+
+ /*
+ public boolean isValid() {
+ try {
+ if (actor == null) {
+ throw new NullPointerException();
+ }
+ if (recipe == null) {
+ throw new NullPointerException();
+ }
+ } catch (Exception e) {
+ return false;
+ }
+ return true;
+ }
+ */
+
+ @Override
+ public String toString() {
+ return "MatchParameters [controlLoopName=" + controlLoopName + ", actor=" + actor + ", recipe=" + recipe
+ + ", targets=" + targets + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((actor == null) ? 0 : actor.hashCode());
+ result = prime * result + ((controlLoopName == null) ? 0 : controlLoopName.hashCode());
+ result = prime * result + ((recipe == null) ? 0 : recipe.hashCode());
+ result = prime * result + ((targets == null) ? 0 : targets.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MatchParameters other = (MatchParameters) obj;
+ if (actor == null) {
+ if (other.actor != null)
+ return false;
+ } else if (!actor.equals(other.actor))
+ return false;
+ if (controlLoopName == null) {
+ if (other.controlLoopName != null)
+ return false;
+ } else if (!controlLoopName.equals(other.controlLoopName))
+ return false;
+ if (recipe == null) {
+ if (other.recipe != null)
+ return false;
+ } else if (!recipe.equals(other.recipe))
+ return false;
+ if (targets == null) {
+ if (other.targets != null)
+ return false;
+ } else if (!targets.equals(other.targets))
+ return false;
+ return true;
+ }
+
+
+}
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/compiler/ControlLoopGuardCompilerTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/compiler/ControlLoopGuardCompilerTest.java
index ddee23cef..f381aa207 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/compiler/ControlLoopGuardCompilerTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/compiler/ControlLoopGuardCompilerTest.java
@@ -33,11 +33,20 @@ import org.junit.Test;
import org.onap.policy.controlloop.guard.compiler.ControlLoopGuardCompiler;
public class ControlLoopGuardCompilerTest {
-
+
@Test
public void testTest1() {
try {
- this.test("src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml");
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml");
+ } catch (Exception e) {
+ fail(e.getMessage());
+ }
+ }
+
+ @Test
+ public void testTest2() {
+ try {
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml");
} catch (Exception e) {
fail(e.getMessage());
}
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
index 28e3622f8..9cc1bbd6a 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardBuilderTest.java
@@ -20,7 +20,6 @@
package org.onap.policy.controlloop.policy.guard;
-import org.junit.Ignore;
import org.junit.Test;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
@@ -47,7 +46,6 @@ import org.onap.policy.controlloop.poligy.guard.builder.ControlLoopGuardBuilder;
public class ControlLoopGuardBuilderTest {
- @Ignore
@Test
public void testControlLoopGuard() {
try {
@@ -70,7 +68,13 @@ public class ControlLoopGuardBuilderTest {
//
// Add a guard policy without limit constraint
//
- GuardPolicy policy1 = new GuardPolicy("1111", "guardpolicy1", "guardpolicy1", "APPC", "restart");
+ String clname = "CL_vUSP123";
+ LinkedList<String> targets = new LinkedList<String>();
+ targets.add("s1");
+ targets.add("s2");
+ targets.add("s3");
+ MatchParameters matchParameters = new MatchParameters(clname, "APPC", "Restart", targets);
+ GuardPolicy policy1 = new GuardPolicy("id123", "guardpolicy1", "description aaa", matchParameters);
builder = builder.addGuardPolicy(policy1);
//
// Assert there is no limit constraint associated with the only guard policy
@@ -87,16 +91,16 @@ public class ControlLoopGuardBuilderTest {
//
// Add a constraint to policy1
//
- Map<String, String> time_in_range = new HashMap<String, String>();
- time_in_range.put("arg2", "PT5H");
- time_in_range.put("arg3", "PT24H");
+ Map<String, String> active_time_range = new HashMap<String, String>();
+ active_time_range.put("start", "00:00:00-05:00");
+ active_time_range.put("end", "23:59:59-05:00");
List<String> blacklist = new LinkedList<String>();
blacklist.add("eNodeB_common_id1");
blacklist.add("eNodeB_common_id2");
- Map<String, String> duration = new HashMap<String, String>();
- duration.put("value", "10");
- duration.put("units", "minute");
- Constraint cons = new Constraint(5, duration, time_in_range, blacklist);
+ Map<String, String> time_window = new HashMap<String, String>();
+ time_window.put("value", "10");
+ time_window.put("units", "minute");
+ Constraint cons = new Constraint(5, time_window, active_time_range, blacklist);
builder = builder.addLimitConstraint(policy1.id, cons);
//
// Add a duplicate constraint to policy1
@@ -152,7 +156,12 @@ public class ControlLoopGuardBuilderTest {
@Test
public void test1() {
- this.test("src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml");
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml");
+ }
+
+ @Test
+ public void test2() {
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml");
}
public void test(String testFile) {
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
index 1475553d4..61ad4dfbf 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/guard/ControlLoopGuardTest.java
@@ -39,12 +39,12 @@ public class ControlLoopGuardTest {
@Test
public void testGuardvDNS() {
- this.test("src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml");
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml");
}
@Test
public void testGuardvUSP() {
- this.test("src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml");
+ this.test("src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml");
}
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml
new file mode 100644
index 000000000..f2390fae0
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml
@@ -0,0 +1,19 @@
+guard:
+ version: 2.0.0
+
+guards:
+ - id: unique_guard_ONAP_vDNS_1
+ name: MSO Spinup
+ description: We only spin up 1 instance over a 10 minute window
+ match_parameters:
+ actor: MSO
+ recipe: VF Module Create
+ limit_constraints:
+ - freq_limit_per_target: 1
+ #
+ # https://www.w3.org/TR/xmlschema-2/#duration
+ #
+ time_window:
+ value: 10
+ units: hour
+ \ No newline at end of file
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml
deleted file mode 100644
index 7b5f17c61..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-guard:
- version: 2.0.0
-
-guards:
- - id: unique_guard_ONAP_vDNS_1
- name: MSO Spinup
- description: We only spin up 1 instance over a 10 minute window
- actor: MSO
- recipe: VF Module Create
- limit_constraints:
- - num: 1
- duration:
- value: 15
- units: minute
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml~ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml~
deleted file mode 100644
index a0d76d225..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml~
+++ /dev/null
@@ -1,12 +0,0 @@
-guard:
- version: 2.0.0
-
-guards:
- - id: unique_guard_ONAP_vDNS_1
- name: MSO Spinup
- description: We only spin up 1 instance over a 10 minute window
- actor: MSO
- recipe: VF Module Create
- limit_constraints:
- - num: 1
- duration: PT10M
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml
new file mode 100644
index 000000000..6e47ca2b4
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml
@@ -0,0 +1,24 @@
+guard:
+ version: 2.0.0
+
+guards:
+ - id: unique_guard_1
+ name: APPC 5 Restart
+ description:
+ We only allow 5 restarts over 15 minute window during the day time hours (i.e. avoid midnight to 5am)
+ match_parameters:
+ controlLoopName: CL_NAME_ABC_123
+ actor: APPC
+ recipe: Restart
+ targets:
+ - s1
+ s2
+ s3
+ limit_constraints:
+ - freq_limit_per_target: 5
+ time_window:
+ value: 15
+ units: minute
+ active_time_range:
+ start: 00:00:00-05:00
+ end: 23:59:59-05:00 \ No newline at end of file
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml
deleted file mode 100644
index a487210cd..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-guard:
- version: 2.0.0
-
-guards:
- - id: unique_guard_vUSP_1
- name: APPC 5 Restart
- description:
- We only allow 5 restarts over 15 minute window during the day time hours (i.e. avoid midnight to 5am)
- actor: APPC
- recipe: Restart
- limit_constraints:
- - num: 5
- #
- # https://www.w3.org/TR/xmlschema-2/#duration
- #
- duration:
- value: 15
- units: minute
- #
- # XACML function time-in-range
- #
- # Assumption is that the "current time" is the 1st argument
- #
- time_in_range:
- arg2: PT5H
- arg3: PT24H \ No newline at end of file