Search in sources :

Example 6 with PlatformResourceRequest

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

Example 7 with PlatformResourceRequest

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

Example 8 with PlatformResourceRequest

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;
}
Also used : CloudNoSqlTables(com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables) PlatformResourceRequest(com.sequenceiq.environment.platformresource.PlatformResourceRequest) PlatformNoSqlTablesResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTablesResponse) CustomPermissionCheck(com.sequenceiq.authorization.annotation.CustomPermissionCheck)

Example 9 with PlatformResourceRequest

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

Example 10 with PlatformResourceRequest

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

Aggregations

PlatformResourceRequest (com.sequenceiq.environment.platformresource.PlatformResourceRequest)31 CheckPermissionByResourceCrn (com.sequenceiq.authorization.annotation.CheckPermissionByResourceCrn)12 CustomPermissionCheck (com.sequenceiq.authorization.annotation.CustomPermissionCheck)12 CloudSecurityGroups (com.sequenceiq.cloudbreak.cloud.model.CloudSecurityGroups)9 CloudNetworks (com.sequenceiq.cloudbreak.cloud.model.CloudNetworks)7 CloudNoSqlTables (com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables)7 PlatformNoSqlTablesResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformNoSqlTablesResponse)7 CloudAccessConfigs (com.sequenceiq.cloudbreak.cloud.model.CloudAccessConfigs)6 CloudEncryptionKeys (com.sequenceiq.cloudbreak.cloud.model.CloudEncryptionKeys)6 CloudGateWays (com.sequenceiq.cloudbreak.cloud.model.CloudGateWays)6 CloudIpPools (com.sequenceiq.cloudbreak.cloud.model.CloudIpPools)6 CloudRegions (com.sequenceiq.cloudbreak.cloud.model.CloudRegions)6 CloudSshKeys (com.sequenceiq.cloudbreak.cloud.model.CloudSshKeys)6 CloudVmTypes (com.sequenceiq.cloudbreak.cloud.model.CloudVmTypes)6 PlatformAccessConfigsResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformAccessConfigsResponse)6 PlatformEncryptionKeysResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformEncryptionKeysResponse)6 PlatformGatewaysResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse)6 PlatformIpPoolsResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformIpPoolsResponse)6 PlatformNetworksResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformNetworksResponse)6 PlatformSecurityGroupsResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformSecurityGroupsResponse)6