Search in sources :

Example 1 with VmLeaseTaskInfoReturn

use of org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn in project ovirt-engine by oVirt.

the class JsonRpcIIrsServer method addVmLease.

@Override
public VmLeaseTaskInfoReturn addVmLease(String leaseUUID, String sdUUID) {
    HashMap<String, Object> leaseDict = new HashMap<>();
    leaseDict.put("lease_id", leaseUUID);
    leaseDict.put("sd_id", sdUUID);
    JsonRpcRequest request = new RequestBuilder("Lease.create").withParameter("lease", leaseDict).build();
    Map<String, Object> response = new FutureMap(this.client, request);
    return new VmLeaseTaskInfoReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) HashMap(java.util.HashMap) VmLeaseTaskInfoReturn(org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn)

Example 2 with VmLeaseTaskInfoReturn

use of org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn in project ovirt-engine by oVirt.

the class JsonRpcIIrsServer method removeVmLease.

@Override
public VmLeaseTaskInfoReturn removeVmLease(String leaseUUID, String sdUUID) {
    HashMap<String, Object> leaseDict = new HashMap<>();
    leaseDict.put("lease_id", leaseUUID);
    leaseDict.put("sd_id", sdUUID);
    JsonRpcRequest request = new RequestBuilder("Lease.delete").withParameter("lease", leaseDict).build();
    Map<String, Object> response = new FutureMap(this.client, request);
    return new VmLeaseTaskInfoReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) HashMap(java.util.HashMap) VmLeaseTaskInfoReturn(org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn)

Aggregations

HashMap (java.util.HashMap)2 VmLeaseTaskInfoReturn (org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn)2 JsonRpcRequest (org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest)2 RequestBuilder (org.ovirt.vdsm.jsonrpc.client.RequestBuilder)2