Search in sources :

Example 1 with CreateVolumeResponse

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());
}
Also used : Volume(com.zimbra.cs.volume.Volume) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) CreateVolumeResponse(com.zimbra.soap.admin.message.CreateVolumeResponse)

Example 2 with CreateVolumeResponse

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");
}
Also used : CreateVolumeRequest(com.zimbra.soap.admin.message.CreateVolumeRequest) CreateVolumeResponse(com.zimbra.soap.admin.message.CreateVolumeResponse) VolumeInfo(com.zimbra.soap.admin.type.VolumeInfo) ParseException(org.apache.commons.cli.ParseException)

Aggregations

CreateVolumeResponse (com.zimbra.soap.admin.message.CreateVolumeResponse)2 Volume (com.zimbra.cs.volume.Volume)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 CreateVolumeRequest (com.zimbra.soap.admin.message.CreateVolumeRequest)1 VolumeInfo (com.zimbra.soap.admin.type.VolumeInfo)1 ParseException (org.apache.commons.cli.ParseException)1