[icinga-checkins] icinga.org: icinga-api/master: * Adding comments (target and fields) to all db providers

git at icinga.org git at icinga.org
Tue Sep 7 18:26:50 CEST 2010


Module: icinga-api
Branch: master
Commit: 138860405692cde689d23be218e713ff8597a7ca
URL:    https://git.icinga.org/?p=icinga-api.git;a=commit;h=138860405692cde689d23be218e713ff8597a7ca

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Sep  7 18:26:20 2010 +0200

* Adding comments (target and fields) to all db providers

---

 .../data_interfaces/IcingaApiSearchIdoMysql.php    |    5 ++-
 .../data_interfaces/IcingaApiSearchIdoOci.php      |   32 ++++++++++++++++++-
 .../data_interfaces/IcingaApiSearchIdoOci8.php     |   30 +++++++++++++++++-
 .../data_interfaces/IcingaApiSearchIdoPgsql.php    |   30 +++++++++++++++++-
 4 files changed, 89 insertions(+), 8 deletions(-)

diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
index d681dd8..4e33599 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoMysql.php
@@ -588,7 +588,7 @@ implements IcingaApiSearchIdoInterface {
 		'HOSTGROUP_SUMMARY_COUNT' => array('oh', 'object_id', 'count(%s)'),
 		'SERVICEGROUP_SUMMARY_COUNT' => array('ss', 'current_state', 'count(%s)'),
 		
-			// Comments
+		// Comments
 		'COMMENT_ID' => array('co', 'comment_id'),
 		'COMMENT_INSTANCE_ID' => array('co', 'instance_id'),
 		'COMMENT_ENTRY_TIME' => array('co', 'entry_time'),
@@ -604,7 +604,8 @@ implements IcingaApiSearchIdoInterface {
 		'COMMENT_SOURCE' => array('co', 'comment_source'),
 		'COMMENT_EXPIRES' => array('co', 'expires'),
 		'COMMENT_EXPIRATION_TIME' => array('co', 'expiration_time')
-			);
+		
+		);
 
 			/*
 			 * METHODS
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
index 7591bf6..d9e9646 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci.php
@@ -342,8 +342,17 @@ class IcingaApiSearchIdoOci
 			${FILTER}
 			${GROUPBY}
 			${ORDERBY:ss.current_state asc}
+			${LIMIT}',
+		self::TARGET_COMMENT =>
+			'select
+				${FIELDS}
+			from
+			${TABLE_PREFIX}comments co
+			${FILTER}
+			${GROUPBY}
+			${ORDERBY:co.comment_time asc}
 			${LIMIT}'
-	);
+			);
 
 	// COLUMNS
 	public $columns = array(
@@ -574,7 +583,26 @@ class IcingaApiSearchIdoOci
 		// Summary queries
 		'HOSTGROUP_SUMMARY_COUNT' => array('oh', 'id', 'count(%s)'),
 		'SERVICEGROUP_SUMMARY_COUNT' => array('ss', 'current_state', 'count(%s)'),
-	);
+
+	
+		// Comments
+		'COMMENT_ID' => array('co', 'comment_id'),
+		'COMMENT_INSTANCE_ID' => array('co', 'instance_id'),
+		'COMMENT_ENTRY_TIME' => array('co', 'entry_time'),
+		'COMMENT_ENTRY_TIME_USEC' => array('co', 'entry_time_usec'),
+		'COMMENT_TYPE' => array('co', 'comment_type'),
+		'COMMENT_ENTRY_TYPE' => array('co', 'entry_type'),
+		'COMMENT_OBJECT_ID' => array('co', 'object_id'),
+		'COMMENT_TIME' => array('co', 'comment_time'),
+		'COMMENT_INTERNAL_ID' => array('co', 'internal_comment_id'),
+		'COMMENT_AUTHOR_NAME' => array('co', 'author_name'),
+		'COMMENT_DATA' => array('co', 'comment_data'),
+		'COMMENT_IS_PERSISTENT' => array('co', 'is_persistent'),
+		'COMMENT_SOURCE' => array('co', 'comment_source'),
+		'COMMENT_EXPIRES' => array('co', 'expires'),
+		'COMMENT_EXPIRATION_TIME' => array('co', 'expiration_time')
+	
+		);
 
 	/*
 	 * METHODS
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
index 59fa001..8be1c26 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoOci8.php
@@ -355,8 +355,17 @@ class IcingaApiSearchIdoOci8
 			${FILTER}
 			${GROUPBY}
 			${ORDERBY:ss.current_state asc}
+			${LIMIT}',
+		self::TARGET_COMMENT =>
+			'select
+				${FIELDS}
+			from
+			${TABLE_PREFIX}comments co
+			${FILTER}
+			${GROUPBY}
+			${ORDERBY:co.comment_time asc}
 			${LIMIT}'
-	);
+			);
 
 	// COLUMNS
 	public $columns = array(
@@ -588,7 +597,24 @@ class IcingaApiSearchIdoOci8
 		// Summary queries
 		'HOSTGROUP_SUMMARY_COUNT' => array('oh', 'id', 'count(%s)'),
 		'SERVICEGROUP_SUMMARY_COUNT' => array('ss', 'current_state', 'count(%s)'),
-	);
+	
+		// Comments
+		'COMMENT_ID' => array('co', 'comment_id'),
+		'COMMENT_INSTANCE_ID' => array('co', 'instance_id'),
+		'COMMENT_ENTRY_TIME' => array('co', 'entry_time'),
+		'COMMENT_ENTRY_TIME_USEC' => array('co', 'entry_time_usec'),
+		'COMMENT_TYPE' => array('co', 'comment_type'),
+		'COMMENT_ENTRY_TYPE' => array('co', 'entry_type'),
+		'COMMENT_OBJECT_ID' => array('co', 'object_id'),
+		'COMMENT_TIME' => array('co', 'comment_time'),
+		'COMMENT_INTERNAL_ID' => array('co', 'internal_comment_id'),
+		'COMMENT_AUTHOR_NAME' => array('co', 'author_name'),
+		'COMMENT_DATA' => array('co', 'comment_data'),
+		'COMMENT_IS_PERSISTENT' => array('co', 'is_persistent'),
+		'COMMENT_SOURCE' => array('co', 'comment_source'),
+		'COMMENT_EXPIRES' => array('co', 'expires'),
+		'COMMENT_EXPIRATION_TIME' => array('co', 'expiration_time')
+		);
 
 	/*
 	 * METHODS
diff --git a/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php b/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
index 74a6f48..c409232 100644
--- a/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
+++ b/objects/search/data_interfaces/IcingaApiSearchIdoPgsql.php
@@ -331,8 +331,17 @@ class IcingaApiSearchIdoPgsql
 			${FILTER}
 			${GROUPBY}
 			${ORDERBY:ss.current_state asc}
+			${LIMIT}',
+		self::TARGET_COMMENT =>
+			'select
+				${FIELDS}
+			from
+			${TABLE_PREFIX}comments co
+			${FILTER}
+			${GROUPBY}
+			${ORDERBY:co.comment_time asc}
 			${LIMIT}'
-	);
+			);
 
 	// COLUMNS
 	public $columns = array(
@@ -564,7 +573,24 @@ class IcingaApiSearchIdoPgsql
 		// Summary queries
 		'HOSTGROUP_SUMMARY_COUNT' => array('oh', 'object_id', 'count(%s)'),
 		'SERVICEGROUP_SUMMARY_COUNT' => array('ss', 'current_state', 'count(%s)'),
-	);
+	
+		// Comments
+		'COMMENT_ID' => array('co', 'comment_id'),
+		'COMMENT_INSTANCE_ID' => array('co', 'instance_id'),
+		'COMMENT_ENTRY_TIME' => array('co', 'entry_time'),
+		'COMMENT_ENTRY_TIME_USEC' => array('co', 'entry_time_usec'),
+		'COMMENT_TYPE' => array('co', 'comment_type'),
+		'COMMENT_ENTRY_TYPE' => array('co', 'entry_type'),
+		'COMMENT_OBJECT_ID' => array('co', 'object_id'),
+		'COMMENT_TIME' => array('co', 'comment_time'),
+		'COMMENT_INTERNAL_ID' => array('co', 'internal_comment_id'),
+		'COMMENT_AUTHOR_NAME' => array('co', 'author_name'),
+		'COMMENT_DATA' => array('co', 'comment_data'),
+		'COMMENT_IS_PERSISTENT' => array('co', 'is_persistent'),
+		'COMMENT_SOURCE' => array('co', 'comment_source'),
+		'COMMENT_EXPIRES' => array('co', 'expires'),
+		'COMMENT_EXPIRATION_TIME' => array('co', 'expiration_time')
+		);
 
 	/*
 	 * METHODS





More information about the icinga-checkins mailing list