Eli Mesika has uploaded a new change for review.

Change subject: core[DB]: Adding external status to host
......................................................................

core[DB]: Adding external status to host

This patch set adds external status for the host entity

The Health Status field will be returned as part of the retrieved entity
when a call to display the entity is done using the REST API.

The main use-case for this new status is to provide plugins / external
systems the ability to trigger issues, and allow the administrator to
clearly see there is an issue through the UI

For more information please see the feature page wiki
http://www.ovirt.org/Features/EntityHealthStatus

Change-Id: Ia61e8bef40bdb5d575b75ea1433a7a00e19c9aae
Signed-off-by: emesika <emes...@redhat.com>
---
M packaging/dbscripts/create_views.sql
A packaging/dbscripts/upgrade/03_06_1400_add_host_external_status.sql
M packaging/dbscripts/vds_sp.sql
3 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/40991/1

diff --git a/packaging/dbscripts/create_views.sql 
b/packaging/dbscripts/create_views.sql
index d47f227..a1e6f0b 100644
--- a/packaging/dbscripts/create_views.sql
+++ b/packaging/dbscripts/create_views.sql
@@ -1330,6 +1330,7 @@
     vds_static.vds_spm_priority AS vds_spm_priority,
     vds_dynamic.hooks AS hooks,
     vds_dynamic.status AS status,
+    vds_dynamic.external_status AS external_status,
     vds_dynamic.cpu_cores AS cpu_cores,
     vds_dynamic.cpu_threads AS cpu_threads,
     vds_dynamic.cpu_model AS cpu_model,
@@ -1480,6 +1481,7 @@
     vds_static.pm_detect_kdump AS pm_detect_kdump,
     vds_dynamic.hooks,
     vds_dynamic.status,
+    vds_dynamic.external_status,
     vds_dynamic.cpu_cores,
     vds_dynamic.cpu_threads,
     vds_dynamic.cpu_model,
diff --git 
a/packaging/dbscripts/upgrade/03_06_1400_add_host_external_status.sql 
b/packaging/dbscripts/upgrade/03_06_1400_add_host_external_status.sql
new file mode 100644
index 0000000..051b7cd
--- /dev/null
+++ b/packaging/dbscripts/upgrade/03_06_1400_add_host_external_status.sql
@@ -0,0 +1 @@
+select fn_db_add_column('vds_dynamic', 'external_status', 'integer not null 
default 0');
diff --git a/packaging/dbscripts/vds_sp.sql b/packaging/dbscripts/vds_sp.sql
index 0caa770..361babc 100644
--- a/packaging/dbscripts/vds_sp.sql
+++ b/packaging/dbscripts/vds_sp.sql
@@ -883,6 +883,20 @@
 END; $procedure$
 LANGUAGE plpgsql;
 
+Create or replace FUNCTION UpdateVdsDynamiciExternalStatus(
+        v_vds_guid UUID,
+        v_external_status INTEGER)
+RETURNS VOID
+
+   AS $procedure$
+BEGIN
+      UPDATE vds_dynamic
+      SET
+      external_status = v_external_status
+      WHERE vds_id = v_vds_guid;
+END; $procedure$
+LANGUAGE plpgsql;
+
 Create or replace FUNCTION UpdateVdsDynamicNetConfigDirty(
         v_vds_guid UUID,
         v_net_config_dirty BOOLEAN)


-- 
To view, visit https://gerrit.ovirt.org/40991
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia61e8bef40bdb5d575b75ea1433a7a00e19c9aae
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emes...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to