summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src/test/resources
diff options
context:
space:
mode:
authordaniel <dc443y@att.com>2017-08-11 11:36:09 -0500
committerdaniel <dc443y@att.com>2017-09-06 17:14:59 -0500
commit7576237fd14304e987eb3c907d481f503dab8232 (patch)
treeddc75f000cb86e3a426cf34d6031efbc14c8735e /controlloop/templates/template.demo/src/test/resources
parentb2bdc20c1ce3a390dd7928144c2ccb17a98b1363 (diff)
Add APPC LCM Interface
The LCM model code and service provider code is implemented. This model code is now used for the vCPE use case scenario. The vFW use case is still using the legacy APPC API as request by APPC for Policy to use in R1. The APPC service provider now generates a demo legacy APPC request with pg-streams. An A&AI named query is implemented for the vFW use case. The code for obtaining the generic-vnf.vnf-id is not in use until we set up the A&AI simulator to work without having cyclical depenncies inside the POMs. JUnits for the vFW and vCPE use cases are now supported. These JUnits test the complete flow of each scenario. A&AI testing is not supported in the JUnit test yet. These JUnits use a target type of VM as VNF is not supported yet. This will be changed when the Target Lock supports VNF. Amended to fix Sonar blockers. Issue-ID: POLICY-104 Change-Id: I46869c5fd5094919da55ad563d608fe6d4b6fea7 Signed-off-by: Daniel Cruz <dc443y@att.com>
Diffstat (limited to 'controlloop/templates/template.demo/src/test/resources')
-rw-r--r--controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vCPE.yaml23
-rw-r--r--controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml28
-rw-r--r--controlloop/templates/template.demo/src/test/resources/yaml/policy_guard_appc_modifyconfig.yaml26
3 files changed, 77 insertions, 0 deletions
diff --git a/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vCPE.yaml b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vCPE.yaml
new file mode 100644
index 000000000..de2ece4ed
--- /dev/null
+++ b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vCPE.yaml
@@ -0,0 +1,23 @@
+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
diff --git a/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml
new file mode 100644
index 000000000..e78b1ca33
--- /dev/null
+++ b/controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_vFW.yaml
@@ -0,0 +1,28 @@
+controlLoop:
+ version: 2.0.0
+ controlLoopName: ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
+ services:
+ - serviceInvariantUUID: 5cfe6f4a-41bc-4247-8674-ebd4b98e35cc
+ serviceUUID: 0f40bba5-986e-4b3c-803f-ddd1b7b25f24
+ serviceName: 57e66ea7-0ed6-45c7-970f
+ trigger_policy: unique-policy-id-1-modifyConfig
+ timeout: 1200
+ abatement: true
+
+policies:
+ - id: unique-policy-id-1-modifyConfig
+ name: modify packet gen config
+ description:
+ actor: APPC
+ recipe: ModifyConfig
+ target:
+ resourceID: Eace933104d443b496b8.nodes.heat.vpg
+ type: VM
+ 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
diff --git a/controlloop/templates/template.demo/src/test/resources/yaml/policy_guard_appc_modifyconfig.yaml b/controlloop/templates/template.demo/src/test/resources/yaml/policy_guard_appc_modifyconfig.yaml
new file mode 100644
index 000000000..a94d4f231
--- /dev/null
+++ b/controlloop/templates/template.demo/src/test/resources/yaml/policy_guard_appc_modifyconfig.yaml
@@ -0,0 +1,26 @@
+guard:
+ version: 2.0.0
+
+guards:
+ - id: unique_guard_6
+ name: APPC 6 ModifyConfig
+ description: |
+ We only allow 2 ModifyConfig over 10 minute window during the day time hours (avoid midnight to 5am)
+ match_parameters:
+ controlLoopName: ControlLoop-Service123-cbed919f-2212-4ef7-8051-fe6308da1bda
+ actor: APPC
+ recipe: ModifyConfig
+ targets:
+ - s1
+ - s2
+ - foobartriggersource36
+ - s3
+ - testGenericVnfName
+ limit_constraints:
+ - freq_limit_per_target: 1
+ time_window:
+ value: 10
+ units: minute
+ active_time_range:
+ start: 00:00:00-05:00
+ end: 23:59:59-05:00 \ No newline at end of file