use of com.zimbra.soap.admin.message.CreateVolumeResponse in project zm-mailbox by Zimbra.
the class CreateVolume method handle.
private CreateVolumeResponse handle(CreateVolumeRequest req, Map<String, Object> ctx) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
Volume vol = VolumeManager.getInstance().create(toVolume(req.getVolume()));
return new CreateVolumeResponse(vol.toJAXB());
}
use of com.zimbra.soap.admin.message.CreateVolumeResponse in project zm-mailbox by Zimbra.
the class VolumeCLI method addVolume.
private void addVolume() throws ParseException, SoapFaultException, IOException, ServiceException, HttpException {
if (id != null) {
throw new ParseException("id cannot be specified when adding a volume");
}
if (Strings.isNullOrEmpty(type)) {
throw new ParseException("type is missing");
}
if (Strings.isNullOrEmpty(name)) {
throw new ParseException("name is missing");
}
if (Strings.isNullOrEmpty(path)) {
throw new ParseException("path is missing");
}
VolumeInfo vol = new VolumeInfo();
vol.setType(toType(type));
vol.setName(name);
vol.setRootPath(path);
vol.setCompressBlobs(compress != null ? Boolean.parseBoolean(compress) : false);
vol.setCompressionThreshold(compressThreshold != null ? Long.parseLong(compressThreshold) : 4096L);
CreateVolumeRequest req = new CreateVolumeRequest(vol);
auth();
CreateVolumeResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
System.out.println("Volume " + resp.getVolume().getId() + " is created");
}
Aggregations