use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getPrivateDnsZones.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformPrivateDnsZonesResponse getPrivateDnsZones(@ResourceCrn String environmentCrn, String platformVariant) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, platformVariant, null);
LOGGER.debug("Get /platform_resources/private_dns_zones, request: {}", request);
CloudPrivateDnsZones privateDnsZones = platformParameterService.getPrivateDnsZones(request);
List<PlatformPrivateDnsZoneResponse> platformPrivateDnsZones = privateDnsZones.getPrivateDnsZones().stream().map(pdz -> new PlatformPrivateDnsZoneResponse(pdz.getPrivateDnsZoneId())).collect(Collectors.toList());
PlatformPrivateDnsZonesResponse response = new PlatformPrivateDnsZonesResponse(platformPrivateDnsZones);
LOGGER.debug("Resp /platform_resources/private_dns_zones, request: {}, privateDnsZones: {}, response: {}", request, privateDnsZones, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getRegionsByCredential.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public RegionResponse getRegionsByCredential(@ResourceCrn String environmentCrn, String region, String platformVariant, String availabilityZone, boolean availabilityZonesNeeded) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, region, platformVariant, availabilityZone, null);
LOGGER.info("Get /platform_resources/regions, request: {}", request);
CloudRegions regions = platformParameterService.getRegionsByCredential(request, availabilityZonesNeeded);
RegionResponse response = platformRegionsToRegionV1ResponseConverter.convert(regions);
LOGGER.info("Resp /platform_resources/regions, request: {}, regions: {}, response: {}", request, regions, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getNoSqlTables.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformNoSqlTablesResponse getNoSqlTables(@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/nosql_tables, request: {}", request);
CloudNoSqlTables noSqlTables = platformParameterService.getNoSqlTables(request);
PlatformNoSqlTablesResponse response = cloudNoSqlTablesToPlatformNoSqlTablesV1ResponseConverter.convert(noSqlTables);
LOGGER.info("Resp /platform_resources/nosql_tables, request: {}, noSqlTables: {}, response: {}", request, noSqlTables, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getResourceGroups.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformResourceGroupsResponse getResourceGroups(@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/resource_groups, request: {}", request);
CloudResourceGroups resourceGroups = platformParameterService.getResourceGroups(request);
List<PlatformResourceGroupResponse> platformResourceGroups = resourceGroups.getResourceGroups().stream().map(rg -> new PlatformResourceGroupResponse(rg.getName())).collect(Collectors.toList());
PlatformResourceGroupsResponse response = new PlatformResourceGroupsResponse(platformResourceGroups);
LOGGER.info("Resp /platform_resources/resource_groups, request: {}, resourceGroups: {}, response: {}", request, resourceGroups, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getSecurityGroups.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformSecurityGroupsResponse getSecurityGroups(@ResourceCrn String environmentCrn, String region, String platformVariant, String availabilityZone, String sharedProjectId) {
String accountId = getAccountId();
validateEnvironmentCrnPattern(environmentCrn);
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequestByEnvironment(accountId, environmentCrn, region, platformVariant, availabilityZone, sharedProjectId);
LOGGER.info("Get /platform_resources/security_groups, request: {}", request);
CloudSecurityGroups securityGroups = platformParameterService.getSecurityGroups(request);
PlatformSecurityGroupsResponse response = cloudSecurityGroupsToPlatformSecurityGroupsV1ResponseConverter.convert(securityGroups);
LOGGER.info("Resp /platform_resources/security_groups, request: {}, securityGroups: {}, response: {}", request, securityGroups, response);
return response;
}
Aggregations