Search in sources :

Example 11 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class FileProtectionPolicies method getVarraysAssociatedWithPools.

public static void getVarraysAssociatedWithPools(String id) {
    List<VirtualArrayRestRep> varrayList = Lists.newArrayList();
    Set<String> varraySet = Sets.newHashSet();
    FileVirtualPoolRestRep vpool = getViprClient().fileVpools().get(uri(id));
    List<RelatedResourceRep> varrays = vpool.getVirtualArrays();
    for (RelatedResourceRep varray : varrays) {
        varraySet.add(varray.getId().toString());
    }
    for (String varrayId : varraySet) {
        VirtualArrayRestRep varray = getViprClient().varrays().get(uri(varrayId));
        varrayList.add(varray);
    }
    renderJSON(varrayList);
}
Also used : FileVirtualPoolRestRep(com.emc.storageos.model.vpool.FileVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 12 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class BlockVirtualPools method listSrdfVirtualArraysJson.

public static void listSrdfVirtualArraysJson(BlockVirtualPoolForm vpool) {
    if (vpool == null) {
        renderJSON(Collections.emptyList());
    }
    vpool.deserialize();
    List<StringOption> actualOptions = Lists.newArrayList();
    List<VirtualArrayRestRep> virtualArrays = await(vpool.srdfVirtualArrays().asPromise());
    for (StringOption option : dataObjectOptions(virtualArrays)) {
        if (!varrayAlreadyInSRDFCopies(option.id, vpool.srdfCopies)) {
            actualOptions.add(option);
        }
    }
    renderJSON(actualOptions);
}
Also used : StringOption(util.StringOption) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 13 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method getConnectedStorage.

public static void getConnectedStorage() {
    List<VirtualArrayRestRep> virtualarrays = VirtualArrayUtils.getVirtualArrays();
    Set<String> connectedstoragesystems = new HashSet<String>();
    for (VirtualArrayRestRep virtualarray : virtualarrays) {
        for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystemsByVirtualArray(virtualarray.getId().toString())) {
            connectedstoragesystems.add(storageSystem.getId().toString());
        }
    }
    renderJSON(connectedstoragesystems);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) HashSet(java.util.HashSet)

Example 14 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method getDisconnectedStorage.

public static void getDisconnectedStorage(@As(",") String[] ids) {
    Set<String> connectedstoragesystems = new HashSet<String>();
    Set<String> disConnectedstoragesystems = new HashSet<String>();
    JsonObject dataObject = getCookieAsJson(GUIDE_DATA);
    if (dataObject != null) {
        JsonArray varrays = dataObject.getAsJsonArray(VARRAYS);
        if (varrays != null) {
            for (Object virtualarray : varrays) {
                JsonObject varrayobject = (JsonObject) virtualarray;
                String varrayid = varrayobject.get("id").getAsString();
                VirtualArrayRestRep virtualArrayRestRep = VirtualArrayUtils.getVirtualArray(varrayid);
                if (virtualArrayRestRep == null || virtualArrayRestRep.getInactive()) {
                    // ignore for now
                    continue;
                }
                for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystemsByVirtualArray(varrayid)) {
                    connectedstoragesystems.add(storageSystem.getId().toString());
                }
            }
        }
    }
    for (String id : ids) {
        StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
        if (storageSystem == null || storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
            // ignore for now
            continue;
        }
        if (!connectedstoragesystems.contains(id)) {
            disConnectedstoragesystems.add(storageSystem.getName());
        }
    }
    renderJSON(disConnectedstoragesystems);
}
Also used : JsonArray(com.google.gson.JsonArray) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) JsonObject(com.google.gson.JsonObject) JsonObject(com.google.gson.JsonObject) HashSet(java.util.HashSet)

Example 15 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method storagePools.

/**
 * Displays a page listing all storage pools associated with the given virtual array.
 *
 * @param id
 *            the virtual array ID.
 */
public static void storagePools(String id) {
    VirtualArrayRestRep virtualArray = getVirtualArray(id);
    VirtualArrayStoragePoolsDataTable dataTable = new VirtualArrayStoragePoolsDataTable();
    render(virtualArray, dataTable);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Aggregations

VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)56 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)15 URI (java.net.URI)15 AssetOption (com.emc.vipr.model.catalog.AssetOption)14 Asset (com.emc.sa.asset.annotation.Asset)11 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)11 ArrayList (java.util.ArrayList)10 FlashException (controllers.util.FlashException)9 HashSet (java.util.HashSet)8 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)7 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)6 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)6 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)5 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)5 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)4 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)4 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)4 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)4 HashMap (java.util.HashMap)4 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)3