Search in sources :

Example 1 with StoragePortUpdate

use of com.emc.storageos.model.ports.StoragePortUpdate in project coprhd-controller by CoprHD.

the class ApiTest method updateStoragePortTZ.

/**
 * Updates the storage port to set the transport zone.
 *
 * @param systemURI The storage system URI
 * @param portURI The storage port URI
 */
private void updateStoragePortTZ(URI systemURI, RelatedResourceRep portURI) {
    StoragePortRestRep portRep = rZAdmin.path(String.format("/vdc/storage-systems/%s/storage-ports/%s", systemURI, portURI.getId()).toString()).get(StoragePortRestRep.class);
    StoragePortUpdate updateParam = new StoragePortUpdate();
    if (portRep.getTransportType().equals(Block.FC.toString())) {
        updateParam.setNetwork(_fctzone.getId());
    } else if (portRep.getTransportType().equals("IP")) {
        updateParam.setNetwork(_iptzone.getId());
    }
    ClientResponse resp = rZAdmin.path(String.format("/vdc/storage-ports/%s", portRep.getId()).toString()).put(ClientResponse.class, updateParam);
    Assert.assertEquals(200, resp.getStatus());
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) StoragePortUpdate(com.emc.storageos.model.ports.StoragePortUpdate)

Example 2 with StoragePortUpdate

use of com.emc.storageos.model.ports.StoragePortUpdate in project coprhd-controller by CoprHD.

the class VirtualArrays method updateStoragePorts.

/**
 * Updates the given storage ports with the virtual array assignment changes.
 *
 * @param ids
 *            the storage port IDs.
 * @param changes
 *            the virtual array changes.
 */
private static void updateStoragePorts(List<URI> ids, VirtualArrayAssignmentChanges changes) {
    if (ids.isEmpty()) {
        return;
    }
    List<StoragePortRestRep> storagePorts = StoragePortUtils.getStoragePorts(ids);
    for (StoragePortRestRep storagePort : storagePorts) {
        StoragePortUpdate update = new StoragePortUpdate();
        update.setVarrayChanges(changes);
        StoragePortUtils.update(storagePort.getId(), update);
    }
}
Also used : StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) StoragePortUpdate(com.emc.storageos.model.ports.StoragePortUpdate)

Example 3 with StoragePortUpdate

use of com.emc.storageos.model.ports.StoragePortUpdate in project coprhd-controller by CoprHD.

the class Networks method addArrayPorts.

@FlashException(referrer = { "edit" })
public static void addArrayPorts(String id, @As(",") String[] ids) {
    if (ids != null) {
        StoragePortUpdate update = new StoragePortUpdate();
        update.setNetwork(uri(id));
        for (String storagePortId : NetworkUtils.getStoragePortEndpoints(Arrays.asList(ids))) {
            StoragePortUtils.update(uri(storagePortId), update);
        }
    }
    edit(id, params.get(VIRTUAL_ARRAY_PARAM));
}
Also used : StoragePortUpdate(com.emc.storageos.model.ports.StoragePortUpdate) FlashException(controllers.util.FlashException)

Aggregations

StoragePortUpdate (com.emc.storageos.model.ports.StoragePortUpdate)3 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)2 ClientResponse (com.sun.jersey.api.client.ClientResponse)1 FlashException (controllers.util.FlashException)1