use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class UserService method createTenantDefaultWorkspace.
private void createTenantDefaultWorkspace(Tenant tenant) {
Workspace workspace = new Workspace();
workspace.setTenant(tenant);
workspace.setName(tenant.getName());
workspace.setStatus(WorkspaceStatus.ACTIVE);
workspaceService.create(workspace);
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class TestUtil method workspace.
public static Workspace workspace(Long id, String name) {
Workspace workspace = new Workspace();
workspace.setStatus(WorkspaceStatus.ACTIVE);
workspace.setName(name);
workspace.setId(id);
return workspace;
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class TestUtil method stack.
public static Stack stack(Status stackStatus, Credential credential) {
User user = new User();
user.setUserId("horton@hortonworks.com");
user.setUserCrn("testCrn");
user.setUserName("Alma ur");
Workspace workspace = new Workspace();
workspace.setId(1L);
Tenant tenant = new Tenant();
tenant.setName("testtenant");
workspace.setTenant(tenant);
Stack stack = new Stack();
stack.setCreator(user);
stack.setWorkspace(workspace);
stack.setStackStatus(new StackStatus(stack, stackStatus, "statusReason", DetailedStackStatus.UNKNOWN));
stack.setName("simplestack");
stack.setId(1L);
stack.setInstanceGroups(generateGcpInstanceGroups(3));
stack.setRegion("region");
stack.setCreated(123L);
stack.setCloudPlatform(credential.cloudPlatform());
stack.setOrchestrator(orchestrator());
stack.setEnvironmentCrn("envCrn");
stack.setResourceCrn("crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
switch(credential.cloudPlatform()) {
case AWS:
stack.setInstanceGroups(generateAwsInstanceGroups(3));
break;
case GCP:
stack.setInstanceGroups(generateGcpInstanceGroups(3));
break;
default:
break;
}
stack.setSecurityConfig(new SecurityConfig());
return stack;
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class TestUtil method recipes.
public static Set<Recipe> recipes(int count) {
Set<Recipe> recipes = new HashSet<>();
for (int i = 0; i < count; i++) {
Recipe recipe = new Recipe();
recipe.setDescription("description");
recipe.setId((long) (i + 1));
recipe.setName("recipe-" + (i + 1));
recipe.setContent("base64Content");
recipe.setRecipeType(RecipeType.POST_CLUSTER_INSTALL);
Workspace workspace = new Workspace();
workspace.setId(1L);
workspace.setName("Top Secret FBI");
recipe.setWorkspace(workspace);
recipe.setCreator("someCreator");
recipe.setResourceCrn("someCrn");
recipes.add(recipe);
}
return recipes;
}
use of com.sequenceiq.cloudbreak.workspace.model.Workspace in project cloudbreak by hortonworks.
the class TestUtil method cluster.
public static Cluster cluster(Blueprint blueprint, Stack stack, Long id) {
Cluster cluster = new Cluster();
cluster.setClusterManagerIp("50.51.52.100");
cluster.setStack(stack);
cluster.setId(id);
cluster.setName("dummyCluster");
cluster.setClusterManagerIp("10.0.0.1");
cluster.setBlueprint(blueprint);
cluster.setUpSince(new Date().getTime());
cluster.setUserName("admin");
cluster.setPassword("admin");
Gateway gateway = new Gateway();
setGatewayTopology(gateway, "cb");
cluster.setGateway(gateway);
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setId(generateUniqueId());
Set<RDSConfig> rdsConfigs = new HashSet<>();
rdsConfigs.add(rdsConfig);
cluster.setRdsConfigs(rdsConfigs);
cluster.setHostGroups(hostGroups(cluster));
cluster.setConfigStrategy(ConfigStrategy.ALWAYS_APPLY_DONT_OVERRIDE_CUSTOM_VALUES);
Map<String, String> map = new HashMap<>();
try {
cluster.setAttributes(new Json(map).getValue());
} catch (IllegalArgumentException ignored) {
}
Workspace workspace = new Workspace();
workspace.setName("org 1");
workspace.setId(1L);
cluster.setWorkspace(workspace);
cluster.setDatabaseServerCrn("databaseCRN");
return cluster;
}
Aggregations