Search in sources :

Example 11 with OneUuidReturn

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

the class JsonRpcVdsServer method glusterVolumeCreate.

@Override
public OneUuidReturn glusterVolumeCreate(String volumeName, String[] brickList, int replicaCount, int stripeCount, String[] transportList, boolean force, boolean isArbiter) {
    JsonRpcRequest request = new RequestBuilder("GlusterVolume.create").withParameter("volumeName", volumeName).withParameter("bricklist", new ArrayList<>(Arrays.asList(brickList))).withParameter("replicaCount", replicaCount).withParameter("stripeCount", stripeCount).withParameter("transportList", new ArrayList<>(Arrays.asList(transportList))).withParameter("force", force).withParameter("arbiter", isArbiter).build();
    Map<String, Object> response = new FutureMap(this.client, request).withIgnoreResponseKey();
    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) ArrayList(java.util.ArrayList)

Example 12 with OneUuidReturn

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

the class JsonRpcIIrsServer method cloneImageStructure.

@Override
public OneUuidReturn cloneImageStructure(String spUUID, String srcDomUUID, String imgGUID, String dstDomUUID) {
    JsonRpcRequest request = new RequestBuilder("Image.cloneStructure").withParameter("imageID", imgGUID).withParameter("storagepoolID", spUUID).withParameter("storagedomainID", srcDomUUID).withParameter("dstSdUUID", dstDomUUID).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 13 with OneUuidReturn

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

the class JsonRpcIIrsServer method deleteImage.

@Override
public OneUuidReturn deleteImage(String sdUUID, String spUUID, String imgGUID, String postZero, Boolean discard, String force) {
    JsonRpcRequest request = new RequestBuilder("Image.delete").withParameter("imageID", imgGUID).withParameter("storagepoolID", spUUID).withParameter("storagedomainID", sdUUID).withParameter("postZero", postZero).withOptionalParameter("discard", discard).withParameter("force", force).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 14 with OneUuidReturn

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

the class JsonRpcIIrsServer method deleteVolume.

@Override
public OneUuidReturn deleteVolume(String sdUUID, String spUUID, String imgGUID, String[] volUUID, String postZero, Boolean discard, String force) {
    JsonRpcRequest request = new RequestBuilder("Image.deleteVolumes").withParameter("imageID", imgGUID).withParameter("storagepoolID", spUUID).withParameter("storagedomainID", sdUUID).withParameter("volumeList", new ArrayList<>(Arrays.asList(volUUID))).withOptionalParameter("postZero", postZero).withOptionalParameter("discard", discard).withOptionalParameter("force", force).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 15 with OneUuidReturn

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

the class JsonRpcIIrsServer method reduceVolume.

@Override
public OneUuidReturn reduceVolume(String spUUID, String sdUUID, String imageUUID, String volumeUUID, boolean allowActive) {
    JsonRpcRequest request = new RequestBuilder("StoragePool.reduceVolume").withParameter("storagepoolID", spUUID).withParameter("storagedomainID", sdUUID).withParameter("imageID", imageUUID).withParameter("volumeID", volumeUUID).withParameter("allowActive", allowActive).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

OneUuidReturn (org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn)19 JsonRpcRequest (org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest)19 RequestBuilder (org.ovirt.vdsm.jsonrpc.client.RequestBuilder)18 ArrayList (java.util.ArrayList)1 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 Test (org.junit.Test)1 JsonRpcClient (org.ovirt.vdsm.jsonrpc.client.JsonRpcClient)1 JsonRpcResponse (org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse)1