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());
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;
}
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
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;
}