Search in sources :

Example 56 with JsonRpcRequest

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

the class JsonRpcVdsServer method cleanStorageDomainMetaData.

@Override
public StatusOnlyReturn cleanStorageDomainMetaData(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 57 with JsonRpcRequest

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

the class JsonRpcVdsServer method spmStatus.

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

Example 58 with JsonRpcRequest

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

the class JsonRpcVdsServer method sealDisks.

@Override
public StatusOnlyReturn sealDisks(String templateId, String jobId, String storagePoolId, List<Map<String, Object>> images) {
    JsonRpcRequest request = new RequestBuilder("VM.seal").withParameter("vmID", templateId).withParameter("job_id", jobId).withParameter("sp_id", storagePoolId).withOptionalParameterAsList("images", images).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 59 with JsonRpcRequest

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

the class JsonRpcVdsServer method glusterHostUUIDGet.

@Override
public OneUuidReturn glusterHostUUIDGet() {
    JsonRpcRequest request = new RequestBuilder("GlusterHost.uuid").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)

Example 60 with JsonRpcRequest

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

the class JsonRpcVdsServer method getExternalVmFromOva.

@Override
public OneVmReturn getExternalVmFromOva(String ovaPath) {
    JsonRpcRequest request = new RequestBuilder("Host.getExternalVmFromOva").withParameter("ova_path", ovaPath).build();
    Map<String, Object> response = new FutureMap(this.client, request).withResponseKey("vmList").withResponseType(Object[].class);
    return new OneVmReturn(response);
}
Also used : JsonRpcRequest(org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest) RequestBuilder(org.ovirt.vdsm.jsonrpc.client.RequestBuilder) OneVmReturn(org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn)

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