Shubhendu Tripathi has uploaded a new change for review.

Change subject: gluster: Query for gluster volume rebalance status
......................................................................

gluster: Query for gluster volume rebalance status

Query for gluster volume rebalance status

Change-Id: I3704f750fafcf3546c5237a4dde67b5f85a691e4
Signed-off-by: Shubhendu Tripathi <[email protected]>
---
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeTaskStatusQuery.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
M 
frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
6 files changed, 46 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/18352/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeTaskStatusQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeTaskStatusQuery.java
new file mode 100644
index 0000000..4c18b27
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterVolumeTaskStatusQuery.java
@@ -0,0 +1,41 @@
+package org.ovirt.engine.core.bll.gluster;
+
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
+import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity;
+import 
org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters;
+import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
+import org.ovirt.engine.core.common.vdscommands.VDSReturnValue;
+import 
org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters;
+import org.ovirt.engine.core.compat.Guid;
+
+public class GetGlusterVolumeTaskStatusQuery <P extends 
GlusterVolumeQueriesParameters> extends GlusterQueriesCommandBase<P>{
+
+    private Guid clusterId;
+    private Guid volumeId;
+
+    protected GetGlusterVolumeTaskStatusQuery(P parameters) {
+        super(parameters);
+    }
+
+    @Override
+    protected void executeQueryCommand() {
+        clusterId = getParameters().getClusterId();
+        volumeId = getParameters().getVolumeId();
+
+        if (volumeId != null) {
+            GlusterVolumeEntity volume = 
getGlusterVolumeDao().getById(volumeId);
+            if (volume == null) {
+                throw new RuntimeException(String.format("Invalid volume id 
%s", volumeId));
+            }
+
+            
getQueryReturnValue().setReturnValue(fetchTaskStatusDetails(volume.getName()));
+        }
+    }
+
+    private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails(String 
volumeName) {
+        VDSReturnValue returnValue =
+                runVdsCommand(VDSCommandType.GetGlusterVolumeTaskStatus,
+                        new 
GlusterVolumeVDSParameters(getUpServerId(clusterId), volumeName));
+        return (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue();
+    }
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
index e22f1bc..89e1338 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java
@@ -282,6 +282,7 @@
     GLUSTER_HOST_UUID_NOT_FOUND(4075),
     GLUSTER_VOLUME_BRICK_ADDED(4076),
     GLUSTER_CLUSTER_SERVICE_STATUS_ADDED(4077),
+    GLUSTER_VOLUME_TASK_STATUS_FAILED(4078),
 
     USER_FORCE_SELECTED_SPM(159),
     USER_VDS_RESTART(41),
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java
index ed9d456..8f6eb0b 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/VdcEventNotificationUtils.java
@@ -79,6 +79,7 @@
         AddEventNotificationEntry(EventNotificationEntity.GlusterVolume, 
AuditLogType.GLUSTER_VOLUME_PROFILE_START_FAILED);
         AddEventNotificationEntry(EventNotificationEntity.GlusterVolume, 
AuditLogType.GLUSTER_VOLUME_PROFILE_STOP);
         AddEventNotificationEntry(EventNotificationEntity.GlusterVolume, 
AuditLogType.GLUSTER_VOLUME_PROFILE_STOP_FAILED);
+        AddEventNotificationEntry(EventNotificationEntity.GlusterVolume, 
AuditLogType.GLUSTER_VOLUME_TASK_STATUS_FAILED);
         AddEventNotificationEntry(EventNotificationEntity.GlusterHook, 
AuditLogType.GLUSTER_HOOK_ENABLE);
         AddEventNotificationEntry(EventNotificationEntity.GlusterHook, 
AuditLogType.GLUSTER_HOOK_ENABLE_FAILED);
         AddEventNotificationEntry(EventNotificationEntity.GlusterHook, 
AuditLogType.GLUSTER_HOOK_DISABLE);
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
index d62c496..5f83a4c 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
@@ -263,6 +263,7 @@
     GetGlusterServerServicesByClusterId,
     GetGlusterServerServicesByServerId,
     GetGlusterClusterServiceByClusterId,
+    GetGlusterVolumeTaskStatus,
 
     GetDefaultConfigurationVersion(VdcQueryAuthType.User),
     OsRepository(VdcQueryAuthType.User),
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
index 3471ef4..6f0b050 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
@@ -149,6 +149,7 @@
         severities.put(AuditLogType.GLUSTER_SERVICE_RESTARTED, 
AuditLogSeverity.NORMAL);
         severities.put(AuditLogType.GLUSTER_SERVICE_RESTART_FAILED, 
AuditLogSeverity.ERROR);
         severities.put(AuditLogType.GLUSTER_HOST_UUID_NOT_FOUND, 
AuditLogSeverity.ERROR);
+        severities.put(AuditLogType.GLUSTER_VOLUME_TASK_STATUS_FAILED, 
AuditLogSeverity.ERROR);
     }
 
     private static void initDefaultSeverities() {
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
index 35e9e08..ea8a45a 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
+++ 
b/frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/LocalizedEnums.properties
@@ -160,7 +160,7 @@
 AuditLogType___GLUSTER_SERVICE_STOP_FAILED=Failed to stop Gluster service
 AuditLogType___GLUSTER_SERVICE_RESTARTED=Gluster Service re-started
 AuditLogType___GLUSTER_SERVICE_RESTART_FAILED=Failed to re-start Gluster 
Service
-
+AuditLogType___GLUSTER_VOLUME_TASK_STATUS_FAILED=Failed to get gluster volume 
task status
 
 VdcActionType___ActivateVds=Activate Host
 VdcActionType___RecoveryStoragePool=Reinitialize Data Center


-- 
To view, visit http://gerrit.ovirt.org/18352
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3704f750fafcf3546c5237a4dde67b5f85a691e4
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shubhendu Tripathi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to