use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getAccessConfigs.
@Override
@CustomPermissionCheck
public PlatformAccessConfigsResponse getAccessConfigs(String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone, AccessConfigTypeQueryParam accessConfigType) {
customCheckUtil.run(() -> permissionCheckByCredential(credentialName, credentialCrn));
String accountId = getAccountId();
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest(accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone, null, accessConfigType);
LOGGER.info("Get /platform_resources/access_configs, request: {}", request);
CloudAccessConfigs accessConfigs = platformParameterService.getAccessConfigs(request);
PlatformAccessConfigsResponse response = cloudAccessConfigsToPlatformAccessConfigsV1ResponseConverter.convert(accessConfigs);
LOGGER.info("Resp /platform_resources/access_configs, request: {}, accessConfigs: {}, response: {}", request, accessConfigs, response);
return response;
}
use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getAccessConfigs.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformAccessConfigsResponse getAccessConfigs(@ResourceCrn String environmentCrn, String region, String platformVariant, String availabilityZone, AccessConfigTypeQueryParam accessConfigType) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, region, platformVariant, availabilityZone, null, accessConfigType);
LOGGER.info("Get /platform_resources/access_configs, request: {}", request);
CloudAccessConfigs accessConfigs = platformParameterService.getAccessConfigs(request);
PlatformAccessConfigsResponse response = cloudAccessConfigsToPlatformAccessConfigsV1ResponseConverter.convert(accessConfigs);
LOGGER.info("Resp /platform_resources/access_configs, request: {}, accessConfigs: {}, response: {}", request, accessConfigs, response);
return response;
}
use of com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse in project cloudbreak by hortonworks.
the class CloudAccessConfigsToPlatformAccessConfigsV1ResponseConverter method convert.
public PlatformAccessConfigsResponse convert(CloudAccessConfigs source) {
PlatformAccessConfigsResponse platformAccessConfigsResponse = new PlatformAccessConfigsResponse();
List<AccessConfigResponse> result = new ArrayList<>();
for (CloudAccessConfig entry : source.getCloudAccessConfigs()) {
AccessConfigResponse actual = new AccessConfigResponse(entry.getName(), entry.getId(), entry.getProperties());
result.add(actual);
}
result.sort(new AccessConfigResponseComparator());
platformAccessConfigsResponse.setAccessConfigs(result);
return platformAccessConfigsResponse;
}
Aggregations