Search in sources :

Example 1 with BlockVirtualPoolProtectionUpdateParam

use of com.emc.storageos.model.vpool.BlockVirtualPoolProtectionUpdateParam in project coprhd-controller by CoprHD.

the class ProtectionValidator method validateRpNonHaCopyVpools.

private void validateRpNonHaCopyVpools(BlockVirtualPoolUpdateParam updateParam, DbClient dbClient) {
    if (updateParam.getProtection() != null && updateParam.getProtection().specifiesRPProtection() && !updateParam.specifiesHighAvailability()) {
        // validate the copy target vpools
        BlockVirtualPoolProtectionUpdateParam protection = updateParam.getProtection();
        VirtualPoolProtectionRPChanges rpParam = protection.getRecoverPoint();
        if (rpParam != null) {
            for (VirtualPoolProtectionVirtualArraySettingsParam protectionSettings : rpParam.getAdd()) {
                if (protectionSettings.getVpool() != null) {
                    VirtualPool protectionVirtualPool = dbClient.queryObject(VirtualPool.class, protectionSettings.getVpool());
                    if (VirtualPool.vPoolSpecifiesHighAvailability(protectionVirtualPool)) {
                        // does not specify HA.
                        throw APIException.badRequests.nonVirtualToVirtualProtectionNotSupported();
                    }
                }
            }
        }
    }
}
Also used : VirtualPoolProtectionRPChanges(com.emc.storageos.model.vpool.VirtualPoolProtectionRPChanges) BlockVirtualPoolProtectionUpdateParam(com.emc.storageos.model.vpool.BlockVirtualPoolProtectionUpdateParam) VirtualPoolProtectionVirtualArraySettingsParam(com.emc.storageos.model.vpool.VirtualPoolProtectionVirtualArraySettingsParam) VirtualPool(com.emc.storageos.db.client.model.VirtualPool)

Aggregations

VirtualPool (com.emc.storageos.db.client.model.VirtualPool)1 BlockVirtualPoolProtectionUpdateParam (com.emc.storageos.model.vpool.BlockVirtualPoolProtectionUpdateParam)1 VirtualPoolProtectionRPChanges (com.emc.storageos.model.vpool.VirtualPoolProtectionRPChanges)1 VirtualPoolProtectionVirtualArraySettingsParam (com.emc.storageos.model.vpool.VirtualPoolProtectionVirtualArraySettingsParam)1