use of org.ovirt.vdsm.jsonrpc.client.RequestBuilder in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method connectStorageServer.
@Override
public ServerConnectionStatusReturn connectStorageServer(int serverType, String spUUID, Map<String, String>[] args) {
JsonRpcRequest request = new RequestBuilder("StoragePool.connectStorageServer").withParameter("storagepoolID", spUUID).withParameter("domainType", serverType).withParameter("connectionParams", args).build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("statuslist").withResponseType(Object[].class);
return new ServerConnectionStatusReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.RequestBuilder in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method timeBoundPollInternal.
private FutureTask<Map<String, Object>> timeBoundPollInternal(final long timeout, final TimeUnit unit, String verb) {
final JsonRpcRequest request = new RequestBuilder(verb).build();
final FutureCallable callable = new FutureCallable(() -> new FutureMap(client, request, timeout, unit, true));
FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) {
@Override
public boolean isDone() {
return callable.isDone();
}
};
ThreadPoolUtil.execute(future);
return future;
}
use of org.ovirt.vdsm.jsonrpc.client.RequestBuilder in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method copyData.
@Override
@SuppressWarnings("rawtypes")
public StatusOnlyReturn copyData(String jobId, Map src, Map dst) {
JsonRpcRequest request = new RequestBuilder("SDM.copy_data").withParameter("source", src).withParameter("destination", dst).withParameter("job_id", jobId).build();
Map<String, Object> response = new FutureMap(this.client, request);
return new StatusOnlyReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.RequestBuilder in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method fullList.
@Override
public VMListReturn fullList(List<String> vmIds) {
JsonRpcRequest request = new RequestBuilder("Host.getVMFullList").withOptionalParameterAsList("vmList", vmIds).build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("vmList").withResponseType(Object[].class);
return new VMListReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.RequestBuilder in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method changeDisk.
@Override
public OneVmReturn changeDisk(String vmId, Map<String, Object> driveSpec) {
JsonRpcRequest request = new RequestBuilder("VM.changeCD").withParameter("vmID", vmId).withParameter("driveSpec", driveSpec).build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("vmList");
return new OneVmReturn(response);
}
Aggregations