use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData in project cloudbreak by hortonworks.
the class VmStatusCheckerConclusionStep method check.
@Override
public Conclusion check(Long resourceId) {
Stack stack = stackService.getById(resourceId);
ClusterApi connector = clusterApiConnectors.getConnector(stack);
Set<InstanceMetaData> runningInstances = instanceMetaDataService.findNotTerminatedAndNotZombieForStack(stack.getId());
if (isClusterManagerRunning(stack, connector)) {
return checkCMForInstanceStatuses(connector, runningInstances, stack.getCluster().getId());
} else {
return checkProviderForInstanceStatuses(stack, runningInstances);
}
}
use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData in project cloudbreak by hortonworks.
the class LoadBalancerToLoadBalancerResponseConverterTest method ceateInstanceMetadata.
private List<InstanceMetaData> ceateInstanceMetadata() {
InstanceMetaData instanceMetaData = new InstanceMetaData();
instanceMetaData.setInstanceId(INSTANCE_ID);
return List.of(instanceMetaData);
}
use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData in project cloudbreak by hortonworks.
the class VmStatusCheckerConclusionStepTest method checkShouldHandleMissingFqdns.
@Test
public void checkShouldHandleMissingFqdns() {
when(clusterStatusService.isClusterManagerRunningQuickCheck()).thenReturn(Boolean.FALSE);
InstanceMetaData instanceMetaData = new InstanceMetaData();
instanceMetaData.setInstanceId("1");
when(instanceMetaDataService.findNotTerminatedAndNotZombieForStack(anyLong())).thenReturn(Set.of(instanceMetaData));
when(stackInstanceStatusChecker.queryInstanceStatuses(any(), anyList())).thenReturn(List.of(createCloudVmInstanceStatus("1", false)));
Conclusion conclusion = underTest.check(1L);
assertFalse(conclusion.isFailureFound());
assertNull(conclusion.getConclusion());
assertNull(conclusion.getDetails());
assertEquals(VmStatusCheckerConclusionStep.class, conclusion.getConclusionStepClass());
}
use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData in project cloudbreak by hortonworks.
the class InstanceMetaDataToCloudInstanceConverterTest method testConvertWhenParamsFromInstanceMetaDataOnly.
@Test
public void testConvertWhenParamsFromInstanceMetaDataOnly() {
InstanceMetaData source = getSource();
addParamsToInstanceMetaData(source);
initStackToCloudStackConverter(false);
CloudInstance cloudInstance = underTest.convert(source, environment, new StackAuthentication());
verifyParams(cloudInstance, SUBNET_ID_2, INSTANCE_NAME_2, AVAILABILITY_ZONE_2);
assertEquals(source.getInstanceId(), cloudInstance.getInstanceId());
}
use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData in project cloudbreak by hortonworks.
the class InstanceMetaDataToCloudInstanceConverterTest method testConvertWhenParamsFromInstanceMetaDataAreOverriddenByCloudInstance.
@Test
public void testConvertWhenParamsFromInstanceMetaDataAreOverriddenByCloudInstance() {
InstanceMetaData source = getSource();
addParamsToInstanceMetaData(source);
initStackToCloudStackConverter(true);
CloudInstance cloudInstance = underTest.convert(source, environment, new StackAuthentication());
verifyParams(cloudInstance, SUBNET_ID, INSTANCE_NAME, AVAILABILITY_ZONE);
assertEquals(source.getInstanceId(), cloudInstance.getInstanceId());
}
Aggregations