use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class CredentialPlatformResourceController method getIpPoolsCredentialId.
@Override
@CustomPermissionCheck
public PlatformIpPoolsResponse getIpPoolsCredentialId(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/ip_pools, request: {}", request);
CloudIpPools ipPools = platformParameterService.getIpPoolsCredentialId(request);
PlatformIpPoolsResponse response = cloudIpPoolsToPlatformIpPoolsV1ResponseConverter.convert(ipPools);
LOGGER.info("Resp /platform_resources/ip_pools, request: {}, ipPools: {}, response: {}", request, ipPools, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest 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.environment.platformresource.PlatformResourceRequest 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.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getCloudNetworks.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformNetworksResponse getCloudNetworks(@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/networks, request: {}", request);
CloudNetworks networks = platformParameterService.getCloudNetworks(request);
PlatformNetworksResponse response = cloudNetworksToPlatformNetworksV1ResponseConverter.convert(networks);
LOGGER.info("Resp /platform_resources/networks, request: {}, networks: {}, response: {}", request, networks, response);
return response;
}
use of com.sequenceiq.environment.platformresource.PlatformResourceRequest in project cloudbreak by hortonworks.
the class EnvironmentPlatformResourceController method getCloudSshKeys.
@Override
@CheckPermissionByResourceCrn(action = AuthorizationResourceAction.DESCRIBE_ENVIRONMENT)
public PlatformSshKeysResponse getCloudSshKeys(@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/ssh_keys, request: {}", request);
CloudSshKeys sshKeys = platformParameterService.getCloudSshKeys(request);
PlatformSshKeysResponse response = cloudSshKeysToPlatformSshKeysV1ResponseConverter.convert(sshKeys);
LOGGER.info("Resp /platform_resources/ssh_keys, request: {}, sshKeys: {}, response: {}", request, sshKeys, response);
return response;
}
Aggregations