use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView in project cloudbreak by hortonworks.
the class CloudStorageConverter method requestToSpiFileSystem.
public SpiFileSystem requestToSpiFileSystem(CloudStorageBase cloudStorageRequest) {
List<CloudFileSystemView> cloudFileSystemViews = new ArrayList<>();
FileSystemType type = null;
if (cloudStorageRequest.getIdentities() != null && !cloudStorageRequest.getIdentities().isEmpty()) {
for (StorageIdentityBase storageIdentity : cloudStorageRequest.getIdentities()) {
type = getCloudFileSystemView(cloudStorageRequest, cloudFileSystemViews, storageIdentity);
}
}
validateCloudFileSystemViews(cloudFileSystemViews, type);
return new SpiFileSystem("", type, cloudFileSystemViews);
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView in project cloudbreak by hortonworks.
the class AzureSetup method validateFileSystem.
@Override
public void validateFileSystem(CloudCredential credential, SpiFileSystem spiFileSystem) throws Exception {
FileSystemType fileSystemType = spiFileSystem.getType();
List<CloudFileSystemView> cloudFileSystems = spiFileSystem.getCloudFileSystems();
if (cloudFileSystems.size() > 2) {
throw new CloudConnectorException("More than 2 file systems (identities) are not yet supported on Azure!");
}
if (cloudFileSystems.isEmpty()) {
LOGGER.info("No filesystem was configured.");
return;
}
if (FileSystemType.ADLS.equals(fileSystemType)) {
validateAdlsFileSystem(credential, spiFileSystem);
} else if (FileSystemType.ADLS_GEN_2.equals(fileSystemType)) {
validateAdlsGen2FileSystem(spiFileSystem);
} else {
validateWasbFileSystem(spiFileSystem);
}
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView in project cloudbreak by hortonworks.
the class StackToCloudStackConverter method buildFileSystemView.
public Optional<CloudFileSystemView> buildFileSystemView(Stack stack) {
Telemetry telemetry = stack.getTelemetry();
Backup backup = stack.getBackup();
Optional<CloudFileSystemView> fileSystemView = Optional.empty();
if (telemetry != null && telemetry.getLogging() != null && backup != null) {
checkLoggingAndBackupFileSystemConflicting(telemetry.getLogging(), backup);
}
if (telemetry != null && telemetry.getLogging() != null) {
fileSystemView = buildFileSystemViewFromTelemetry(telemetry.getLogging());
}
if (fileSystemView.isEmpty() && backup != null) {
fileSystemView = buildFileSystemViewFromBackup(backup);
}
return fileSystemView;
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView in project cloudbreak by hortonworks.
the class StackToCloudStackConverter method buildInstances.
public List<CloudInstance> buildInstances(Stack stack) {
ImageEntity imageEntity = imageService.getByStack(stack);
Optional<CloudFileSystemView> fileSystemView = buildFileSystemView(stack);
List<Group> groups = buildInstanceGroups(stack, Lists.newArrayList(stack.getInstanceGroups()), Collections.emptySet(), imageEntity.getImageName(), fileSystemView);
List<CloudInstance> cloudInstances = new ArrayList<>();
for (Group group : groups) {
cloudInstances.addAll(group.getInstances());
}
return cloudInstances;
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView in project cloudbreak by hortonworks.
the class StackToCloudStackConverter method convert.
public CloudStack convert(Stack stack, Collection<String> deleteRequestedInstances) {
Image image = imageConverter.convert(imageService.getByStack(stack));
Optional<CloudFileSystemView> fileSystemView = buildFileSystemView(stack);
List<Group> instanceGroups = buildInstanceGroups(stack, Lists.newArrayList(stack.getInstanceGroups()), deleteRequestedInstances, image.getImageName(), fileSystemView);
Network network = buildNetwork(stack);
InstanceAuthentication instanceAuthentication = buildInstanceAuthentication(stack.getStackAuthentication());
Map<String, String> parameters = buildCloudStackParameters(stack.getEnvironmentCrn());
return new CloudStack(instanceGroups, network, image, parameters, getUserDefinedTags(stack), stack.getTemplate(), instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), null);
}
Aggregations