use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class WorkspaceConfigurationFilterTest method createWorkspace.
private Workspace createWorkspace() {
Workspace workspace = new Workspace();
workspace.setId(1L);
return workspace;
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class ClusterDecoratorTest method testAutoTlsSettingByParentEnvironmentCloudPlatform.
@Test
void testAutoTlsSettingByParentEnvironmentCloudPlatform() {
Cluster expectedClusterInstance = new Cluster();
Blueprint blueprint = getBlueprint();
when(sharedServiceConfigProvider.configureCluster(any(Cluster.class), any(User.class), any(Workspace.class))).thenReturn(expectedClusterInstance);
ArgumentCaptor<Platform> platformArgumentCaptor = ArgumentCaptor.forClass(Platform.class);
when(cloudPlatformConnectors.get(platformArgumentCaptor.capture(), any())).thenReturn(connector);
when(embeddedDatabaseService.isEmbeddedDatabaseOnAttachedDiskEnabled(stack, expectedClusterInstance)).thenReturn(false);
String platform = CloudPlatform.YARN.name();
underTest.decorate(expectedClusterInstance, createClusterV4Request(), blueprint, user, new Workspace(), stack, platform);
assertEquals(platform, platformArgumentCaptor.getValue().value());
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class InstanceGroupV4RequestToHostGroupConverter method convert.
public HostGroup convert(InstanceGroupV4Request source) {
HostGroup hostGroup = new HostGroup();
hostGroup.setName(source.getName().toLowerCase());
hostGroup.setRecoveryMode(source.getRecoveryMode());
Set<String> recipeNames = source.getRecipeNames();
if (!CollectionUtils.isEmpty(recipeNames)) {
CloudbreakUser cloudbreakUser = restRequestThreadLocalService.getCloudbreakUser();
User user = userService.getOrCreate(cloudbreakUser);
Workspace workspace = workspaceService.get(restRequestThreadLocalService.getRequestedWorkspaceId(), user);
hostGroup.setRecipes(recipeService.getRecipesByNamesForWorkspace(workspace, recipeNames));
}
return hostGroup;
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class BlueprintService method updateDefaultBlueprintCollection.
public void updateDefaultBlueprintCollection(Long workspaceId) {
User user = getLoggedInUser();
Workspace workspace = getWorkspaceService().get(workspaceId, user);
updateDefaultBlueprintCollection(workspace);
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class BlueprintService method getAllAvailableViewInWorkspaceAndFilterBySdxReady.
public Set<BlueprintView> getAllAvailableViewInWorkspaceAndFilterBySdxReady(Long workspaceId, Boolean withSdx) {
User user = getLoggedInUser();
Workspace workspace = getWorkspaceService().get(workspaceId, user);
updateDefaultBlueprintCollection(workspace);
Set<BlueprintView> allByNotDeletedInWorkspace = blueprintViewRepository.findAllByNotDeletedInWorkspace(workspaceId);
allByNotDeletedInWorkspace = allByNotDeletedInWorkspace.stream().filter(b -> blueprintListFilters.isDistroXDisplayed(b)).collect(Collectors.toSet());
if (withSdx) {
return allByNotDeletedInWorkspace;
}
return allByNotDeletedInWorkspace.stream().filter(it -> !blueprintListFilters.isDatalakeBlueprint(it)).collect(Collectors.toSet());
}
Aggregations