use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendStorageDomainDiskResourceTest method testExport.
@Test
public void testExport() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ExportRepoImage, ExportRepoImageParameters.class, new String[] { "ImageGroupID", "DestinationDomainId" }, new Object[] { DISK_ID, GUIDS[3] }, true, true, null, null, true));
Action action = new Action();
action.setStorageDomain(new StorageDomain());
action.getStorageDomain().setId(GUIDS[3].toString());
verifyActionResponse(resource.export(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendTemplateDiskResourceTest method testExport.
@Test
public void testExport() throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ExportRepoImage, ExportRepoImageParameters.class, new String[] { "ImageGroupID", "DestinationDomainId" }, new Object[] { GUIDS[1], GUIDS[3] }, true, true, null, null, true));
Action action = new Action();
action.setStorageDomain(new StorageDomain());
action.getStorageDomain().setId(GUIDS[3].toString());
verifyActionResponse(resource.export(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendResourceTest method testActionWithCorrelationId.
@Test
public void testActionWithCorrelationId() throws Exception {
setUpGetEntityExpectations(false);
resource.getCurrent().getParameters().put("correlation_id", "Some-Correlation-id");
resource.setUriInfo(setUpActionExpectations(ActionType.UpdateVds, UpdateVdsActionParameters.class, new String[] { "RootPassword", "CorrelationId" }, new Object[] { NAMES[2], "Some-Correlation-id" }, true, true));
Action action = new Action();
action.setRootPassword(NAMES[2]);
resource.install(action);
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method doTestExport.
protected void doTestExport(StorageDomain storageDomain, boolean exclusive, boolean discardSnapshots) throws Exception {
setUriInfo(setUpActionExpectations(ActionType.ExportVm, MoveOrCopyParameters.class, new String[] { "ContainerId", "StorageDomainId", "ForceOverride", "CopyCollapse" }, new Object[] { GUIDS[0], GUIDS[2], exclusive, discardSnapshots }));
Action action = new Action();
action.setStorageDomain(storageDomain);
if (exclusive) {
action.setExclusive(exclusive);
}
if (discardSnapshots) {
action.setDiscardSnapshots(discardSnapshots);
}
verifyActionResponse(resource.exportToExportDomain(action));
}
use of org.ovirt.engine.api.model.Action in project ovirt-engine by oVirt.
the class BackendVmResourceTest method testMigrateWithHostName.
@Test
public void testMigrateWithHostName() throws Exception {
setUpGetHostByNameExpectations(1);
setUriInfo(setUpActionExpectations(ActionType.MigrateVmToServer, MigrateVmToServerParameters.class, new String[] { "VmId", "VdsId", "ForceMigrationForNonMigratableVm" }, new Object[] { GUIDS[0], GUIDS[1], Boolean.FALSE }));
Action action = new Action();
action.setHost(new Host());
action.getHost().setName(NAMES[1]);
verifyActionResponse(resource.migrate(action));
}
Aggregations