Search in sources :

Example 6 with Asset

use of com.emc.sa.asset.annotation.Asset in project coprhd-controller by CoprHD.

the class BlockProvider method getExportPathExistingPath.

@Asset("exportPathExistingPath")
public List<AssetOption> getExportPathExistingPath(AssetOptionsContext ctx) {
    List<AssetOption> options = Lists.newArrayList();
    options.add(new AssetOption(YES_VALUE, YES_VALUE));
    options.add(new AssetOption(NO_VALUE, NO_VALUE));
    return options;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) Asset(com.emc.sa.asset.annotation.Asset)

Example 7 with Asset

use of com.emc.sa.asset.annotation.Asset in project coprhd-controller by CoprHD.

the class BlockProvider method getBlockJournalSize.

@Asset("blockJournalSize")
@AssetDependencies("rpConsistencyGroupByProject")
public List<AssetOption> getBlockJournalSize(AssetOptionsContext ctx, URI consistencyGroup) {
    String minimumSize = null;
    BlockConsistencyGroupRestRep cg = api(ctx).blockConsistencyGroups().get(consistencyGroup);
    // Get the first volume in the consistency group.  All volumes will be source volumes
    RelatedResourceRep vol = cg.getVolumes().get(0);
    VolumeRestRep volume = api(ctx).blockVolumes().get(vol);
    if (volume.getProtection() != null && volume.getProtection().getRpRep() != null && volume.getProtection().getRpRep().getProtectionSet() != null) {
        RelatedResourceRep protectionSetId = volume.getProtection().getRpRep().getProtectionSet();
        ProtectionSetRestRep protectionSet = api(ctx).blockVolumes().getProtectionSet(volume.getId(), protectionSetId.getId());
        List<URI> protectionSetVolumeIds = new ArrayList<URI>();
        for (RelatedResourceRep protectionVolume : protectionSet.getVolumes()) {
            protectionSetVolumeIds.add(protectionVolume.getId());
        }
        List<VolumeRestRep> protectionSetVolumes = api(ctx).blockVolumes().withInternal(true).getByIds(protectionSetVolumeIds, null);
        for (VolumeRestRep protectionVolume : protectionSetVolumes) {
            if (protectionVolume.getProtection().getRpRep().getPersonality().equalsIgnoreCase("METADATA")) {
                String capacity = protectionVolume.getCapacity();
                if (minimumSize == null || Float.parseFloat(capacity) < Float.parseFloat(minimumSize)) {
                    minimumSize = capacity;
                }
            }
        }
    }
    if (minimumSize == null) {
        return Lists.newArrayList();
    } else {
        return Lists.newArrayList(newAssetOption(minimumSize, minimumSize));
    }
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) VirtualArrayRelatedResourceRep(com.emc.storageos.model.VirtualArrayRelatedResourceRep) ProtectionSetRestRep(com.emc.storageos.model.protection.ProtectionSetRestRep) ArrayList(java.util.ArrayList) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 8 with Asset

use of com.emc.sa.asset.annotation.Asset in project coprhd-controller by CoprHD.

the class BlockProvider method getCurrentExportPortGroups.

@Asset("exportCurrentPortGroup")
@AssetDependencies({ "host", "exportPathExport", "exportPathStorageSystem", "exportPathVirtualArray" })
public List<AssetOption> getCurrentExportPortGroups(AssetOptionsContext ctx, URI hostOrClusterId, URI exportId, URI storageSystemId, URI varrayId) {
    final ViPRCoreClient client = api(ctx);
    List<AssetOption> options = Lists.newArrayList();
    SimpleValueRep value = client.customConfigs().getCustomConfigTypeValue(VMAX_PORT_GROUP_ENABLED, VMAX);
    if (value.getValue().equalsIgnoreCase("true")) {
        StoragePortGroupRestRepList portGroups = client.varrays().getStoragePortGroups(varrayId, exportId, storageSystemId, null, null, false);
        return createPortGroupOptions(portGroups.getStoragePortGroups());
    }
    return options;
}
Also used : SimpleValueRep(com.emc.storageos.model.customconfig.SimpleValueRep) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) StoragePortGroupRestRepList(com.emc.storageos.model.portgroup.StoragePortGroupRestRepList) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 9 with Asset

use of com.emc.sa.asset.annotation.Asset in project coprhd-controller by CoprHD.

the class BlockProvider method getBlockVirtualPoolFilters.

@Asset("blockVirtualPoolFilter")
public List<AssetOption> getBlockVirtualPoolFilters(AssetOptionsContext ctx) {
    List<AssetOption> options = createBaseResourceOptions(api(ctx).blockVpools().getAll());
    options.add(0, new AssetOption("All", "All"));
    return options;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) Asset(com.emc.sa.asset.annotation.Asset)

Example 10 with Asset

use of com.emc.sa.asset.annotation.Asset in project coprhd-controller by CoprHD.

the class BlockProvider method getExportedVolumes.

@Asset("exportedBlockVolume")
@AssetDependencies("project")
public List<AssetOption> getExportedVolumes(AssetOptionsContext ctx, URI project) {
    debug("getting source block volumes (project=%s)", project);
    final ViPRCoreClient client = api(ctx);
    // Filter volumes that are not RP Metadata
    List<URI> volumeIds = getExportedVolumeIds(ctx, project);
    FilterChain<VolumeRestRep> filter = new FilterChain<VolumeRestRep>(RecoverPointPersonalityFilter.METADATA.not());
    filter.and(new BlockVolumeVMFSDatastoreFilter().not());
    filter.and(new BlockVolumeBootVolumeFilter().not());
    filter.and(new BlockVolumeMountPointFilter().not());
    List<VolumeRestRep> volumes = client.blockVolumes().getByIds(volumeIds, filter);
    return createVolumeWithVarrayOptions(client, volumes);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FilterChain(com.emc.vipr.client.core.filters.FilterChain) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) URI(java.net.URI) BlockVolumeBootVolumeFilter(com.emc.vipr.client.core.filters.BlockVolumeBootVolumeFilter) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Aggregations

Asset (com.emc.sa.asset.annotation.Asset)119 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)102 AssetOption (com.emc.vipr.model.catalog.AssetOption)74 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)72 URI (java.net.URI)47 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)35 ArrayList (java.util.ArrayList)23 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)17 HashSet (java.util.HashSet)15 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)13 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)12 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)11 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)11 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)10 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)10 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)8 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)8 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)8 SimpleValueRep (com.emc.storageos.model.customconfig.SimpleValueRep)7 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)6