Search in sources :

Example 61 with DescribeFreeIpaResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse in project cloudbreak by hortonworks.

the class FreeIpaScalingTests method getInstanceMetaDataResponses.

private Set<InstanceMetaDataResponse> getInstanceMetaDataResponses(String environmentCrn, FreeIpaClient client) {
    DescribeFreeIpaResponse describeFreeIpaResponse = client.getDefaultClient().getFreeIpaV1Endpoint().describe(environmentCrn);
    Set<InstanceMetaDataResponse> instanceMetaDataResponses = describeFreeIpaResponse.getInstanceGroups().stream().map(InstanceGroupResponse::getMetaData).flatMap(Set::stream).collect(Collectors.toSet());
    return instanceMetaDataResponses;
}
Also used : DescribeFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse) InstanceMetaDataResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceMetaDataResponse) InstanceGroupResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceGroupResponse)

Example 62 with DescribeFreeIpaResponse

use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse in project cloudbreak by hortonworks.

the class StackToDescribeFreeIpaResponseConverter method convert.

public DescribeFreeIpaResponse convert(Stack stack, ImageEntity image, FreeIpa freeIpa, UserSyncStatus userSyncStatus, Boolean includeAllInstances) {
    DescribeFreeIpaResponse describeFreeIpaResponse = new DescribeFreeIpaResponse();
    describeFreeIpaResponse.setName(stack.getName());
    describeFreeIpaResponse.setEnvironmentCrn(stack.getEnvironmentCrn());
    describeFreeIpaResponse.setCrn(stack.getResourceCrn());
    describeFreeIpaResponse.setCloudPlatform(stack.getCloudPlatform());
    describeFreeIpaResponse.setVariant(stack.getPlatformvariant());
    describeFreeIpaResponse.setAuthentication(authenticationResponseConverter.convert(stack.getStackAuthentication()));
    Optional.ofNullable(image).ifPresent(i -> describeFreeIpaResponse.setImage(imageSettingsResponseConverter.convert(i)));
    Optional.ofNullable(freeIpa).ifPresent(f -> describeFreeIpaResponse.setFreeIpa(freeIpaServerResponseConverter.convert(f)));
    describeFreeIpaResponse.setNetwork(networkResponseConverter.convert(stack));
    describeFreeIpaResponse.setPlacement(convertToPlacementResponse(stack));
    describeFreeIpaResponse.setTunnel(stack.getTunnel());
    describeFreeIpaResponse.setInstanceGroups(instanceGroupConverter.convert(stack.getInstanceGroups(), includeAllInstances));
    describeFreeIpaResponse.setAvailabilityStatus(stackToAvailabilityStatusConverter.convert(stack));
    describeFreeIpaResponse.setStatus(stack.getStackStatus().getStatus());
    describeFreeIpaResponse.setStatusString(stack.getStackStatus().getStatusString());
    describeFreeIpaResponse.setStatusReason(stack.getStackStatus().getStatusReason());
    decorateFreeIpaServerResponseWithIps(describeFreeIpaResponse.getFreeIpa(), describeFreeIpaResponse.getInstanceGroups());
    decorateFreeIpaServerResponseWithLoadBalancedHost(stack, describeFreeIpaResponse.getFreeIpa(), freeIpa);
    describeFreeIpaResponse.setAppVersion(stack.getAppVersion());
    decorateWithCloudStorageAndTelemetry(stack, describeFreeIpaResponse);
    Optional.ofNullable(userSyncStatus).ifPresent(u -> describeFreeIpaResponse.setUserSyncStatus(userSyncStatusConverter.convert(u)));
    return describeFreeIpaResponse;
}
Also used : DescribeFreeIpaResponse(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse)

Aggregations

DescribeFreeIpaResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse)60 Test (org.junit.jupiter.api.Test)32 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)17 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)8 EnumSource (org.junit.jupiter.params.provider.EnumSource)8 DistroXV1Request (com.sequenceiq.distrox.api.v1.distrox.model.DistroXV1Request)7 InstanceGroupResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceGroupResponse)7 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)6 AttemptResults (com.dyngr.core.AttemptResults)5 Stack (com.sequenceiq.freeipa.entity.Stack)5 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)4 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)3 EnvironmentDeletionDto (com.sequenceiq.environment.environment.dto.EnvironmentDeletionDto)3 FreeIpaOperationFailedException (com.sequenceiq.environment.exception.FreeIpaOperationFailedException)3 BaseNamedFlowEvent (com.sequenceiq.flow.reactor.api.event.BaseNamedFlowEvent)3 InstanceMetaDataResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceMetaDataResponse)3 CreateFreeIpaRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.create.CreateFreeIpaRequest)3 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)3 ImageEntity (com.sequenceiq.freeipa.entity.ImageEntity)3 Environment (com.sequenceiq.environment.environment.domain.Environment)2