use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method getConvertedVm.
@Override
public OvfReturn getConvertedVm(String jobUUID) {
JsonRpcRequest request = new RequestBuilder("Host.getConvertedVm").withParameter("jobid", jobUUID).build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("ovf").withResponseType(String.class);
return new OvfReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method getVdsStats.
@Override
public VDSInfoReturn getVdsStats() {
JsonRpcRequest request = new RequestBuilder("Host.getStats").build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("info");
return new VDSInfoReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method setupNetworks.
@SuppressWarnings("rawtypes")
@Override
public Future<Map<String, Object>> setupNetworks(Map networks, Map bonding, Map options, final boolean isPolicyReset) {
final JsonRpcRequest request = new RequestBuilder("Host.setupNetworks").withParameter("networks", networks).withParameter("bondings", bonding).withParameter("options", options).build();
final FutureCallable callable = new FutureCallable(() -> {
if (isPolicyReset) {
updateHeartbeatPolicy(client.getClientRetryPolicy().clone(), false);
}
return new FutureMap(client, request).withResponseKey("status");
});
FutureTask<Map<String, Object>> future = new FutureTask<Map<String, Object>>(callable) {
@Override
public boolean isDone() {
if (callable.isDone()) {
if (isPolicyReset) {
updateHeartbeatPolicy(client.getClientRetryPolicy(), true);
}
return true;
}
return false;
}
};
ThreadPoolUtil.execute(future);
return future;
}
use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method updateVolume.
@Override
public StatusOnlyReturn updateVolume(String jobId, Map<?, ?> volumeInfo, Map<?, ?> volumeAttributes) {
JsonRpcRequest request = new RequestBuilder("SDM.update_volume").withParameter("job_id", jobId).withParameter("vol_info", volumeInfo).withParameter("vol_attr", volumeAttributes).build();
Map<String, Object> response = new FutureMap(this.client, request);
return new StatusOnlyReturn(response);
}
use of org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method hostdevChangeNumvfs.
@Override
public StatusOnlyReturn hostdevChangeNumvfs(String deviceName, int numOfVfs) {
JsonRpcRequest request = new RequestBuilder("Host.hostdevChangeNumvfs").withParameter("deviceName", deviceName).withParameter("numvfs", numOfVfs).build();
Map<String, Object> response = new FutureMap(this.client, request);
return new StatusOnlyReturn(response);
}
Aggregations