use of com.linbit.linstor.api.model.ApiCallRc in project cloudstack by apache.
the class LinstorPrimaryDataStoreDriverImpl method deleteSnapshot.
private void deleteSnapshot(@Nonnull DataStore dataStore, @Nonnull String rscDefName, @Nonnull String snapshotName) {
StoragePoolVO storagePool = _storagePoolDao.findById(dataStore.getId());
DevelopersApi linstorApi = LinstorUtil.getLinstorAPI(storagePool.getHostAddress());
try {
ApiCallRcList answers = linstorApi.resourceSnapshotDelete(rscDefName, snapshotName);
if (answers.hasError()) {
for (ApiCallRc answer : answers) {
s_logger.error(answer.getMessage());
}
throw new CloudRuntimeException("Linstor: Unable to delete snapshot: " + rscDefName);
}
} catch (ApiException apiEx) {
s_logger.error("Linstor: ApiEx - " + apiEx.getMessage());
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
}
}
Aggregations