use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class StackRuntimeVersionValidatorTest method createSdxClusterResponse.
private List<SdxClusterResponse> createSdxClusterResponse(String version, SdxClusterStatusResponse status) {
SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
sdxClusterResponse.setRuntime(version);
sdxClusterResponse.setStatus(status);
sdxClusterResponse.setName("myDatalake");
return Collections.singletonList(sdxClusterResponse);
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class SdxServiceDecorator method prepareMultipleSdxAttributes.
public void prepareMultipleSdxAttributes(Set<StackViewV4Response> stackViewResponses) {
List<SdxClusterResponse> responses = sdxClientService.list();
for (StackViewV4Response stackViewResponse : stackViewResponses) {
Optional<SdxClusterResponse> first = responses.stream().filter(x -> x.getEnvironmentCrn().equals(stackViewResponse.getEnvironmentCrn())).findFirst();
if (first.isPresent()) {
SdxClusterResponse sdxCluster = first.get();
SharedServiceV4Response sharedServiceResponse = stackViewResponse.getCluster().getSharedServiceResponse();
sharedServiceResponse.setSdxCrn(sdxCluster.getCrn());
sharedServiceResponse.setSdxName(sdxCluster.getName());
} else {
LOGGER.info("No SDX cluster found for stack {}.", stackViewResponse.getCrn());
}
}
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class SdxCreateAction method action.
@Override
public SdxTestDto action(TestContext testContext, SdxTestDto testDto, SdxClient client) throws Exception {
Log.when(LOGGER, " SDX endpoint: %s" + client.getDefaultClient().sdxEndpoint() + ", SDX's environment: " + testDto.getRequest().getEnvironment());
Log.whenJson(LOGGER, " SDX create request: ", testDto.getRequest());
SdxClusterResponse sdxClusterResponse = client.getDefaultClient().sdxEndpoint().create(testDto.getName(), testDto.getRequest());
testDto.setFlow("SDX create", sdxClusterResponse.getFlowIdentifier());
SdxClusterDetailResponse detailedResponse = client.getDefaultClient().sdxEndpoint().getDetailByCrn(sdxClusterResponse.getCrn(), Collections.emptySet());
testDto.setResponse(detailedResponse);
Log.whenJson(LOGGER, " SDX create response: ", client.getDefaultClient().sdxEndpoint().get(testDto.getName()));
return testDto;
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithoutInputs.
@Test
public void testConvertFromEnvAndSdxResponseWithoutInputs() {
// GIVEN
SdxClusterResponse sdxClusterResponse = null;
// WHEN
TelemetryRequest result = underTest.convert(null, sdxClusterResponse);
// THEN
assertNotNull(result.getWorkloadAnalytics());
assertNotNull(result.getFeatures());
assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
assertNull(result.getLogging());
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithoutWAInput.
@Test
public void testConvertFromEnvAndSdxResponseWithoutWAInput() {
// GIVEN
TelemetryResponse response = new TelemetryResponse();
LoggingResponse loggingResponse = new LoggingResponse();
S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
loggingResponse.setS3(s3Params);
response.setLogging(loggingResponse);
SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
sdxClusterResponse.setCrn("crn:cdp:cloudbreak:us-west-1:someone:sdxcluster:sdxId");
sdxClusterResponse.setName("sdxName");
// WHEN
TelemetryRequest result = underTest.convert(response, sdxClusterResponse);
// THEN
assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
assertEquals("sdxId", result.getWorkloadAnalytics().getAttributes().get("databus.header.sdx.id").toString());
assertEquals("sdxName", result.getWorkloadAnalytics().getAttributes().get("databus.header.sdx.name").toString());
}
Aggregations