Search in sources :

Example 86 with JsonRpcRequest

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

the class JsonRpcVdsServer method glusterVolumeSnapshotCreate.

@Override
public GlusterVolumeSnapshotCreateReturn glusterVolumeSnapshotCreate(String volumeName, String snapshotName, String description, boolean force) {
    JsonRpcRequest request = new RequestBuilder("GlusterVolume.snapshotCreate").withParameter("volumeName", volumeName).withParameter("snapName", snapshotName).withOptionalParameter("snapDescription", description).withParameter("force", force).build();
    Map<String, Object> response = new FutureMap(this.client, request).withIgnoreResponseKey();
    return new GlusterVolumeSnapshotCreateReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) GlusterVolumeSnapshotCreateReturn(org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturn)

Example 87 with JsonRpcRequest

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

the class JsonRpcVdsServer method getHostJobs.

@Override
public HostJobsReturn getHostJobs(String jobType, List<String> jobIds) {
    JsonRpcRequest request = new RequestBuilder("Host.getJobs").withOptionalParameter("job_type", jobType).withOptionalParameterAsList("job_ids", jobIds).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("jobs");
    return new HostJobsReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) HostJobsReturn(org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturn)

Example 88 with JsonRpcRequest

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

the class JsonRpcVdsServer method mergeSubchain.

@Override
public StatusOnlyReturn mergeSubchain(String jobId, Map<String, Object> subchainInfo) {
    JsonRpcRequest request = new RequestBuilder("SDM.merge").withParameter("job_id", jobId).withParameter("subchain_info", subchainInfo).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 89 with JsonRpcRequest

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

the class JsonRpcVdsServer method merge.

@Override
public StatusOnlyReturn merge(String vmId, Map<String, String> drive, String baseVolUUID, String topVolUUID, String bandwidth, String jobUUID) {
    JsonRpcRequest request = new RequestBuilder("VM.merge").withParameter("vmID", vmId).withParameter("drive", drive).withParameter("baseVolUUID", baseVolUUID).withParameter("topVolUUID", topVolUUID).withParameter("bandwidth", bandwidth).withParameter("jobUUID", jobUUID).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 90 with JsonRpcRequest

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

the class JsonRpcVdsServer method disconnectStoragePool.

@Override
public StatusOnlyReturn disconnectStoragePool(String spUUID, int hostSpmId, String SCSIKey) {
    JsonRpcRequest request = new RequestBuilder("StoragePool.disconnect").withParameter("storagepoolID", spUUID).withParameter("hostID", hostSpmId).withParameter("scsiKey", SCSIKey).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)

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