Search in sources :

Example 1 with AccessConfigTypeQueryParam

use of com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigTypeQueryParam 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;
}
Also used : PlatformAccessConfigsResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse) CloudAccessConfigs(com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfigs) PlatformResourceRequest(com.sequenceiq.environment.platformresource.PlatformResourceRequest) CustomPermissionCheck(com.sequenceiq.authorization.annotation.CustomPermissionCheck)

Example 2 with AccessConfigTypeQueryParam

use of com.sequenceiq.environment.api.v1.platformresource.model.AccessConfigTypeQueryParam 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;
}
Also used : PlatformAccessConfigsResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse) CloudAccessConfigs(com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfigs) PlatformResourceRequest(com.sequenceiq.environment.platformresource.PlatformResourceRequest) CheckPermissionByResourceCrn(com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn)

Aggregations

CloudAccessConfigs (com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfigs)2 PlatformAccessConfigsResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse)2 PlatformResourceRequest (com.sequenceiq.environment.platformresource.PlatformResourceRequest)2 CheckPermissionByResourceCrn (com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn)1 CustomPermissionCheck (com.sequenceiq.authorization.annotation.CustomPermissionCheck)1