use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getUnprotectedFileSystems.
@Asset("unprotectedFilesystem")
@AssetDependencies({ "project" })
public List<AssetOption> getUnprotectedFileSystems(AssetOptionsContext ctx, URI project) {
debug("getting unprotected file system (project=%s)", project);
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<FileShareRestRep> fileSystems = client.fileSystems().findByProject(project);
for (FileShareRestRep fileShare : fileSystems) {
if (fileShare.getProtection() != null && fileShare.getProtection().getPersonality() == null) {
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getSnapshotFilesystems.
@Asset("fileSnapshotFilesystem")
@AssetDependencies({ "project" })
public List<AssetOption> getSnapshotFilesystems(AssetOptionsContext ctx, URI project) {
ViPRCoreClient client = api(ctx);
Collection<FileShareRestRep> filesystems = client.fileSystems().findByProject(project);
Map<URI, FileVirtualPoolRestRep> pools = getFileVirtualPools(client, filesystems);
return createFilesystemOptions(filesystems, new SnapableFilesystemsPredicate(pools));
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getFileShares.
@Asset("fileShares")
@AssetDependencies("fileFilesystem")
public List<AssetOption> getFileShares(AssetOptionsContext ctx, URI fileFilesystem) {
List<AssetOption> options = Lists.newArrayList();
for (SmbShareResponse share : listFileShares(ctx, fileFilesystem)) {
String label = String.format("%s [%s]", share.getShareName(), share.getMountPoint());
options.add(new AssetOption(share.getShareName(), label));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getProtectedFileSystems.
@Asset("protectedRemoteFileSystem")
@AssetDependencies({ "project" })
public List<AssetOption> getProtectedFileSystems(AssetOptionsContext ctx, URI project) {
debug("getting protected remote file system (project=%s)", project);
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<FileShareRestRep> fileSystems = client.fileSystems().findByProject(project);
for (FileShareRestRep fileShare : fileSystems) {
if (fileShare.getProtection() != null && StringUtils.equals(FileShare.PersonalityTypes.SOURCE.toString(), fileShare.getProtection().getPersonality())) {
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.sa.asset.annotation.AssetDependencies in project coprhd-controller by CoprHD.
the class FileProvider method getFileSourceVirtualPool.
@Asset("fileSourceVirtualPool")
@AssetDependencies({ "unprotectedFilesystem" })
public List<AssetOption> getFileSourceVirtualPool(AssetOptionsContext ctx, URI fileSystems) {
List<AssetOption> options = Lists.newArrayList();
ViPRCoreClient client = api(ctx);
URI sourceVpoolId = client.fileSystems().get(fileSystems).getVirtualPool().getId();
FileVirtualPoolRestRep sourceVpool = client.fileVpools().get(sourceVpoolId);
options.add(new AssetOption(sourceVpool.getId(), sourceVpool.getName()));
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations