Search in sources :

Example 1 with GetAllVolumesResponse

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

the class GetAllVolumes method handle.

private GetAllVolumesResponse handle(@SuppressWarnings("unused") GetAllVolumesRequest req, Map<String, Object> ctx) throws ServiceException {
    ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
    checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Admin.R_manageVolume);
    GetAllVolumesResponse resp = new GetAllVolumesResponse();
    for (Volume vol : VolumeManager.getInstance().getAllVolumes()) {
        resp.addVolume(vol.toJAXB());
    }
    return resp;
}
Also used : Volume(com.zimbra.cs.volume.Volume) ZimbraSoapContext(com.zimbra.soap.ZimbraSoapContext) GetAllVolumesResponse(com.zimbra.soap.admin.message.GetAllVolumesResponse)

Example 2 with GetAllVolumesResponse

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

the class VolumeCLI method getVolume.

private void getVolume() throws IOException, ServiceException {
    if (id == null) {
        GetAllVolumesRequest req = new GetAllVolumesRequest();
        auth(auth);
        GetAllVolumesResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
        for (VolumeInfo vol : resp.getVolumes()) {
            print(vol);
        }
    } else {
        GetVolumeRequest req = new GetVolumeRequest(Short.parseShort(id));
        auth(auth);
        GetVolumeResponse resp = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
        print(resp.getVolume());
    }
}
Also used : GetVolumeRequest(com.zimbra.soap.admin.message.GetVolumeRequest) GetVolumeResponse(com.zimbra.soap.admin.message.GetVolumeResponse) GetAllVolumesResponse(com.zimbra.soap.admin.message.GetAllVolumesResponse) VolumeInfo(com.zimbra.soap.admin.type.VolumeInfo) GetAllVolumesRequest(com.zimbra.soap.admin.message.GetAllVolumesRequest)

Example 3 with GetAllVolumesResponse

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

the class VolumeCLI method getCurrentVolumes.

private void getCurrentVolumes() throws SoapFaultException, IOException, ServiceException {
    GetAllVolumesRequest req = new GetAllVolumesRequest();
    auth(auth);
    GetAllVolumesResponse all = JaxbUtil.elementToJaxb(getTransport().invokeWithoutSession(JaxbUtil.jaxbToElement(req)));
    for (VolumeInfo vol : all.getVolumes()) {
        if (vol.isCurrent()) {
            print(vol);
        }
    }
}
Also used : GetAllVolumesResponse(com.zimbra.soap.admin.message.GetAllVolumesResponse) VolumeInfo(com.zimbra.soap.admin.type.VolumeInfo) GetAllVolumesRequest(com.zimbra.soap.admin.message.GetAllVolumesRequest)

Aggregations

GetAllVolumesResponse (com.zimbra.soap.admin.message.GetAllVolumesResponse)3 GetAllVolumesRequest (com.zimbra.soap.admin.message.GetAllVolumesRequest)2 VolumeInfo (com.zimbra.soap.admin.type.VolumeInfo)2 Volume (com.zimbra.cs.volume.Volume)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 GetVolumeRequest (com.zimbra.soap.admin.message.GetVolumeRequest)1 GetVolumeResponse (com.zimbra.soap.admin.message.GetVolumeResponse)1