Search in sources :

Example 96 with JsonRpcRequest

use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.

the class JsonRpcVdsServer method hotUnplugNic.

@SuppressWarnings("rawtypes")
@Override
public StatusOnlyReturn hotUnplugNic(Map info) {
    JsonRpcRequest request = new RequestBuilder("VM.hotunplugNic").withParameter("vmID", getVmId(info)).withParameter("params", info).build();
    Map<String, Object> response = new FutureMap(this.client, request);
    return new StatusOnlyReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) StatusOnlyReturn(org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn)

Example 97 with JsonRpcRequest

use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.

the class JsonRpcVdsServer method glusterVolumeGeoRepSessionResume.

@Override
public StatusOnlyReturn glusterVolumeGeoRepSessionResume(String volumeName, String slaveHostName, String slaveVolumeName, String userName, boolean force) {
    JsonRpcRequest request = new RequestBuilder("GlusterVolume.geoRepSessionResume").withParameter("volumeName", volumeName).withParameter("remoteHost", slaveHostName).withParameter("remoteVolumeName", slaveVolumeName).withOptionalParameter("remoteUserName", userName).withParameter("force", force).build();
    Map<String, Object> response = new FutureMap(this.client, request);
    return new StatusOnlyReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) StatusOnlyReturn(org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn)

Example 98 with JsonRpcRequest

use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.

the class JsonRpcVdsServer method glusterVolumesList.

@Override
public GlusterVolumesListReturn glusterVolumesList(Guid clusterId) {
    JsonRpcRequest request = new RequestBuilder("GlusterVolume.list").build();
    Map<String, Object> response = new FutureMap(this.client, request).withIgnoreResponseKey();
    return new GlusterVolumesListReturn(clusterId, response);
}
Also used : GlusterVolumesListReturn(org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturn) JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder)

Example 99 with JsonRpcRequest

use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.

the class JsonRpcVdsServer method glusterVolumeBrickAdd.

@Override
public StatusOnlyReturn glusterVolumeBrickAdd(String volumeName, String[] bricks, int replicaCount, int stripeCount, boolean force) {
    JsonRpcRequest request = new RequestBuilder("GlusterVolume.addBrick").withParameter("volumeName", volumeName).withParameter("brickList", new ArrayList<>(Arrays.asList(bricks))).withParameter("replicaCount", replicaCount).withParameter("stripeCount", stripeCount).withParameter("force", force).build();
    Map<String, Object> response = new FutureMap(this.client, request);
    return new StatusOnlyReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) StatusOnlyReturn(org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn)

Example 100 with JsonRpcRequest

use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.

the class JsonRpcVdsServer method glusterHooksList.

@Override
public GlusterHooksListReturn glusterHooksList() {
    JsonRpcRequest request = new RequestBuilder("GlusterHook.list").build();
    Map<String, Object> response = new FutureMap(this.client, request).withIgnoreResponseKey();
    return new GlusterHooksListReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) GlusterHooksListReturn(org.ovirt.engine.core.vdsbroker.gluster.GlusterHooksListReturn)

Aggregations

JsonRpcRequest (org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest)236 RequestBuilder (org.ovirt.vdsm.jsonrpc.client.RequestBuilder)223 StatusOnlyReturn (org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn)117 OneUuidReturn (org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn)19 Test (org.junit.Test)14 JsonRpcClient (org.ovirt.vdsm.jsonrpc.client.JsonRpcClient)14 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)13 JsonRpcResponse (org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse)13 HashMap (java.util.HashMap)10 ArrayList (java.util.ArrayList)8 VMListReturn (org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturn)7 OneVmReturn (org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn)5 ServerConnectionStatusReturn (org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturn)5 Map (java.util.Map)4 GlusterVolumeTaskReturn (org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturn)4 GlusterVolumeStatusReturn (org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturn)3 FileStatsReturn (org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturn)3 StatusReturn (org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturn)3 StoragePoolInfo (org.ovirt.engine.core.vdsbroker.irsbroker.StoragePoolInfo)3 StorageStatusReturn (org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturn)3