aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/domains
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-02-20 18:19:36 -0600
committerjhh <jorge.hernandez-herrero@att.com>2020-02-21 12:01:01 -0600
commit43c1e8c7c820bc8004725355a4a5eb0ad519e680 (patch)
tree01efdd23c6fa7395c07e6786c103d41c83cf2ac5 /controlloop/common/domains
parent5cdc0da265e1488321f88c38d9e0fb9d3626f54d (diff)
Tosca compliant vFirewall
Issue-ID: POLICY-2376 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I362ebbd941c400a6ffc3e952e66ca2d624afbfdd Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'controlloop/common/domains')
-rw-r--r--controlloop/common/domains/src/main/java/org/onap/policy/drools/models/domain/operational/OperationalTarget.java11
-rw-r--r--controlloop/common/domains/src/main/resources/schemas/onap.policies.controlloop.operational.common.Drools-1.0.0.schema.json22
-rw-r--r--controlloop/common/domains/src/test/java/org/onap/policy/drools/models/domain/operational/OperationalPolicyTest.java4
3 files changed, 21 insertions, 16 deletions
diff --git a/controlloop/common/domains/src/main/java/org/onap/policy/drools/models/domain/operational/OperationalTarget.java b/controlloop/common/domains/src/main/java/org/onap/policy/drools/models/domain/operational/OperationalTarget.java
index 9e570ba7d..66ae337d6 100644
--- a/controlloop/common/domains/src/main/java/org/onap/policy/drools/models/domain/operational/OperationalTarget.java
+++ b/controlloop/common/domains/src/main/java/org/onap/policy/drools/models/domain/operational/OperationalTarget.java
@@ -20,8 +20,9 @@
package org.onap.policy.drools.models.domain.operational;
-import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
import lombok.Builder;
import lombok.Data;
@@ -38,11 +39,11 @@ public class OperationalTarget implements Serializable {
/**
* Target Type.
*/
- private String type;
+ private String targetType;
/**
- * Resource ID.
+ * Payload.
*/
- @SerializedName("resourceID")
- private String resourceId;
+ @Builder.Default
+ private Map<String, String> entityIds = new HashMap<>();
}
diff --git a/controlloop/common/domains/src/main/resources/schemas/onap.policies.controlloop.operational.common.Drools-1.0.0.schema.json b/controlloop/common/domains/src/main/resources/schemas/onap.policies.controlloop.operational.common.Drools-1.0.0.schema.json
index e3569f122..5d032f066 100644
--- a/controlloop/common/domains/src/main/resources/schemas/onap.policies.controlloop.operational.common.Drools-1.0.0.schema.json
+++ b/controlloop/common/domains/src/main/resources/schemas/onap.policies.controlloop.operational.common.Drools-1.0.0.schema.json
@@ -190,11 +190,11 @@
"type": "object",
"title": "Target",
"required": [
- "type"
+ "targetType"
],
"properties": {
- "type": {
- "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/type",
+ "targetType": {
+ "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/targetType",
"type": "string",
"title": "Target Type",
"examples": [
@@ -202,14 +202,17 @@
],
"pattern": "^(.+)$"
},
- "resourceID": {
- "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/resourceID",
- "type": "string",
- "title": "Resource ID",
+ "entityIds": {
+ "$id": "#/properties/properties/properties/operations/items/properties/operation/properties/target/properties/entityIds",
+ "type": "object",
+ "title": "Arbitrary Resource Identities",
"examples": [
"Eace933104d443b496b8.nodes.heat.vpg"
],
- "pattern": "^(.+)$"
+ "additionalProperties": {
+ "type": "string",
+ "pattern": "^(.+)$"
+ }
}
}
},
@@ -218,7 +221,8 @@
"type": "object",
"title": "Payload",
"additionalProperties": {
- "type": "string"
+ "type": "string",
+ "pattern": "^(.+)$"
}
}
}
diff --git a/controlloop/common/domains/src/test/java/org/onap/policy/drools/models/domain/operational/OperationalPolicyTest.java b/controlloop/common/domains/src/test/java/org/onap/policy/drools/models/domain/operational/OperationalPolicyTest.java
index bab22d9ba..7fc60f2f1 100644
--- a/controlloop/common/domains/src/test/java/org/onap/policy/drools/models/domain/operational/OperationalPolicyTest.java
+++ b/controlloop/common/domains/src/test/java/org/onap/policy/drools/models/domain/operational/OperationalPolicyTest.java
@@ -86,7 +86,7 @@ public class OperationalPolicyTest {
}
@Test
- public void testToscaLegacyOperationalPolicyType() throws CoderException, IOException {
+ public void testToscaLegacyOperationalPolicyType() throws IOException {
String rawVcpeToscaPolicy = getJsonFromFile(VCPE_OPERATIONAL_LEGACY_POLICY_JSON);
// valid "known" policy type with implicit schema
@@ -119,7 +119,7 @@ public class OperationalPolicyTest {
.actorOperation(ActorOperation.builder()
.operation("Restart")
.actor("APPC")
- .target(OperationalTarget.builder().type("VNF").build())
+ .target(OperationalTarget.builder().targetType("VNF").build())
.build())
.build()))
.controllerName("usecases")