use of com.sequenceiq.authorization.annotation.CustomPermissionCheck in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getVmTypesByCredential.
@Override
@CustomPermissionCheck
public PlatformVmtypesResponse getVmTypesByCredential(String credentialName, String credentialCrn, String region, String platformVariant, String availabilityZone, CdpResourceType cdpResourceType) {
customCheckUtil.run(() -> permissionCheckByCredential(credentialName, credentialCrn));
String accountId = getAccountId();
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest(accountId, credentialName, credentialCrn, region, platformVariant, availabilityZone, null, new HashMap<>(), null, cdpResourceType);
LOGGER.info("Get /platform_resources/machine_types, request: {}", request);
CloudVmTypes cloudVmTypes = platformParameterService.getVmTypesByCredential(request);
PlatformVmtypesResponse response = cloudVmTypesToPlatformVmTypesV1ResponseConverter.convert(cloudVmTypes);
LOGGER.info("Resp /platform_resources/machine_types, request: {}, cloudVmTypes: {}, response: {}", request, cloudVmTypes, response);
return response;
}
use of com.sequenceiq.authorization.annotation.CustomPermissionCheck in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getNoSqlTables.
@Override
@CustomPermissionCheck
public PlatformNoSqlTablesResponse getNoSqlTables(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/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.authorization.annotation.CustomPermissionCheck 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.authorization.annotation.CustomPermissionCheck in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getEncryptionKeys.
@Override
@CustomPermissionCheck
public PlatformEncryptionKeysResponse getEncryptionKeys(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/encryption_keys, request: {}", request);
CloudEncryptionKeys encryptionKeys = platformParameterService.getEncryptionKeys(request);
PlatformEncryptionKeysResponse response = cloudEncryptionKeysToPlatformEncryptionKeysV1ResponseConverter.convert(encryptionKeys);
LOGGER.info("Resp /platform_resources/encryption_keys, request: {}, ipPools: {}, response: {}", request, encryptionKeys, response);
return response;
}
use of com.sequenceiq.authorization.annotation.CustomPermissionCheck in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getPrivateDnsZones.
@Override
@CustomPermissionCheck
public PlatformPrivateDnsZonesResponse getPrivateDnsZones(String credentialName, String credentialCrn, String platformVariant) {
customCheckUtil.run(() -> permissionCheckByCredential(credentialName, credentialCrn));
String accountId = getAccountId();
PlatformResourceRequest request = platformParameterService.getPlatformResourceRequest(accountId, credentialName, credentialCrn, platformVariant, CdpResourceType.DEFAULT);
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;
}
Aggregations