diff options
Diffstat (limited to 'controlloop/common/domains')
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") |