use of com.zimbra.soap.admin.message.CreateVolumeRequest 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