Search in sources :

Example 81 with JsonRpcRequest

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

the class JsonRpcIIrsServer method forcedDetachStorageDomain.

@Override
public StatusOnlyReturn forcedDetachStorageDomain(String sdUUID, String spUUID) {
    JsonRpcRequest request = new RequestBuilder("StorageDomain.detach").withParameter("storagedomainID", sdUUID).withParameter("storagepoolID", spUUID).withParameter("force", true).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 82 with JsonRpcRequest

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

the class JsonRpcIIrsServer method getVolumesList.

@Override
public UUIDListReturn getVolumesList(String sdUUID, String spUUID, String imgUUID) {
    JsonRpcRequest request = new RequestBuilder("StorageDomain.getVolumes").withParameter("storagedomainID", sdUUID).withParameter("storagepoolID", spUUID).withParameter("imageID", imgUUID).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("uuidlist").withResponseType(Object[].class);
    return new UUIDListReturn(response);
}
Also used : UUIDListReturn(org.ovirt.engine.core.vdsbroker.irsbroker.UUIDListReturn) JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder)

Example 83 with JsonRpcRequest

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

the class JsonRpcIIrsServer method syncImageData.

@Override
public OneUuidReturn syncImageData(String spUUID, String srcDomUUID, String imgGUID, String dstDomUUID, String syncType) {
    JsonRpcRequest request = new RequestBuilder("Image.syncData").withParameter("imageID", imgGUID).withParameter("storagepoolID", spUUID).withParameter("storagedomainID", srcDomUUID).withParameter("dstSdUUID", dstDomUUID).withParameter("syncType", syncType).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("uuid");
    return new OneUuidReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) OneUuidReturn(org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn)

Example 84 with JsonRpcRequest

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

the class JsonRpcIIrsServer method activateStorageDomain.

@Override
public StorageStatusReturn activateStorageDomain(String sdUUID, String spUUID) {
    JsonRpcRequest request = new RequestBuilder("StorageDomain.activate").withParameter("storagedomainID", sdUUID).withParameter("storagepoolID", spUUID).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("storageStatus").withResponseType(String.class);
    return new StorageStatusReturn(response);
}
Also used : StorageStatusReturn(org.ovirt.engine.core.vdsbroker.irsbroker.StorageStatusReturn) JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder)

Example 85 with JsonRpcRequest

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

the class JsonRpcIIrsServer method prepareMerge.

@Override
public OneUuidReturn prepareMerge(String spUUID, Map<String, Object> subchainInfo) {
    JsonRpcRequest request = new RequestBuilder("StoragePool.prepareMerge").withParameter("storagepoolID", spUUID).withParameter("subchainInfo", subchainInfo).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("uuid");
    return new OneUuidReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) OneUuidReturn(org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn)

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