aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-04-11 18:02:53 +0200
committersebdet <sebastien.determe@intl.att.com>2019-04-11 18:02:53 +0200
commit03644961f67a8531245ddede5902af1a7d6a5d2c (patch)
treeb6a3dc9465cda2f50cc5f24c4db8b82a404a4142
parent1efe60f3c5c2160b0cb107cba90284161cc5235d (diff)
Fix PolicyID for DCAE
Replace PolicyID by the real microservice policy name as it's known in the csar installer code Issue-ID: CLAMP-304 Change-Id: Ifbd1796cb52b6271218fe63927af32ec392ed81a Signed-off-by: sebdet <sebastien.determe@intl.att.com>
-rw-r--r--src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
index 9bb9e01e7..f407aa944 100644
--- a/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
+++ b/src/main/java/org/onap/clamp/loop/CsarInstallerImpl.java
@@ -139,7 +139,7 @@ public class CsarInstallerImpl implements CsarInstaller {
newLoop.setOperationalPolicies(createOperationalPolicies(csar, blueprintArtifact, newLoop));
newLoop.setSvgRepresentation(svgFacade.getSvgImage(microServicesChain));
- newLoop.setGlobalPropertiesJson(createGlobalPropertiesJson(blueprintArtifact));
+ newLoop.setGlobalPropertiesJson(createGlobalPropertiesJson(blueprintArtifact, newLoop));
newLoop.setModelPropertiesJson(createModelPropertiesJson(csar));
DcaeInventoryResponse dcaeResponse = queryDcaeToGetServiceTypeId(blueprintArtifact);
newLoop.setDcaeBlueprintId(dcaeResponse.getTypeId());
@@ -173,9 +173,9 @@ public class CsarInstallerImpl implements CsarInstaller {
return newSet;
}
- private JsonObject createGlobalPropertiesJson(BlueprintArtifact blueprintArtifact) {
+ private JsonObject createGlobalPropertiesJson(BlueprintArtifact blueprintArtifact, Loop newLoop) {
JsonObject globalProperties = new JsonObject();
- globalProperties.add("dcaeDeployParameters", getAllBlueprintParametersInJson(blueprintArtifact));
+ globalProperties.add("dcaeDeployParameters", getAllBlueprintParametersInJson(blueprintArtifact, newLoop));
return globalProperties;
}
@@ -198,7 +198,7 @@ public class CsarInstallerImpl implements CsarInstaller {
return modelProperties;
}
- private JsonObject getAllBlueprintParametersInJson(BlueprintArtifact blueprintArtifact) {
+ private JsonObject getAllBlueprintParametersInJson(BlueprintArtifact blueprintArtifact, Loop newLoop) {
JsonObject node = new JsonObject();
Yaml yaml = new Yaml();
Map<String, Object> inputsNodes = ((Map<String, Object>) ((Map<String, Object>) yaml
@@ -211,7 +211,8 @@ public class CsarInstallerImpl implements CsarInstaller {
node.addProperty(elem.getKey(), "");
}
});
- node.addProperty("policy_id", "AUTO_GENERATED_POLICY_ID_AT_SUBMIT");
+ // For Dublin only one micro service is expected
+ node.addProperty("policy_id", ((MicroServicePolicy) newLoop.getMicroServicePolicies().toArray()[0]).getName());
return node;
}