use of org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn in project ovirt-engine by oVirt.
the class JsonRpcIIrsServer method moveImage.
@Override
public OneUuidReturn moveImage(String spUUID, String srcDomUUID, String dstDomUUID, String imgGUID, String vmGUID, int op, String postZero, Boolean discard, String force) {
JsonRpcRequest request = new RequestBuilder("Image.move").withParameter("imageID", imgGUID).withParameter("storagepoolID", spUUID).withParameter("storagedomainID", srcDomUUID).withParameter("dstSdUUID", dstDomUUID).withParameter("operation", op).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);
}
use of org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn 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);
}
use of org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn 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);
}
use of org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn in project ovirt-engine by oVirt.
the class MarshallingTestCase method testVolumeCreate.
@SuppressWarnings("unchecked")
@Test
public void testVolumeCreate() throws Exception {
// Given
String json = "{\"jsonrpc\": \"2.0\", \"id\": \"e8ea1fa9-d819-4c41-ae9c-b103a236fb29\", \"result\": {\"uuid\": \"4f84eef5-8f8b-4732-babd-0a860cf0d1b9\"}}";
ObjectMapper mapper = new ObjectMapper();
JsonRpcResponse response = JsonRpcResponse.fromJsonNode(mapper.readTree(json));
Future<JsonRpcResponse> future = mock(Future.class);
when(future.get()).thenReturn(response);
JsonRpcClient client = mock(JsonRpcClient.class);
JsonRpcRequest request = mock(JsonRpcRequest.class);
when(client.call(request)).thenReturn(future);
// When
Map<String, Object> map = new FutureMap(client, request).withIgnoreResponseKey();
// Then
OneUuidReturn oneuuid = new OneUuidReturn(map);
assertEquals("Done", oneuuid.getStatus().message);
assertEquals(0, oneuuid.getStatus().code);
assertEquals("4f84eef5-8f8b-4732-babd-0a860cf0d1b9", UUID.fromString(oneuuid.uuid).toString());
}
use of org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn in project ovirt-engine by oVirt.
the class JsonRpcVdsServer method createVG.
@Override
public OneUuidReturn createVG(String sdUUID, String[] deviceList, boolean force) {
JsonRpcRequest request = new RequestBuilder("LVMVolumeGroup.create").withParameter("name", sdUUID).withParameter("devlist", new ArrayList<>(Arrays.asList(deviceList))).withParameter("force", force).build();
Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("uuid");
return new OneUuidReturn(response);
}
Aggregations