use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method attachContinuousCopy.
public List<URI> attachContinuousCopy(URI volumeURI, String copyName) {
try {
List<URI> mirrors = new ArrayList<URI>();
Copy copy = new Copy("native", Copy.SyncDirection.SOURCE_TO_TARGET.name(), null, copyName, 1);
CopiesParam input = new CopiesParam();
List<Copy> copies = input.getCopies();
copies.add(copy);
input.setCopies((copies));
;
Tasks<VolumeRestRep> tasks = client.blockVolumes().startContinuousCopies(volumeURI, input);
for (VolumeRestRep volumeRestRep : tasks.get()) {
log.info(String.format("Mirror %s (%s)", volumeRestRep.getName(), volumeRestRep.getNativeId()));
mirrors.add(volumeRestRep.getId());
}
return mirrors;
} catch (ServiceErrorException ex) {
log.info(String.format("Could not attach mirror %s to volume %s", copyName, volumeURI));
throw ex;
}
}
use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method ingestUnManagedVolume.
public List<String> ingestUnManagedVolume(List<URI> volumes, URI project, URI varray, URI vpool) {
List<String> nativeGuids = new ArrayList<String>();
try {
VolumeIngest input = new VolumeIngest();
input.setProject(project);
;
input.setVarray(varray);
;
input.setVpool(vpool);
input.setUnManagedVolumes(volumes);
;
Tasks<UnManagedVolumeRestRep> rep = client.unmanagedVolumes().ingest(input);
for (UnManagedVolumeRestRep uvol : rep.get()) {
log.info(String.format("Unmanaged volume %s ", uvol.getNativeGuid()));
nativeGuids.add(uvol.getNativeGuid());
}
return nativeGuids;
} catch (ServiceErrorException ex) {
log.error("Exception discovering storage system " + ex.getMessage(), ex);
throw ex;
}
}
use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method deleteVolumes.
public void deleteVolumes(List<URI> volumes, boolean inventoryOnly) {
try {
Tasks<VolumeRestRep> tasks = client.blockVolumes().deactivate(volumes, (inventoryOnly ? VolumeDeleteTypeEnum.VIPR_ONLY : VolumeDeleteTypeEnum.FULL));
for (VolumeRestRep volumeRestRep : tasks.get()) {
log.info(String.format("Volume %s (%s) deleted", volumeRestRep.getName(), volumeRestRep.getId()));
volumes.add(volumeRestRep.getId());
}
} catch (ServiceErrorException ex) {
log.error("Exception creating deleting volumes " + ex.getMessage(), ex);
throw ex;
}
}
use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method createConsistencyGroup.
public URI createConsistencyGroup(String cgName, URI project) {
BlockConsistencyGroupCreate input = new BlockConsistencyGroupCreate();
input.setName(cgName);
input.setProject(project);
try {
BlockConsistencyGroupRestRep rep = client.blockConsistencyGroups().create(input);
return rep.getId();
} catch (ServiceErrorException ex) {
log.error("Exception creating consistency group: " + cgName, ex);
throw ex;
}
}
use of com.emc.vipr.client.exceptions.ServiceErrorException in project coprhd-controller by CoprHD.
the class DisasterRecovery method pause.
@FlashException("list")
@Restrictions({ @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN"), @Restrict("SYSTEM_ADMIN"), @Restrict("RESTRICTED_SYSTEM_ADMIN") })
public static void pause(@As(",") String[] ids) {
List<String> uuids = Arrays.asList(ids);
for (String uuid : uuids) {
if (!DisasterRecoveryUtils.hasStandbySite(uuid)) {
flash.error(MessagesUtils.get(UNKNOWN, uuid));
list(true);
}
}
SiteIdListParam param = new SiteIdListParam();
param.getIds().addAll(uuids);
try {
DisasterRecoveryUtils.pauseStandby(param);
} catch (ServiceErrorException ex) {
flash.error(ex.getDetailedMessage());
list(true);
} catch (Exception ex) {
flash.error(ex.getMessage());
list(true);
}
flash.success(MessagesUtils.get(PAUSED_SUCCESS));
list(true);
}
Aggregations