Search in sources :

Example 6 with AssetOption

use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.

the class BlockProvider method constructSnapshotWithSnapshotSessionOptions.

protected List<AssetOption> constructSnapshotWithSnapshotSessionOptions(List<BlockSnapshotRestRep> snapshots, List<BlockSnapshotSessionRestRep> snapshotSessions) {
    List<AssetOption> options = Lists.newArrayList();
    // Create a map of linked target URIs to snapshot session names for convenience when creating
    // the option labels.
    Map<URI, String> linkedSnapshotToSnapshotSessionMap = new HashMap<URI, String>();
    for (BlockSnapshotSessionRestRep snapshotSession : snapshotSessions) {
        for (RelatedResourceRep linkedTarget : snapshotSession.getLinkedTarget()) {
            linkedSnapshotToSnapshotSessionMap.put(linkedTarget.getId(), snapshotSession.getName());
        }
    }
    for (BlockSnapshotRestRep snapshot : snapshots) {
        // Ignore RP Bookmarks for snapshot session options
        boolean isRPSnapshot = (snapshot.getTechnologyType() != null && snapshot.getTechnologyType().equalsIgnoreCase(RECOVERPOINT_BOOKMARK_SNAPSHOT_TYPE_VALUE));
        boolean validSnapshotOption = snapshot.getTechnologyType() == null || !isRPSnapshot;
        if (validSnapshotOption) {
            options.add(new AssetOption(snapshot.getId(), getBlockSnapshotLinkedLabel(snapshot, linkedSnapshotToSnapshotSessionMap)));
        }
    }
    AssetOptionsUtils.sortOptionsByLabel(options);
    return options;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) BlockSnapshotSessionRestRep(com.emc.storageos.model.block.BlockSnapshotSessionRestRep) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) VirtualArrayRelatedResourceRep(com.emc.storageos.model.VirtualArrayRelatedResourceRep) HashMap(java.util.HashMap) URI(java.net.URI)

Example 7 with AssetOption

use of com.emc.vipr.model.catalog.AssetOption in project coprhd-controller by CoprHD.

the class BlockProvider method getRemoteSnapshotBlockVolumes.

@Asset("remoteSnapshotBlockVolume")
@AssetDependencies({ "project" })
public List<AssetOption> getRemoteSnapshotBlockVolumes(AssetOptionsContext context, URI project) {
    final ViPRCoreClient client = api(context);
    List<VolumeRestRep> volumes = listVolumes(client, project);
    List<VolumeDetail> volumeDetails = getVolumeDetails(client, volumes);
    Map<URI, VolumeRestRep> volumeNames = ResourceUtils.mapById(volumes);
    List<AssetOption> options = Lists.newArrayList();
    for (VolumeDetail detail : volumeDetails) {
        if (isRemoteSnapshotSupported(detail.volume)) {
            options.add(createVolumeOption(client, null, detail.volume, volumeNames));
        }
    }
    return options;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) 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 AssetOption

use of com.emc.vipr.model.catalog.AssetOption 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 9 with AssetOption

use of com.emc.vipr.model.catalog.AssetOption 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 10 with AssetOption

use of com.emc.vipr.model.catalog.AssetOption 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)

Aggregations

AssetOption (com.emc.vipr.model.catalog.AssetOption)107 Asset (com.emc.sa.asset.annotation.Asset)74 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)63 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)41 URI (java.net.URI)36 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)20 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)14 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)14 ArrayList (java.util.ArrayList)12 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)11 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)10 Map (java.util.Map)9 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)8 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)8 HashMap (java.util.HashMap)8 SimpleValueRep (com.emc.storageos.model.customconfig.SimpleValueRep)7 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)6 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)6 ClusterRestRep (com.emc.storageos.model.host.cluster.ClusterRestRep)6 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)5