Roy Golan has uploaded a new change for review. Change subject: core: cluster emulation mode - add procedure to set emulatedMachine ......................................................................
core: cluster emulation mode - add procedure to set emulatedMachine Added a procedure to update only the emulated_machine value on a vds_group Signed-off-by: Roy Golan <[email protected]> Change-Id: I5e675bce649221ea13c3273e9c93ab15a81dae44 --- M backend/manager/dbscripts/vds_groups_sp.sql M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAO.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java 3 files changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/15867/1 diff --git a/backend/manager/dbscripts/vds_groups_sp.sql b/backend/manager/dbscripts/vds_groups_sp.sql index ba7c4a9..1a07396 100644 --- a/backend/manager/dbscripts/vds_groups_sp.sql +++ b/backend/manager/dbscripts/vds_groups_sp.sql @@ -199,4 +199,11 @@ END; $procedure$ LANGUAGE plpgsql; +--This SP updates the vds_group emulated machine +Create or replace FUNCTION UpdateVdsGroupEmulatedMachine(v_vds_group_id UUID, v_emulated_machine varchar(40)) RETURNS VOID + AS $procedure$ +BEGIN + UPDATE vds_groups set emulated_machine = v_emulated_machine where vds_group_id = v_vds_group_id; +END; $procedure$ +LANGUAGE plpgsql; diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAO.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAO.java index 6acb5a5..6aba8b6 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAO.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAO.java @@ -135,4 +135,11 @@ * @return list of clusters */ List<VDSGroup> getClustersWithPermittedAction(Guid userId, ActionGroup actionGroup); + + /** + * Sets the cluster's emulated machine value + * @param vdsGroupId + * @param emulatedMachine + */ + void setEmulatedMachine(Guid vdsGroupId, String emulatedMachine); } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java index c136426..f4452fa 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsGroupDAODbFacadeImpl.java @@ -128,6 +128,15 @@ parameterSource); } + @Override + public void setEmulatedMachine(Guid vdsGroupId, String emulatedMachine) { + MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() + .addValue("vds_group_id", vdsGroupId) + .addValue("emulated_machine", emulatedMachine); + + getCallsHandler().executeModification("UpdateVdsGroupEmulatedMachine", parameterSource); + } + private MapSqlParameterSource getVdsGroupParamSource(VDSGroup group) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", group.getdescription()) -- To view, visit http://gerrit.ovirt.org/15867 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e675bce649221ea13c3273e9c93ab15a81dae44 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Roy Golan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
