use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse in project cloudbreak by hortonworks.
the class CloudGatewayssToPlatformGatewaysV1ResponseConverter method convert.
public PlatformGatewaysResponse convert(CloudGateWays source) {
Map<String, Set<CloudGatewayRequest>> result = new HashMap<>();
for (Entry<String, Set<CloudGateWay>> entry : source.getCloudGateWayResponses().entrySet()) {
Set<CloudGatewayRequest> cloudGatewayJsons = new HashSet<>();
for (CloudGateWay gateway : entry.getValue()) {
CloudGatewayRequest actual = new CloudGatewayRequest(gateway.getName(), gateway.getId(), gateway.getProperties());
cloudGatewayJsons.add(actual);
}
result.put(entry.getKey(), cloudGatewayJsons);
}
return new PlatformGatewaysResponse(result);
}
use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getGatewaysCredentialId.
@Override
@CustomPermissionCheck
public PlatformGatewaysResponse getGatewaysCredentialId(String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone) {
customCheckUtil.run(() -> permissionCheckByCredential(credentialName, credentialCrn));
String accountId = getAccountId();
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest(accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone);
LOGGER.info("Get /platform_resources/gateways, request: {}", request);
CloudGateWays gateways = platformParameterService.getGatewaysCredentialId(request);
PlatformGatewaysResponse response = cloudGatewayssToPlatformGatewaysV1ResponseConverter.convert(gateways);
LOGGER.info("Resp /platform_resources/gateways, request: {}, ipPools: {}, response: {}", request, gateways, response);
return response;
}
use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getGatewaysCredentialId.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformGatewaysResponse getGatewaysCredentialId(@ResourceCrn String environmentCrn, String region, String platformVariant, String availabilityZone) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, region, platformVariant, availabilityZone, null);
LOGGER.info("Get /platform_resources/gateways, request: {}", request);
CloudGateWays gateways = platformParameterService.getGatewaysCredentialId(request);
PlatformGatewaysResponse response = cloudGatewayssToPlatformGatewaysV1ResponseConverter.convert(gateways);
LOGGER.info("Resp /platform_resources/gateways, request: {}, ipPools: {}, response: {}", request, gateways, response);
return response;
}
Aggregations