use of com.sequenceiq.mock.swagger.model.ApiServiceState in project cloudbreak by hortonworks.
the class ClusterResourceOperation method stopCommand.
public ResponseEntity<ApiCommand> stopCommand(String mockUuid, String clusterName) {
ClouderaManagerDto read = clouderaManagerStoreService.read(mockUuid);
Map<String, ApiServiceState> newStates = new HashMap<>();
read.getServiceStates().forEach((service, apiServiceState) -> newStates.put(service, ApiServiceState.STOPPED));
read.setServiceStates(newStates);
read.setStatus(ApiServiceState.STOPPED);
return responseCreatorComponent.exec(new ApiCommand().id(CommandId.CLUSTER_STOP).active(Boolean.TRUE).name("Stop"));
}
use of com.sequenceiq.mock.swagger.model.ApiServiceState in project cloudbreak by hortonworks.
the class ClusterResourceOperation method startCommand.
public ResponseEntity<ApiCommand> startCommand(String mockUuid, String clusterName) {
ClouderaManagerDto read = clouderaManagerStoreService.read(mockUuid);
Map<String, ApiServiceState> newStates = new HashMap<>();
read.getServiceStates().forEach((service, apiServiceState) -> newStates.put(service, ApiServiceState.STARTED));
read.setServiceStates(newStates);
read.setStatus(ApiServiceState.STARTED);
return responseCreatorComponent.exec(new ApiCommand().id(CommandId.CLUSTER_START).active(Boolean.TRUE).name("Start"));
}
Aggregations