From e82e4dfcc6ba261cd8b0129e9d8a62642a54549b Mon Sep 17 00:00:00 2001 From: Rashmi Pujar Date: Thu, 17 Oct 2019 11:43:02 -0400 Subject: Remove the CDS blueprint name and version from its payload. This information is redundant since it is included in the request header. Found during integration testing Issue-ID: POLICY-2089 Signed-off-by: Rashmi Pujar Change-Id: Icdb4753ccae687f85318f5efeed09d5e13a6853b --- .../policy/controlloop/actor/cds/CdsActorServiceProvider.java | 9 +++++++-- .../policy/controlloop/actor/cds/beans/CdsActionRequest.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'models-interactions/model-actors/actor.cds/src/main') diff --git a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceProvider.java b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceProvider.java index 272b4e1c3..5501f8618 100644 --- a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceProvider.java +++ b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/CdsActorServiceProvider.java @@ -111,11 +111,16 @@ public class CdsActorServiceProvider implements Actor { } String cbaName = payload.get(CdsActorConstants.KEY_CBA_NAME); String cbaVersion = payload.get(CdsActorConstants.KEY_CBA_VERSION); - String cbaActionName = policy.getRecipe(); + + // Retain only the payload by removing CBA name and version once they are extracted + // to be put in CDS request header. + payload.remove(CdsActorConstants.KEY_CBA_NAME); + payload.remove(CdsActorConstants.KEY_CBA_VERSION); // Embed payload from policy to ConfigDeployRequest object, serialize and inject into grpc request. + String cbaActionName = policy.getRecipe(); CdsActionRequest request = new CdsActionRequest(); - request.setConfigDeployProperties(payload); + request.setPolicyPayload(payload); request.setActionName(cbaActionName); request.setResolutionKey(UUID.randomUUID().toString()); diff --git a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/beans/CdsActionRequest.java b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/beans/CdsActionRequest.java index 45fbbca65..32f102382 100644 --- a/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/beans/CdsActionRequest.java +++ b/models-interactions/model-actors/actor.cds/src/main/java/org/onap/policy/controlloop/actor/cds/beans/CdsActionRequest.java @@ -39,7 +39,7 @@ public class CdsActionRequest implements Serializable { private static final Coder CODER = new StandardCoder(); @SerializedName("policy-payload") - private Map configDeployProperties; + private Map policyPayload; @SerializedName("aai-properties") private Map aaiProperties; -- cgit 1.2.3-korg