Skip to content

Commit

Permalink
CB-22064 FreeIPA Service API must be able to get AZ configuration and…
Browse files Browse the repository at this point in the history
… should expose it

FreeIPA Service API must be able to get AZ configuration and should expose it
  • Loading branch information
adarshsharma1983 authored and keyki committed Jul 9, 2023
1 parent f38380d commit 69b6347
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public class DescribeFreeIpaResponse {
@ApiModelProperty(value = FreeIpaModelDescriptions.USERSYNC_STATUS_DETAILS)
private UserSyncStatusResponse userSyncStatus;

@ApiModelProperty(value = FreeIpaModelDescriptions.MULTIAZ)
private boolean multiAz;

public String getEnvironmentCrn() {
return environmentCrn;
}
Expand Down Expand Up @@ -264,6 +267,14 @@ public void setRecipes(Set<String> recipes) {
this.recipes = recipes;
}

public boolean isMultiAz() {
return multiAz;
}

public void setMultiAz(boolean multiAz) {
this.multiAz = multiAz;
}

@Override
public String toString() {
return "DescribeFreeIpaResponse{" +
Expand All @@ -287,6 +298,7 @@ public String toString() {
", cloudStorage=" + cloudStorage +
", userSyncStatus=" + userSyncStatus +
", recipes=" + recipes +
", multiAz=" + multiAz +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public DescribeFreeIpaResponse convert(Stack stack, ImageEntity image, FreeIpa f
describeFreeIpaResponse.setStatus(stack.getStackStatus().getStatus());
describeFreeIpaResponse.setStatusString(stack.getStackStatus().getStatusString());
describeFreeIpaResponse.setStatusReason(stack.getStackStatus().getStatusReason());
describeFreeIpaResponse.setMultiAz(stack.isMultiAz());
decorateFreeIpaServerResponseWithIps(describeFreeIpaResponse.getFreeIpa(), describeFreeIpaResponse.getInstanceGroups());
decorateFreeIpaServerResponseWithLoadBalancedHost(stack, describeFreeIpaResponse.getFreeIpa(), freeIpa);
describeFreeIpaResponse.setAppVersion(stack.getAppVersion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ void convertTest(Tunnel tunnel) {
.returns(VARIANT, DescribeFreeIpaResponse::getVariant)
// TODO decorateWithCloudStorageAndTelemetry
.returns(USERSYNC_STATUS_RESPONSE, DescribeFreeIpaResponse::getUserSyncStatus)
.returns(tunnel, DescribeFreeIpaResponse::getTunnel);
.returns(tunnel, DescribeFreeIpaResponse::getTunnel)
.returns(true, DescribeFreeIpaResponse::isMultiAz);

assertThat(result.getRecipes()).containsExactlyInAnyOrder("recipe1", "recipe2");
assertThat(freeIpaServerResponse)
Expand All @@ -185,6 +186,7 @@ private Stack createStack(Tunnel tunnel) {
stack.setPlatformvariant(VARIANT);
stack.setGatewayport(GATEWAY_PORT);
stack.setTunnel(tunnel);
stack.setMultiAz(true);
return stack;
}

Expand Down

0 comments on commit 69b6347

Please sign in to comment.