use of com.google.api.services.cloudresourcemanager.v3.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_enablePrivateGoogleAccessAndFlowLog.
@Test
public void testCreateGoogleProject_enablePrivateGoogleAccessAndFlowLog() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().network(new bio.terra.buffer.generated.model.Network().enableNetworkMonitoring(true).enablePrivateGoogleAccess(true)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
assertNetworkExists(project);
assertSubnetsExist(project, NetworkMonitoring.ENABLED);
assertRouteExists(project);
assertDnsExists(project);
assertDefaultVpcNotExists(project);
}
use of com.google.api.services.cloudresourcemanager.v3.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method assertProjectExists.
private Project assertProjectExists(ResourceId resourceId) throws Exception {
Resource resource = bufferDao.retrieveResource(resourceId).get();
Project project = rmCow.projects().get(resource.cloudResourceUid().getGoogleProjectUid().getProjectId()).execute();
assertEquals("ACTIVE", project.getState());
assertThat(project.getLabels().entrySet(), Matchers.hasItems(Map.entry(NETWORK_LABEL_KEY, NETWORK_NAME), Map.entry(SUB_NETWORK_LABEL_KEY, SUBNETWORK_NAME), Map.entry(LEONARDO_ALLOW_HTTPS_FIREWALL_RULE_NAME_LABEL_KEY, LEONARDO_SSL_FOR_VPC_NETWORK_RULE_NAME), Map.entry(LEONARDO_ALLOW_INTERNAL_RULE_NAME_LABEL_KEY, ALLOW_INTERNAL_FOR_VPC_NETWORK_RULE_NAME), Map.entry(CONFIG_NAME_LABEL_KEY, TEST_CONFIG_NAME)));
return project;
}
use of com.google.api.services.cloudresourcemanager.v3.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_keepDefaultComputeEngineServiceAcct.
@Test
public void testCreateGoogleProject_keepDefaultComputeEngineServiceAcct() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig().computeEngine(new ComputeEngine().keepDefaultServiceAcct(true)));
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
assertDefaultServiceAccountExists(project);
}
use of com.google.api.services.cloudresourcemanager.v3.model.Project in project terra-resource-buffer by DataBiosphere.
the class CreateProjectFlightIntegrationTest method testCreateGoogleProject_basicCreation.
@Test
public void testCreateGoogleProject_basicCreation() throws Exception {
FlightManager manager = new FlightManager(bufferDao, flightSubmissionFactoryImpl, stairwayComponent, transactionTemplate);
Pool pool = preparePool(bufferDao, newBasicGcpConfig());
String flightId = manager.submitCreationFlight(pool).get();
ResourceId resourceId = extractResourceIdFromFlightState(blockUntilFlightComplete(stairwayComponent, flightId));
Project project = assertProjectExists(resourceId);
assertBillingIs(project, pool.resourceConfig().getGcpProjectConfig().getBillingAccount());
assertEnableApisContains(project, pool.resourceConfig().getGcpProjectConfig().getEnabledApis());
assertLogStorageBucketExists(project);
assertNetworkExists(project);
assertFirewallRulesExist(project);
assertSubnetsExist(project, NetworkMonitoring.DISABLED);
assertRouteNotExists(project);
assertDnsNotExists(project);
assertDefaultVpcNotExists(project);
assertDefaultServiceAccountNotExists(project);
String logBucketName = "storage-logs-" + project.getProjectId();
assertNotNull(storageCow.get(logBucketName));
}
use of com.google.api.services.cloudresourcemanager.v3.model.Project in project blackduck-common by blackducksoftware.
the class Bdio2Writer method writeBdioDocument.
public void writeBdioDocument(BdioWriter bdioWriter, Project project, List<Project> subProjects, List<Component> components) throws IOException {
bdioWriter.start();
for (Project subProject : subProjects) {
bdioWriter.next(subProject);
}
for (Component component : components) {
bdioWriter.next(component);
}
// We put the project node at the end of the document to be more inline with the way Black Duck produces BDIO 2.
bdioWriter.next(project);
bdioWriter.close();
}
Aggregations