Search in sources :

Example 1 with ModifyVolumeRequest

use of com.zimbra.soap.admin.message.ModifyVolumeRequest in project zm-mailbox by Zimbra.

the class VolumeCLI method editVolume.

private void editVolume() throws ParseException, SoapFaultException, IOException, ServiceException {
    if (Strings.isNullOrEmpty(id)) {
        throw new ParseException("id is missing");
    }
    VolumeInfo vol = new VolumeInfo();
    if (!Strings.isNullOrEmpty(type)) {
        vol.setType(toType(type));
    }
    if (!Strings.isNullOrEmpty(name)) {
        vol.setName(name);
    }
    if (!Strings.isNullOrEmpty(path)) {
        vol.setRootPath(path);
    }
    if (!Strings.isNullOrEmpty(compress)) {
        vol.setCompressBlobs(Boolean.parseBoolean(compress));
    }
    if (!Strings.isNullOrEmpty(compressThreshold)) {
        vol.setCompressionThreshold(Long.parseLong(compressThreshold));
    }
    ModifyVolumeRequest req = new ModifyVolumeRequest(Short.parseShort(id), vol);
    auth(auth);
    getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req));
    System.out.println("Edited volume " + id);
}
Also used : ModifyVolumeRequest(com.zimbra.soap.admin.message.ModifyVolumeRequest) VolumeInfo(com.zimbra.soap.admin.type.VolumeInfo) ParseException(org.apache.commons.cli.ParseException)

Aggregations

ModifyVolumeRequest (com.zimbra.soap.admin.message.ModifyVolumeRequest)1 VolumeInfo (com.zimbra.soap.admin.type.VolumeInfo)1 ParseException (org.apache.commons.cli.ParseException)1