aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common
diff options
context:
space:
mode:
authorGao, Chenfei (cg287m) <cgao@research.att.com>2017-07-20 16:45:26 -0400
committerGao, Chenfei (cg287m) <cgao@research.att.com>2017-07-20 16:49:18 -0400
commit542385d1e097a68ca8330e5c79b96d20a58d3f4a (patch)
treef9c1cb6ed9eb1b3f75958278b71fcff98d5ad02e /controlloop/common
parentfa09813ca39cbdb7a0ac6a38507d4ea96e28879f (diff)
[POLICY-76] Remove/rename ATT internal stuffs
Change-Id: I3ec4fa22e22e9fccf4b6783b3bc8c92da25e181f Signed-off-by: Gao, Chenfei (cg287m) <cgao@research.att.com>
Diffstat (limited to 'controlloop/common')
-rw-r--r--controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml6
-rw-r--r--controlloop/common/eventmanager/src/test/resources/test.yaml14
-rw-r--r--controlloop/common/guard/src/main/resources/META-INF/persistence.xml6
-rw-r--r--controlloop/common/policy-yaml/README- v1.0.0.md175
-rw-r--r--controlloop/common/policy-yaml/README-guard-v2.0.0.md71
-rw-r--r--controlloop/common/policy-yaml/README-v2.0.0.md319
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyBuilderTest.java22
-rw-r--r--controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java39
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop.yaml (renamed from controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop_1610.yaml)0
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_SDNO_1702.yaml26
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_Test_MultipleService.yaml26
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vProbes_1610.yaml24
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml26
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vService.yaml (renamed from controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vUSP_1610.yaml)0
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_blacklist.yaml17
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vDNS.yaml (renamed from controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vDNS.yaml)0
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml (renamed from controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vFirewall.yaml)0
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml72
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml86
-rw-r--r--controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_vService.yaml (renamed from controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_vUSP_1707.yaml)0
20 files changed, 159 insertions, 770 deletions
diff --git a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
index e3c4ef946..f007c4951 100644
--- a/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
+++ b/controlloop/common/eventmanager/src/main/resources/META-INF/persistence.xml
@@ -12,11 +12,11 @@
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="javax.persistence.jdbc.driver" value="org.mariadb.jdbc.Driver" />
<!-- <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://localhost:7779/policy"/>-->
- <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://135.207.129.112:3306/policy"/>
+ <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://localhost:3306/policy"/>
<property name="javax.persistence.jdbc.user" value="root"/>
- <property name="javax.persistence.jdbc.password" value="lmpg"/>
+ <property name="javax.persistence.jdbc.password" value="aaaa"/>
<property name="eclipselink.logging.level" value="INFO" />
</properties>
</persistence-unit>
-</persistence> \ No newline at end of file
+</persistence>
diff --git a/controlloop/common/eventmanager/src/test/resources/test.yaml b/controlloop/common/eventmanager/src/test/resources/test.yaml
index 1295a9924..e15c8f0e1 100644
--- a/controlloop/common/eventmanager/src/test/resources/test.yaml
+++ b/controlloop/common/eventmanager/src/test/resources/test.yaml
@@ -1,18 +1,18 @@
controlLoop:
version: 1.0.0
- controlLoopName: ControlLoop-vUSP-vCTS-cbed919f-2212-4ef7-8051-fe6308da1bda
+ controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda
services:
- - serviceName: vUSP
+ - serviceName: service1
resources:
- - resourceName: vCTS
+ - resourceName: resource1
resourceType: VF
- - resourceName: vCOM
+ - resourceName: resource2
resourceType: VF
- - resourceName: vRAR
+ - resourceName: resource3
resourceType: VF
- - resourceName: vLCS
+ - resourceName: resource4
resourceType: VF
- - resourceName: v3CB
+ - resourceName: resource5
resourceType: VF
trigger_policy: unique-policy-id-1-restart
timeout: 60
diff --git a/controlloop/common/guard/src/main/resources/META-INF/persistence.xml b/controlloop/common/guard/src/main/resources/META-INF/persistence.xml
index babf94b01..74edd566e 100644
--- a/controlloop/common/guard/src/main/resources/META-INF/persistence.xml
+++ b/controlloop/common/guard/src/main/resources/META-INF/persistence.xml
@@ -12,11 +12,11 @@
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="javax.persistence.jdbc.driver" value="org.mariadb.jdbc.Driver" />
<!-- <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://localhost:7779/policy"/>-->
- <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://135.207.129.112:3306/policy"/>
+ <property name="javax.persistence.jdbc.url" value="jdbc:mariadb://localhost:3306/policy"/>
<property name="javax.persistence.jdbc.user" value="root"/>
- <property name="javax.persistence.jdbc.password" value="lmpg"/>
+ <property name="javax.persistence.jdbc.password" value="aaaa"/>
<property name="eclipselink.logging.level" value="INFO" />
</properties>
</persistence-unit>
-</persistence> \ No newline at end of file
+</persistence>
diff --git a/controlloop/common/policy-yaml/README- v1.0.0.md b/controlloop/common/policy-yaml/README- v1.0.0.md
index 3ef70dea9..65b11adb2 100644
--- a/controlloop/common/policy-yaml/README- v1.0.0.md
+++ b/controlloop/common/policy-yaml/README- v1.0.0.md
@@ -1,8 +1,8 @@
-ECOMP Control Loop Policy
+ONAP Control Loop Policy v1.0.0
A control loop policy is a YAML specification for creating and chaining policies for ControlLoop.
-1610 ECOMP Control Loop Policy Features:
+Features of ONAP Control Loop Policy v1.0.0:
* A single DCAE Closed Loop Event is the trigger for the overall Control Loop Policy
* APPC is the only Actor that Policy will interact with. The operations available are: RESTART, REBUILD, MIGRATE.
@@ -11,18 +11,18 @@ A control loop policy is a YAML specification for creating and chaining policies
* If there are zero Operational Policies, i.e. no automated action is to be taken, then the policy is an Open Loop policy.
* Operational Policies can have retries and timeout's given to control how they are processed.
-This SDK helps build the YAML specification for 1610 ECOMP Control Loop Polices.
+This SDK helps build the YAML specification for ONAP Control Loop Policy v1.0.0.
# Create Builder Object
-To begin with, the ControlLoopPolicyBuilder.Factory class has static methods that one should use to begin building a Control Loop Policy. It will return a [ControlLoopPolicyBuilder object](src/main/java/com/att/ecomp/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java) that can then be used to continue to build and define the Control Loop Policy.
+To begin with, the ControlLoopPolicyBuilder.Factory class has static methods that one should use to begin building a Control Loop Policy. It will return a [ControlLoopPolicyBuilder object](src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java) that can then be used to continue to build and define the Control Loop Policy.
```java
ControlLoopPolicyBuilder builder = ControlLoopPolicyBuilder.Factory.buildControlLoop(
UUID.randomUUID().toString(),
2400,
- new Resource("vCTS", ResourceType.VF),
- new Service("vUSP")
+ new Resource("sampleResource", ResourceType.VF),
+ new Service("sampleService")
);
```
@@ -43,7 +43,7 @@ After the name of the Control Loop and the resource and services have been defin
# Chain Operational Policies Together Using Operational Results
-Operational Policies are chained together using the results of each Operational Policy. The results are defined in [PolicyResult.java](src/main/java/com/att/ecomp/policy/controlloop/policy/PolicyResult.java). To create an Operational Policy that is tied to the result of another, use the
+Operational Policies are chained together using the results of each Operational Policy. The results are defined in [PolicyResult.java](src/main/java/org/onap/policy/controlloop/policy/PolicyResult.java). To create an Operational Policy that is tied to the result of another, use the
setPolicyForPolicyResult() method.
```java
@@ -65,7 +65,7 @@ An Operational Policy MUST have place to go for every one of its results. By def
# Build the YAML Specification
-When finished defining the Policies, build the specification and analyze the [Results.java](src/main/java/com/att/ecomp/policy/controlloop/policy/builder/Results.java)
+When finished defining the Policies, build the specification and analyze the [Results.java](src/main/java/org/onap/policy/controlloop/policy/builder/Results.java)
```java
Results results = builder.buildSpecification();
@@ -79,15 +79,10 @@ When finished defining the Policies, build the specification and analyze the [Re
}
```
-# Sample Code
-
-Sample code is available in this project: https://codecloud.web.att.com/projects/ST_POLICY/repos/com.att.ecomp.policy.controlloop.sample/browse
-
-
# Use the YAML Specification to call the Create Policy API
-Now that you have a valid YAML specification, call the createPolicy API via the ECOMP Policy Platform API.
+Now that you have a valid YAML specification, call the createPolicy API via the ONAP Policy Platform API.
# YAML Specification
@@ -107,34 +102,34 @@ The YAML specification has 2 sections to it: [controlLoop](#controlloop-object)
### resource Object
-This object was derived via ASDC Catalog API and ASDC Data Dictionary (POC) in an attempt to use common naming conventions.
+This object was derived via SDC Catalog API and SDC Data Dictionary (POC) in an attempt to use common naming conventions.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
-| resourceInvariantUUID | string - UUID | optional | via ASDC, the unique ID for the resource version |
-| resourceName | string | required if NO resourceUUID available | Name of the resource, ideally from ASDC catalog. But if not available, use well-known name. |
-| resourceType | string | optional | Use values defined by ASDC: VF, VFC, VL, CP. |
-| resourceUUID | string - UUID | required IF available, else populate resourceName | Unique ID for the resource as assigned via ASDC.
-| resourceVersion | string | optional | string version of the resource via ASDC catalog
+| resourceInvariantUUID | string - UUID | optional | via SDC, the unique ID for the resource version |
+| resourceName | string | required if NO resourceUUID available | Name of the resource, ideally from SDC catalog. But if not available, use well-known name. |
+| resourceType | string | optional | Use values defined by SDC: VF, VFC, VL, CP. |
+| resourceUUID | string - UUID | required IF available, else populate resourceName | Unique ID for the resource as assigned via SDC.
+| resourceVersion | string | optional | string version of the resource via SDC catalog
-Given in 1610 the ASDC catalog is not fully available and resources have not been defined yet, use resourceName. Eg. F5FW
+SDC catalog is not fully available and resources have not been defined yet, use resourceName. Eg. vFW
### service Object
-This object was derived via ASDC Catalog API and ASDC Data Dictionary (POC) in an attempt to use common naming conventions.
+This object was derived via SDC Catalog API and SDC Data Dictionary (POC) in an attempt to use common naming conventions.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
-| serviceInvariantUUID | string - UUID | optional | via ASDC catalog, the unique ID for the service version |
-| serviceName | string | required if NO serviceUUID available | Name of the service, ideally from ASDC catalog. But if not available, use well-known name. |
-| serviceUUID | string - UUID | required IF available, else populate serviceName | Unique ID fort he service as assigned via ASDC
-| serviceVersion | string | optional | string version of the service via ASDC catalog
+| serviceInvariantUUID | string - UUID | optional | via SDC catalog, the unique ID for the service version |
+| serviceName | string | required if NO serviceUUID available | Name of the service, ideally from SDC catalog. But if not available, use well-known name. |
+| serviceUUID | string - UUID | required IF available, else populate serviceName | Unique ID fort he service as assigned via SDC
+| serviceVersion | string | optional | string version of the service via SDC catalog
-Given in 1610 the ASDC catalog is not fully available and some services have not been defined yet, use resourceName. Eg. vUSP, vSCP, trinity.
+SDC catalog is not fully available and some services have not been defined yet, use serviceName. Eg. vLB.
### pnf Object
-This object is used for a physical network function. In the case of 1610, eNodeB is the use case supported. Expect this object to change in the future when ECOMP Policy fully integrates with A&AI.
+This object is used for a physical network function. Expect this object to change in the future when ONAP Policy fully integrates with A&AI.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
@@ -148,7 +143,7 @@ The policies section is an array of [Policy objects](#policy-object).
### Policy Object
-This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invoke a recipe (eg. "Restart") on a target entity (eg. a "VM"). For 1610, there are 2 actors: APPC and RAN. An operation is simply defined as performing a recipe (or operation) on an actor.
+This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invoke a recipe (eg. "Restart") on a target entity (eg. a "VM"). An operation is simply defined as performing a recipe (or operation) on an actor.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
@@ -168,62 +163,29 @@ This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invok
Every Operational Policy MUST have a place to go for every possible result (success, failure, failure_retries, failure_timeout, failure_exception). By default, all the results are final results.
-## Examples of YAML Control Loops for 1610
+## Examples of YAML Control Loops v1.0.0
-[1607-F5](src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml)
-[1610-vUSP](src/test/resources/v1.0.0/policy_vUSP_1610.yaml)
-[1610-Open-Loop](src/test/resources/v1.0.0/policy_OpenLoop_1610.yaml)
-[1610-vProbes](src/test/resources/v1.0.0/policy_vProbes_1610.yaml)
-[VNF-with-Multiple-Services](src/test/resources/v1.0.0/policy_Test_MultipleService.yaml)
+[vService](src/test/resources/v1.0.0/policy_vService.yaml)
+[Open-Loop](src/test/resources/v1.0.0/policy_OpenLoop.yaml)
-### 1607 F5
-```
-controlLoop:
- version: 1.0.0
- controlLoopName: ClosedLoop-FRWL-SIG-d925ed73-8231-4d02-9545-db4e101f88f8
- services:
- - serviceName: vSCP
- - serviceName: trinity
- resources:
- - resourceName: F5FW
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 1200
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
-```
-
-### 1610 vUSP
+### vService
```
controlLoop:
version: 1.0.0
- controlLoopName: ControlLoop-vUSP-vCTS-cbed919f-2212-4ef7-8051-fe6308da1bda
+ controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda
services:
- - serviceName: vUSP
+ - serviceName: service1
resources:
- - resourceName: vCTS
+ - resourceName: resource1
resourceType: VF
- - resourceName: vCOM
+ - resourceName: resource2
resourceType: VF
- - resourceName: vRAR
+ - resourceName: resource3
resourceType: VF
- - resourceName: vLCS
+ - resourceName: resource4
resourceType: VF
- - resourceName: v3CB
+ - resourceName: resource5
resourceType: VF
trigger_policy: unique-policy-id-1-restart
timeout: 1200
@@ -273,84 +235,25 @@ policies:
```
-### 1610 Open Loop
+### Open Loop
```
controlLoop:
version: 1.0.0
controlLoopName: ControlLoop-Open-fac4ae3d-c3f5-4bab-8e54-0a8581ede132
services:
- - serviceName: Service
+ - serviceName: service1
resources:
- resourceType: VF
- resourceName: Example
+ resourceName: resource1
trigger_policy: final_openloop
timeout: 0
policies:
```
-### 1610 vProbes
-```
-controlLoop:
- version: 1.0.0
- controlLoopName: ControlLoop-vProbes-41aba939-9a93-4535-b193-973c68fc8763
- services:
- resources:
- - resourceName: vProbes
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 600
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
-
-```
-
-### VNF with Multiple Services
-```
-controlLoop:
- version: 1.0.0
- controlLoopName: ClosedLoop-FRWL-SIG-d925ed73-8231-4d02-9545-db4e101f88f8
- services:
- - serviceName: vSCP
- - serviceName: vSBG
- resources:
- - resourceName: F5FW
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 1200
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
-
-```
# Control Loop Final Results Explained
-A Control Loop Policy has the following set of final results, as defined in [FinalResult.java](src/main/java/com/att/ecomp/policy/controlloop/policy/FinalResult.java). A final result indicates when a Control Loop Policy has finished execution and is finished processing a Closed Loop Event. All paths must lead to a Final Result.
+A Control Loop Policy has the following set of final results, as defined in [FinalResult.java](src/main/java/org/onap/policy/controlloop/policy/FinalResult.java). A final result indicates when a Control Loop Policy has finished execution and is finished processing a Closed Loop Event. All paths must lead to a Final Result.
diff --git a/controlloop/common/policy-yaml/README-guard-v2.0.0.md b/controlloop/common/policy-yaml/README-guard-v2.0.0.md
index e0416f486..bda8684e3 100644
--- a/controlloop/common/policy-yaml/README-guard-v2.0.0.md
+++ b/controlloop/common/policy-yaml/README-guard-v2.0.0.md
@@ -1,21 +1,21 @@
-ECOMP Control Loop Guard
+ONAP Control Loop Guard
A control loop guard is a YAML specification for creating policy guard for ControlLoop.
-1707 ECOMP Control Loop Guard Features:
+ONAP Control Loop Guard Features:
* The Control Loop Guard can specify the frequency limiter and the blacklist of target entities but not both in the same Guard.
* Two parts are incorporated. One is the common guard header including guard version while the other part is a set of guard policies.
* The Control Loop Guard should contain at least one guard policies.
* Each guard policy is bound to a specific Actor and Recipe.
* Each guard policy should have at least one limit constraints which define how the guard policy should be enforced.
-* Supported Actors are APPC, MSO, SDNO, SDNR and AOTS.
+* Supported Actors are APPC and SO.
-This SDK helps build the YAML specification for 1707 ECOMP Control Loop Guard.
+This SDK helps build the YAML specification for ONAP Control Loop Guard.
# Create Builder Object
-To begin with, the ControlLoopGuardBuilder.Factory class has static methods that one should use to begin building a Control Loop Guard. It will return a [ControlLoopGuardBuilder object](src/main/java/com/att/ecomp/policy/controlloop/policy/guard/builder/ControlLoopGuardBuilder.java) that can then be used to continue to build and define the Control Loop Guard.
+To begin with, the ControlLoopGuardBuilder.Factory class has static methods that one should use to begin building a Control Loop Guard. It will return a [ControlLoopGuardBuilder object](src/main/java/org/onap/policy/controlloop/policy/guard/builder/ControlLoopGuardBuilder.java) that can then be used to continue to build and define the Control Loop Guard.
```java
ControlLoopGuardBuilder builder = ControlLoopGuardBuilder.Factory.buildControlLoopGuard(new Guard());
@@ -53,7 +53,7 @@ The limit constraint defines the details of how to enforce the guard policy. Eac
# Build the YAML Specification
-When finished defining the Guard Policies, build the specification and analyze the [Results.java](src/main/java/com/att/ecomp/policy/controlloop/policy/builder/Results.java)
+When finished defining the Guard Policies, build the specification and analyze the [Results.java](src/main/java/org/onap/policy/controlloop/policy/builder/Results.java)
```java
Results results = builder.buildSpecification();
@@ -67,15 +67,11 @@ When finished defining the Guard Policies, build the specification and analyze t
}
```
-# Sample Code
-
-Sample code is available in this project: https://codecloud.web.att.com/projects/ST_POLICY/repos/com.att.ecomp.policy.controlloop.sample/browse
-
-
# Use the YAML Specification to Generate the XACML Guard Policies
-Now that you have a valid YAML specification, call the method in [PolicyGuardYamlToXacml.java](guard/src/main/java/com/att/ecomp/policy/guard/PolicyGuardYamlToXacml.java) to generate the XACML Guard Policies.
+Now that you have a valid YAML specification, call the method in [PolicyGuardYamlToXacml.java](guard/src/main/java/org/onap/policy/guard/PolicyGuardYamlToXacml.java) to generate the XACML Guard Policies.
+
# YAML Specification
@@ -119,21 +115,20 @@ The first three attributes define the frequency limiter which means that only a
The "duration" parameter should have one of the following values: [5min, 10min, 30min, 1h, 12h, 1d, 5d, 1w, 1mon].
-## Examples of YAML Control Loop Guards for 1707
+## Examples of YAML Control Loop Guards
-[1707-vUSP-Guard](src/test/resources/v2.0.0-guard/policy_guard_vUSP_1707_appc.yaml)
-[1707-eNodeB-Ericsson-Frequency-Limiter-Guard](template.enodeb/src/test/resources/policy_guard_eNodeB_1707_sdnr_reset.yaml)
-[1707-eNodeB-Ericsson-Blacklist-Guard](template.enodeb/src/test/resources/policy_guard_vUSP_1707_sdnr_reset_blacklist.yaml)
-[OpenECOMP-vDNS-Guard](src/test/resources/v2.0.0-guard/policy_guard_OpenECOMP_demo_vDNS.yaml)
+[vService-Frequency-Limiter-Guard](src/test/resources/v2.0.0-guard/policy_guard_appc_restart.yaml)
+[vService-Blacklist-Guard](src/test/resources/v2.0.0-guard/policy_guard_blacklist.yaml)
+[ONAP-vDNS-Guard](src/test/resources/v2.0.0-guard/policy_guard_ONAP_demo_vDNS.yaml)
-### 1707 vUSP Guard
+### vService Frequency Limiter Guard
```
guard:
version: 2.0.0
guards:
- - id: unique_guard_vUSP_1
+ - id: unique_guard_vService_frequency_limiter
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)
@@ -147,57 +142,39 @@ guards:
arg3: PT24H
```
-### 1707 eNodeB Ericsson Frequency Limiter Guard
-```
-guard:
- version: 2.0.0
-guards:
- - id: unique_guard_eNodeB_Ericsson
- name: SDNR 1 Reset
- description: |
- We only allow 1 reset over 24 hour window
- actor: SDNR
- recipe: Reset
- limit_constraints:
- - num: 100
- duration: 1d
- time_in_range:
- arg2: 00:00:00-05:00
- arg3: 23:59:59-05:00
-```
-
-### 1707 eNodeB Ericsson Blacklist Guard
+### vService Blacklist Guard
```
guard:
version: 2.0.0
guards:
- - id: unique_guard_eNodeB_Ericsson_Blacklist
- name: SDNR Reset Blacklist
+ - id: unique_guard_vService_blacklist
+ name: APPC Restart Blacklist
description: |
We deny restart of the blacklisted targets (avoid midnight to 5am)
actor: APPC
- recipe: Reset
+ recipe: Restart
limit_constraints:
- blacklist:
- - HNVJAL22_DMH1_U_L
- - MNYKAQ35_DMH1_U_L
+ - TargetName1
+ - TargetName2
time_in_range:
arg2: 00:00:00-05:00
arg3: 23:59:59-05:00
```
-### OpenECOMP vDNS Guard
+
+### ONAP vDNS Guard
```
guard:
version: 2.0.0
guards:
- id: unique_guard_ONAP_vDNS_1
- name: MSO Spinup
+ name: SO Spinup
description: We only spin up 1 instance over a 10 minute window
- actor: MSO
+ actor: SO
recipe: VF Module Create
limit_constraints:
- num: 1
diff --git a/controlloop/common/policy-yaml/README-v2.0.0.md b/controlloop/common/policy-yaml/README-v2.0.0.md
index eadaf658a..4450b52fb 100644
--- a/controlloop/common/policy-yaml/README-v2.0.0.md
+++ b/controlloop/common/policy-yaml/README-v2.0.0.md
@@ -1,10 +1,10 @@
-ECOMP Control Loop Policy v2.0.0
+ONAP Control Loop Policy v2.0.0
A control loop policy is a YAML specification for creating and chaining policies for ControlLoop.
-1707 ECOMP Control Loop Policy Features:
+Features of ONAP Control Loop Policy v2.0.0:
-* Backward compatible with 1610 ECOMP Control Loop Policy
+* Backward compatible with ONAP Control Loop Policy v1.0.0
* A single DCAE Closed Loop Event is the trigger for the overall Control Loop Policy.
* An overall timeout for the Control Loop Policy must be provided.
* An abatement flag indicating whether Policy will receive abatement event for the Control Loop could be provided.
@@ -17,36 +17,25 @@ A control loop policy is a YAML specification for creating and chaining policies
| Actor | Recipe | Target | Payload |
| -------------|:---------------------------:| ---------| ------------:|
-| APPC | Restart | VM | AICVServerSelfLink, AICIdentity |
-| APPC | Rebuild | VM | AICVServerSelfLink, AICIdentity |
-| APPC | Migrate | VM | AICVServerSelfLink, AICIdentity |
-| APPC | ModifyConfig | VFC | generic-vnf.vnf-id |
-| MSO | VF Module Create | VFC | optional |
-| SDNO | health-diagnostic-type | VM | health-diagnostic-code, health-diagnostic-code-parameters |
-| SDNO | health-diagnostic | VM | optional |
-| SDNO | health-diagnostic-history | VM | optional |
-| SDNO | health-diagnostic-commands | VM | optional |
-| SDNO | health-diagnostic-aes | VM | optional |
-| SDNR | Reset | PNF | optional |
-| AOTS | checkMaintenanceWindow | VM | optional |
-| AOTS | checkENodeBTicketHours | VM | timeWindow |
-| AOTS | checkEquipmentStatus | VM | optional |
-| AOTS | checkEimStatus | VM | optional |
-
-
-
-This SDK helps build the YAML specification for 1707 ECOMP Control Loop Polices.
+| APPC | Restart | VM | CloudVServerSelfLink, CloudIdentity |
+| APPC | Rebuild | VM | CloudVServerSelfLink, CloudIdentity |
+| APPC | Migrate | VM | CloudVServerSelfLink, CloudIdentity |
+| APPC | ModifyConfig | VNF | generic-vnf.vnf-id |
+| SO | VF Module Create | VFC | optional |
+
+
+This SDK helps build the YAML specification for ONAP Control Loop Policy v2.0.0.
# Create Builder Object
-To begin with, the ControlLoopPolicyBuilder.Factory class has static methods that one should use to begin building a Control Loop Policy. It will return a [ControlLoopPolicyBuilder object](src/main/java/com/att/ecomp/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java) that can then be used to continue to build and define the Control Loop Policy.
+To begin with, the ControlLoopPolicyBuilder.Factory class has static methods that one should use to begin building a Control Loop Policy. It will return a [ControlLoopPolicyBuilder object](src/main/java/org/onap/policy/controlloop/policy/builder/ControlLoopPolicyBuilder.java) that can then be used to continue to build and define the Control Loop Policy.
```java
ControlLoopPolicyBuilder builder = ControlLoopPolicyBuilder.Factory.buildControlLoop(
UUID.randomUUID().toString(),
2400,
- new Resource("vCTS", ResourceType.VF),
- new Service("vUSP")
+ new Resource("sampleResource", ResourceType.VF),
+ new Service("sampleService")
);
```
@@ -76,7 +65,7 @@ After the trigger policy, the name, the resource(s) and services of the Control
# Chain Operational Policies Together Using Operational Results
-Operational Policies are chained together using the results of each Operational Policy. The results are defined in [PolicyResult.java](src/main/java/com/att/ecomp/policy/controlloop/policy/PolicyResult.java). To create an Operational Policy that is tied to the result of another, use the
+Operational Policies are chained together using the results of each Operational Policy. The results are defined in [PolicyResult.java](src/main/java/org/onap/policy/controlloop/policy/PolicyResult.java). To create an Operational Policy that is tied to the result of another, use the
setPolicyForPolicyResult() method.
```java
@@ -102,7 +91,7 @@ An Operational Policy MUST have place to go for every one of its results. By def
# Build the YAML Specification
-When finished defining the Policies, build the specification and analyze the [Results.java](src/main/java/com/att/ecomp/policy/controlloop/policy/builder/Results.java)
+When finished defining the Policies, build the specification and analyze the [Results.java](src/main/java/org/onap/policy/controlloop/policy/builder/Results.java)
```java
Results results = builder.buildSpecification();
@@ -116,15 +105,10 @@ When finished defining the Policies, build the specification and analyze the [Re
}
```
-# Sample Code
-
-Sample code is available in this project: https://codecloud.web.att.com/projects/ST_POLICY/repos/com.att.ecomp.policy.controlloop.sample/browse
-
-
# Use the YAML Specification to call the Create Policy API
-Now that you have a valid YAML specification, call the createPolicy API via the ECOMP Policy Platform API.
+Now that you have a valid YAML specification, call the createPolicy API via the ONAP Policy Platform API.
# YAML Specification
@@ -146,32 +130,32 @@ The YAML specification has 2 sections to it: [controlLoop](#controlloop-object)
### resource Object
-This object was derived via ASDC Catalog API and ASDC Data Dictionary (POC) in an attempt to use common naming conventions.
+This object was derived via SDC Catalog API and SDC Data Dictionary (POC) in an attempt to use common naming conventions.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
-| resourceInvariantUUID | string - UUID | optional | via ASDC, the unique ID for the resource version |
-| resourceName | string | required if NO resourceUUID available | Name of the resource, ideally from ASDC catalog. But if not available, use well-known name. |
-| resourceType | string | optional | Use values defined by ASDC: VF, VFC, VL, CP. |
-| resourceUUID | string - UUID | required IF available, else populate resourceName | Unique ID for the resource as assigned via ASDC.
-| resourceVersion | string | optional | string version of the resource via ASDC catalog
+| resourceInvariantUUID | string - UUID | optional | via SDC, the unique ID for the resource version |
+| resourceName | string | required if NO resourceUUID available | Name of the resource, ideally from SDC catalog. But if not available, use well-known name. |
+| resourceType | string | optional | Use values defined by SDC: VF, VFC, VL, CP. |
+| resourceUUID | string - UUID | required IF available, else populate resourceName | Unique ID for the resource as assigned via SDC.
+| resourceVersion | string | optional | string version of the resource via SDC catalog
### service Object
-This object was derived via ASDC Catalog API and ASDC Data Dictionary (POC) in an attempt to use common naming conventions.
+This object was derived via SDC Catalog API and SDC Data Dictionary (POC) in an attempt to use common naming conventions.
| Field Name | Type | Required | Description |
| ---------------:| -------------:| ----------:| ------------:|
-| serviceInvariantUUID | string - UUID | optional | via ASDC catalog, the unique ID for the service version |
-| serviceName | string | required if NO serviceUUID available | Name of the service, ideally from ASDC catalog. But if not available, use well-known name. |
-| serviceUUID | string - UUID | required IF available, else populate serviceName | Unique ID fort he service as assigned via ASDC
-| serviceVersion | string | optional | string version of the service via ASDC catalog
+| serviceInvariantUUID | string - UUID | optional | via SDC catalog, the unique ID for the service version |
+| serviceName | string | required if NO serviceUUID available | Name of the service, ideally from SDC catalog. But if not available, use well-known name. |
+| serviceUUID | string - UUID | required IF available, else populate serviceName | Unique ID fort he service as assigned via SDC
+| serviceVersion | string | optional | string version of the service via SDC catalog
### pnf Object
-This object is used for a physical network function. In the case of 1707, eNodeB is the use case supported. Expect this object to change in the future when ECOMP Policy fully integrates with A&AI.
+This object is used for a physical network function. Expect this object to change in the future when ONAP Policy fully integrates with A&AI.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
@@ -185,7 +169,7 @@ The policies section is an array of [Policy objects](#policy-object).
### Policy Object
-This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invoke a recipe (eg. "Restart") on a target entity (eg. a "VM"). For 1707, there are 5 actors: APPC, MSO, SDNO, SDNR and AOTS. An operation is simply defined as performing a recipe (or operation) on an actor.
+This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invoke a recipe (eg. "Restart") on a target entity (eg. a "VM"). An operation is simply defined as performing a recipe (or operation) on an actor.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
@@ -196,7 +180,7 @@ This is an Operation Policy. It is used to instruct an actor (eg. APPC) to invok
| recipe | string | required | Name of recipe to be performed. Example "Restart" |
| target | [target](#target-object) object | required | Entity being targeted. Example: VM |
| timeout | int | required | Timeout for the actor to perform the recipe. |
-| retry | int | optional | Optional number of retries for ECOMP Policy to invoke the recipe on the actor. |
+| retry | int | optional | Optional number of retries for ONAP Policy to invoke the recipe on the actor. |
| success | string | required | By default, this value should be FINAL_SUCCESS. Otherwise this can be the ID of the operational Policy (included in this specification) to invoke upon successfully completing the recipe on the actor.
| failure | string | required | By default, this value should be FINAL_FAILURE. Otherwise this can be the ID of the operational Policy (included in this specification) to invoke upon failure to perform the operation. |
| failure_exception | string | required | By default, this value should be FINAL_FAILURE_EXCEPTION. Otherwise this can be the ID of an Operational Policy (included in this specification) to invoke upon an exception occurring while attempting to perform the operation. |
@@ -213,34 +197,32 @@ This object is used for defining a target entity of a recipe.
| Field Name | Type | Required | Description |
| ------------- |:-------------:| -----------| ------------:|
| type | enums of VM, PNF and VNC | required | Type of the target. |
-| resourceID | string | optional | Resource ID of the target. Should be supplied via ASDC Catalog. |
+| resourceID | string | optional | Resource ID of the target. Should be supplied via SDC Catalog. |
-## Examples of YAML Control Loops for 1707
+## Examples of YAML Control Loops v2.0.0
-[1707-vUSP](src/test/resources/v2.0.0/policy_vUSP_1707.yaml)
-[1707-eNodeB-Ericsson](src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml)
-[1707-eNodeB-ALU](src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml)
-[OpenECOMP-vFirewall](src/test/resources/v2.0.0/policy_OpenECOMP_demo_vFirewall.yaml)
-[OpenECOMP-vDNS](src/test/resources/v2.0.0/policy_OpenECOMP_demo_vDNS.yaml)
+[vService](src/test/resources/v2.0.0/policy_vService.yaml)
+[ONAP-vFirewall](src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml)
+[ONAP-vDNS](src/test/resources/v2.0.0/policy_ONAP_demo_vDNS.yaml)
-### 1707 vUSP
+### vService
```
controlLoop:
version: 2.0.0
- controlLoopName: ControlLoop-vUSP-vCTS-cbed919f-2212-4ef7-8051-fe6308da1bda
+ controlLoopName: ControlLoop-vService-cbed919f-2212-4ef7-8051-fe6308da1bda
services:
- - serviceName: vUSP
+ - serviceName: service1
resources:
- - resourceName: vCTS
+ - resourceName: resource1
resourceType: VFC
- - resourceName: vCOM
+ - resourceName: resource2
resourceType: VFC
- - resourceName: vRAR
+ - resourceName: resource3
resourceType: VFC
- - resourceName: vLCS
+ - resourceName: resource4
resourceType: VFC
- - resourceName: v3CB
+ - resourceName: resource5
resourceType: VFC
trigger_policy: unique-policy-id-1-restart
timeout: 1200
@@ -256,7 +238,7 @@ policies:
type: VM
retry: 2
timeout: 300
- success: unique-policy-id-1-healthdiagnostic
+ success: final_success
failure: unique-policy-id-2-rebuild
failure_timeout: unique-policy-id-2-rebuild
failure_retries: unique-policy-id-2-rebuild
@@ -272,7 +254,7 @@ policies:
type: VM
retry: 0
timeout: 600
- success: unique-policy-id-2-healthdiagnostic
+ success: final_success
failure: unique-policy-id-3-migrate
failure_timeout: unique-policy-id-3-migrate
failure_retries: unique-policy-id-3-migrate
@@ -294,212 +276,11 @@ policies:
failure_retries: final_failure_retries
failure_exception: final_failure_exception
failure_guard: final_failure_guard
-
- - id: unique-policy-id-1-healthdiagnostic
- name: Do SDNO Health Diagnostic
- description:
- actor: SDNO
- recipe: health-diagnostic
- payload:
- health-diagnostic-code: HC99
- health-diagnostic-code-parameters: "{\"Junk\":\"--version\",\"Junk2\":\"--help\"}"
- target:
- type: VM
- retry: 0
- timeout: 600
- success: final_success
- failure: unique-policy-id-2-rebuild
- failure_timeout: unique-policy-id-2-rebuild
- failure_retries: unique-policy-id-2-rebuild
- failure_exception: final_failure_exception
- failure_guard: unique-policy-id-2-rebuild
-
- - id: unique-policy-id-2-healthdiagnostic
- name: Do SDNO Health Diagnostic
- description:
- actor: SDNO
- recipe: health-diagnostic
- payload:
- health-diagnostic-code: HC99
- health-diagnostic-code-parameters: "{\"Junk\":\"--version\",\"Junk2\":\"--help\"}"
- target:
- type: VM
- retry: 0
- timeout: 600
- 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
-```
-
-### 1707 eNodeB Ericsson
-```
-controlLoop:
- version: 2.0.0
- controlLoopName: ControlLoop-eNodeB-Ericsson-0732e76a-4228-42d1-8185-972510be388c
- services:
- resources:
- pnf:
- PNFName: eNodeB.Ericsson
- trigger_policy: unique-policy-id-1-check-aots-ticket
- timeout: 2400
-
-policies:
- - id: unique-policy-id-1-check-aots-ticket
- name: Check AOTS CTS
- description: Discard sleeping cell based on the new signature if it appears in recent CTS tickets
- actor: AOTS
- recipe: checkENodeBTicketHours
- payload:
- timeWindow: 5
- retry: 2
- timeout: 300
- success: unique-policy-id-2-check-aots-cts
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-2-check-aots-cts
- name: Check AOTS CTS Equipment
- description: Discard sleeping cell based on the new signature if it is not active in CTS equipment data
- actor: AOTS
- recipe: checkEquipmentStatus
- payload:
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-eim
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-3-check-aots-eim
- name: Check AOTS EIM_RT
- description: Discard sleeping cell based on the new signature if it appears in EIM_RT data
- actor: AOTS
- recipe: checkEimStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-maintenance
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-4-check-aots-maintenance
- name: Check AOTS MAINTENANCE
- description: Discard sleeping cell based on the new signature if it appears in Maintenance
- actor: AOTS
- recipe: checkMaintenanceWindow
- retry: 2
- timeout: 300
- success: unique-policy-id-5-sdnr-reset
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-5-sdnr-reset
- name: Have SDNR Reset
- description: SDNR should now reset this sleeper
- actor: SDNR
- recipe: Reset
- operationsAccumulateParams:
- period: 15m
- limit: 5
- retry: 2
- 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
-```
-
-### 1707 eNodeB ALU
```
-controlLoop:
- version: 2.0.0
- controlLoopName: ControlLoop-eNodeB-ALU-3ee91181-6f05-4cd3-8437-cad5f58653ca
- services:
- resources:
- pnf:
- PNFName: eNodeB.ALU
- trigger_policy: unique-policy-id-1-check-aots
- timeout: 2400
-
-policies:
- - id: unique-policy-id-1-check-aots
- name: Check AOTS CTS
- description: Discard sleeping cell based on the new signature if it appears in recent CTS tickets
- actor: AOTS
- recipe: checkENodeBTicketHours
- payload:
- timeWindow: 5
- retry: 2
- timeout: 300
- success: unique-policy-id-2-check-aots-cts
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
- - id: unique-policy-id-2-check-aots-cts
- name: Check AOTS CTS Equipment
- description: Discard sleeping cell based on the new signature if it is not active in CTS equipment data
- actor: AOTS
- recipe: checkEquipmentStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-eim
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-3-check-aots-eim
- name: Check AOTS EIM_RT
- description: Discard sleeping cell based on the new signature if it appears in EIM_RT data
- actor: AOTS
- recipe: checkEimStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-4-sdnr-reset
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
- - id: unique-policy-id-4-sdnr-reset
- name: Have SDNR Reset
- description: SDNR should now reset this sleeper
- actor: SDNR
- recipe: Reset
- operationsAccumulateParams:
- period: 15m
- limit: 5
- retry: 2
- 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
-```
-### OpenECOMP vFirewall
+### ONAP vFirewall
```
controlLoop:
version: 2.0.0
@@ -532,7 +313,7 @@ policies:
failure_guard: final_failure_guard
```
-### OpenECOMP vDNS
+### ONAP vDNS
```
controlLoop:
version: 2.0.0
@@ -548,7 +329,7 @@ policies:
- id: unique-policy-id-1-scale-up
name: Create a new VF Module
description:
- actor: MSO
+ actor: SO
recipe: VF Module Create
target:
resourceID: 59a2ee3fB58045feB5a1.nodes.heat.vdns
@@ -565,5 +346,5 @@ policies:
# Control Loop Final Results Explained
-A Control Loop Policy has the following set of final results, as defined in [FinalResult.java](src/main/java/com/att/ecomp/policy/controlloop/policy/FinalResult.java). A final result indicates when a Control Loop Policy has finished execution and is finished processing a Closed Loop Event. All paths must lead to a Final Result.
+A Control Loop Policy has the following set of final results, as defined in [FinalResult.java](src/main/java/org/onap/policy/controlloop/policy/FinalResult.java). A final result indicates when a Control Loop Policy has finished execution and is finished processing a Closed Loop Event. All paths must lead to a Final Result.
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyBuilderTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyBuilderTest.java
index f8ad499f0..90d498a8d 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyBuilderTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyBuilderTest.java
@@ -61,30 +61,30 @@ public class ControlLoopPolicyBuilderTest {
//
// Test add services
//
- Service vSCP = new Service("vSCP");
- Service vUSP = new Service("vUSP");
- Service vTrinity = new Service("Trinity");
- builder = builder.addService(vSCP, vUSP, vTrinity);
+ Service Ser1 = new Service("Ser1");
+ Service Ser2 = new Service("Ser2");
+ Service Ser3 = new Service("Ser3");
+ builder = builder.addService(Ser1, Ser2, Ser3);
assertTrue(builder.getControlLoop().services.size() == 3);
//
// Test remove services
//
- builder = builder.removeService(vSCP);
+ builder = builder.removeService(Ser1);
assertTrue(builder.getControlLoop().services.size() == 2);
builder = builder.removeAllServices();
assertTrue(builder.getControlLoop().services.size() == 0);
//
// Test add resources
//
- Resource vCTS = new Resource("vCTS", ResourceType.VF);
- Resource vCOM = new Resource("vCTS", ResourceType.VF);
- Resource vRAR = new Resource("vCTS", ResourceType.VF);
- builder = builder.addResource(vCTS, vCOM, vRAR);
+ Resource Resrc1 = new Resource("Resrc1", ResourceType.VF);
+ Resource Resrc2 = new Resource("Resrc1", ResourceType.VF);
+ Resource Resrc3 = new Resource("Resrc1", ResourceType.VF);
+ builder = builder.addResource(Resrc1, Resrc2, Resrc3);
assertTrue(builder.getControlLoop().resources.size() == 3);
//
// Test remove resources
//
- builder = builder.removeResource(vCTS);
+ builder = builder.removeResource(Resrc1);
assertTrue(builder.getControlLoop().resources.size() == 2);
builder = builder.removeAllResources();
assertTrue(builder.getControlLoop().resources.size() == 0);
@@ -308,7 +308,7 @@ public class ControlLoopPolicyBuilderTest {
Policy triggerPolicy = builder.setTriggerPolicy(
"Restart the eNodeB",
"Upon getting the trigger event, restart the eNodeB",
- "SDNR",
+ "RANController",
new Target(TargetType.PNF),
"Restart",
null,
diff --git a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
index 9e91dc4d3..555b69282 100644
--- a/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
+++ b/controlloop/common/policy-yaml/src/test/java/org/onap/policy/controlloop/policy/ControlLoopPolicyTest.java
@@ -36,54 +36,25 @@ import org.yaml.snakeyaml.constructor.Constructor;
public class ControlLoopPolicyTest {
- @Test
- public void testSDNO() {
- this.test("src/test/resources/v1.0.0/policy_SDNO_1702.yaml");
- }
@Test
public void test() {
this.test("src/test/resources/v1.0.0/policy_Test.yaml");
}
-
- @Test
- public void testMultipleService() {
- this.test("src/test/resources/v1.0.0/policy_Test_MultipleService.yaml");
- }
-
- @Test
- public void testF5() {
- this.test("src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml");
- }
@Test
- public void testUSP() {
- this.test("src/test/resources/v1.0.0/policy_vUSP_1610.yaml");
+ public void testvService1() {
+ this.test("src/test/resources/v1.0.0/policy_vService.yaml");
}
@Test
public void testOpenLoop() {
- this.test("src/test/resources/v1.0.0/policy_OpenLoop_1610.yaml");
- }
-
- @Test
- public void testvProbes() {
- this.test("src/test/resources/v1.0.0/policy_vProbes_1610.yaml");
- }
-
- @Test
- public void test1707() {
- this.test("src/test/resources/v2.0.0/policy_vUSP_1707.yaml");
- }
-
- @Test
- public void testeNodeBALU() {
- this.test("src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml");
+ this.test("src/test/resources/v1.0.0/policy_OpenLoop.yaml");
}
@Test
- public void testeNodeBEricsson() {
- this.test("src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml");
+ public void testvService2() {
+ this.test("src/test/resources/v2.0.0/policy_vService.yaml");
}
public void test(String testFile) {
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop_1610.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop.yaml
index 7fd27fa97..7fd27fa97 100644
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop_1610.yaml
+++ b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_OpenLoop.yaml
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_SDNO_1702.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_SDNO_1702.yaml
deleted file mode 100644
index 339950f6f..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_SDNO_1702.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-controlLoop:
- version: 1.0.0
- controlLoopName: PoloControlLoop-vPE-248b154b-ff3f-458f-885c-ec290c615714
- services:
- - serviceName: vPE
- trigger_policy: unique-policy-id-1-healthdianostic
- timeout: 600
-
-policies:
- - id: unique-policy-id-1-healthdiagnostic
- name: Do SDNO Health Diagnostic
- description:
- actor: SDNO
- recipe: health-diagnostic
- payload:
- health-diagnostic-code: HC99
- health-diagnostic-code-parameters: "{\"Junk\":\"--version\",\"Junk2\":\"--help\"}"
- target: VM
- retry: 0
- timeout: 600
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- \ No newline at end of file
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_Test_MultipleService.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_Test_MultipleService.yaml
deleted file mode 100644
index 8ce707729..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_Test_MultipleService.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-controlLoop:
- version: 1.0.0
- controlLoopName: ClosedLoop-FRWL-SIG-d925ed73-8231-4d02-9545-db4e101f88f8
- services:
- - serviceName: vSCP
- - serviceName: vSBG
- resources:
- - resourceName: F5FW
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 1200
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vProbes_1610.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vProbes_1610.yaml
deleted file mode 100644
index 2a5f513ab..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vProbes_1610.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-controlLoop:
- version: 1.0.0
- controlLoopName: ControlLoop-vProbes-41aba939-9a93-4535-b193-973c68fc8763
- services:
- resources:
- - resourceName: vProbes
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 600
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml
deleted file mode 100644
index 7feaecf7e..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vSCP_F5_1610.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-controlLoop:
- version: 1.0.0
- controlLoopName: ClosedLoop-FRWL-SIG-d925ed73-8231-4d02-9545-db4e101f88f8
- services:
- - serviceName: vSCP
- - serviceName: trinity
- resources:
- - resourceName: F5FW
- resourceType: VF
- trigger_policy: unique-policy-id-1-restart
- timeout: 1200
-
-policies:
- - id: unique-policy-id-1-restart
- name: Restart Policy
- description:
- actor: APPC
- recipe: Restart
- target: VM
- retry: 2
- timeout: 300
- success: final_success
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
diff --git a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vUSP_1610.yaml b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vService.yaml
index aebde931e..aebde931e 100644
--- a/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vUSP_1610.yaml
+++ b/controlloop/common/policy-yaml/src/test/resources/v1.0.0/policy_vService.yaml
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_blacklist.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_blacklist.yaml
new file mode 100644
index 000000000..d413313e7
--- /dev/null
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0-guard/policy_guard_blacklist.yaml
@@ -0,0 +1,17 @@
+guard:
+ version: 2.0.0
+
+guards:
+ - id: unique_guard_vService_blacklist
+ name: APPC Restart Blacklist
+ description: |
+ We deny restart of the blacklisted targets (avoid midnight to 5am)
+ actor: APPC
+ recipe: Restart
+ limit_constraints:
+ - blacklist:
+ - TargetName1
+ - TargetName2
+ time_in_range:
+ arg2: 00:00:00-05:00
+ arg3: 23:59:59-05:00 \ No newline at end of file
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vDNS.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vDNS.yaml
index 5deb8f7ff..5deb8f7ff 100644
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vDNS.yaml
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vDNS.yaml
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vFirewall.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml
index 51597714c..51597714c 100644
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_OpenECOMP_demo_vFirewall.yaml
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_ONAP_demo_vFirewall.yaml
diff --git a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml
deleted file mode 100644
index 9f41f46d9..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_ALU_1707.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-controlLoop:
- version: 2.0.0
- controlLoopName: ControlLoop-eNodeB-ALU-3ee91181-6f05-4cd3-8437-cad5f58653ca
- services:
- resources:
- pnf:
- PNFName: eNodeB.ALU
- trigger_policy: unique-policy-id-1-check-aots
- timeout: 2400
-
-policies:
- - id: unique-policy-id-1-check-aots
- name: Check AOTS CTS
- description: Discard sleeping cell based on the new signature if it appears in recent CTS tickets
- actor: AOTS
- recipe: checkENodeBTicketHours
- payload:
- timeWindow: 5
- retry: 2
- timeout: 300
- success: unique-policy-id-2-check-aots-cts
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-2-check-aots-cts
- name: Check AOTS CTS Equipment
- description: Discard sleeping cell based on the new signature if it is not active in CTS equipment data
- actor: AOTS
- recipe: checkEquipmentStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-eim
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-3-check-aots-eim
- name: Check AOTS EIM_RT
- description: Discard sleeping cell based on the new signature if it appears in EIM_RT data
- actor: AOTS
- recipe: checkEimStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-4-sdnr-reset
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-4-sdnr-reset
- name: Have SDNR Reset
- description: SDNR should now reset this sleeper
- actor: SDNR
- recipe: Reset
- operationsAccumulateParams:
- period: 15m
- limit: 5
- retry: 2
- 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/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml
deleted file mode 100644
index 9eff3439d..000000000
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_eNodeB_Ericsson_1707.yaml
+++ /dev/null
@@ -1,86 +0,0 @@
-controlLoop:
- version: 2.0.0
- controlLoopName: ControlLoop-eNodeB-Ericsson-0732e76a-4228-42d1-8185-972510be388c
- services:
- resources:
- pnf:
- PNFName: eNodeB.Ericsson
- trigger_policy: unique-policy-id-1-check-aots-ticket
- timeout: 2400
-
-policies:
- - id: unique-policy-id-1-check-aots-ticket
- name: Check AOTS CTS
- description: Discard sleeping cell based on the new signature if it appears in recent CTS tickets
- actor: AOTS
- recipe: checkENodeBTicketHours
- payload:
- timeWindow: 5
- retry: 2
- timeout: 300
- success: unique-policy-id-2-check-aots-cts
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-2-check-aots-cts
- name: Check AOTS CTS Equipment
- description: Discard sleeping cell based on the new signature if it is not active in CTS equipment data
- actor: AOTS
- recipe: checkEquipmentStatus
- payload:
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-eim
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-3-check-aots-eim
- name: Check AOTS EIM_RT
- description: Discard sleeping cell based on the new signature if it appears in EIM_RT data
- actor: AOTS
- recipe: checkEimStatus
- retry: 2
- timeout: 300
- success: unique-policy-id-3-check-aots-maintenance
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-4-check-aots-maintenance
- name: Check AOTS MAINTENANCE
- description: Discard sleeping cell based on the new signature if it appears in Maintenance
- actor: AOTS
- recipe: checkMaintenanceWindow
- retry: 2
- timeout: 300
- success: unique-policy-id-5-sdnr-reset
- failure: final_failure
- failure_timeout: final_failure_timeout
- failure_retries: final_failure_retries
- failure_exception: final_failure_exception
- failure_guard: final_failure_guard
-
- - id: unique-policy-id-5-sdnr-reset
- name: Have SDNR Reset
- description: SDNR should now reset this sleeper
- actor: SDNR
- recipe: Reset
- operationsAccumulateParams:
- period: 15m
- limit: 5
- retry: 2
- 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/common/policy-yaml/src/test/resources/v2.0.0/policy_vUSP_1707.yaml b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_vService.yaml
index b1b03f4ee..b1b03f4ee 100644
--- a/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_vUSP_1707.yaml
+++ b/controlloop/common/policy-yaml/src/test/resources/v2.0.0/policy_vService.yaml