Commit 2f5885b5 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'automate-byon' into 'morphemic-rc2.0'

automate byon

See merge request !128
parents ee321959 0ec28dd0
Pipeline #19849 passed with stages
in 91 minutes and 35 seconds
......@@ -117,7 +117,7 @@
<dependency>
<groupId>cloud.morphemic.connectors</groupId>
<artifactId>proactive_client</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.3-SNAPSHOT</version>
</dependency>
</dependencies>
......
......@@ -17,7 +17,7 @@ public interface ProactiveClientServiceGUI extends IProactiveClientServiceConnec
List<Location> getAllLocation();
ByonNode registerNewByonNode(ByonDefinition byonNodeDefinition, String jobId);
ByonNode registerNewByonNode(ByonDefinition byonNodeDefinition, String jobId, boolean automate);
List<ByonNode> getByonNodeList(String jobId);
......
......@@ -41,8 +41,8 @@ public class ProactiveClientServiceGUIImpl extends ProactiveClientServiceConnect
}
@Override
public ByonNode registerNewByonNode(ByonDefinition byonNodeDefinition, String jobId) {
return getPAGateway().map(paGateway -> paGateway.registerNewByonNode(byonNodeDefinition, jobId)).orElse(null);
public ByonNode registerNewByonNode(ByonDefinition byonNodeDefinition, String jobId, boolean automate) {
return getPAGateway().map(paGateway -> paGateway.registerNewByonNode(byonNodeDefinition, jobId, automate)).orElse(null);
}
@Override
......
......@@ -66,9 +66,10 @@ public class ByonController {
@PostMapping("/proactive/{byonDefinitionId}")
@ResponseStatus(HttpStatus.CREATED)
public eu.passage.upperware.commons.model.byon.ByonNode createByonNode(@PathVariable(value = "byonDefinitionId") int byonDefinitionId, @RequestParam(value = "applicationId") String applicationId) {
public eu.passage.upperware.commons.model.byon.ByonNode createByonNode(@PathVariable(value = "byonDefinitionId") int byonDefinitionId, @RequestParam(value = "applicationId") String applicationId,
@RequestParam(value = "automate") boolean automate) {
log.info("POST request for creating new byon node from byon definition with id {} and for application id {}", byonDefinitionId, applicationId);
final eu.passage.upperware.commons.model.byon.ByonNode byonNode = byonService.createByonNode(byonDefinitionId, applicationId);
final eu.passage.upperware.commons.model.byon.ByonNode byonNode = byonService.createByonNode(byonDefinitionId, applicationId, automate);
log.info("Byon node with id {} successfully added to Proactive", byonNode.getId());
return byonNode;
}
......
......@@ -129,7 +129,7 @@ public class ByonService {
}
}
public ByonNode createByonNode(int byonDefinitionId, String applicationId) {
public ByonNode createByonNode(int byonDefinitionId, String applicationId, boolean automate) {
ByonDefinition byonDefinitionForNode = getByonDefList(true).orElseGet(ArrayList::new)
.stream()
.filter(byonDefinition -> byonDefinition.getId() == byonDefinitionId)
......@@ -137,7 +137,7 @@ public class ByonService {
.orElseThrow(() -> new ByonDefinitionNotFoundException(byonDefinitionId));
final org.activeeon.morphemic.model.ByonDefinition byonDefinitionProactive = byonMapper.mapByonDefinitionToProactive(byonDefinitionForNode);
log.info("LSZ DEV[ByonService]: createByonNode: byonDefinitionProactive={}", byonDefinitionProactive);
final Optional<org.activeeon.morphemic.model.ByonNode> byonNodeProactive = Optional.ofNullable(proactiveClientServiceGUI.registerNewByonNode(byonDefinitionProactive, applicationId));
final Optional<org.activeeon.morphemic.model.ByonNode> byonNodeProactive = Optional.ofNullable(proactiveClientServiceGUI.registerNewByonNode(byonDefinitionProactive, applicationId, automate));
log.info("LSZ DEV[ByonService]: createByonNode: byonNodeProactive={}", byonNodeProactive);
ByonNode byonNode = null;
if(byonNodeProactive.isPresent()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment