From 72386601fa2ef97d6dbe4e155e32a48af70174a0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 8 Mar 2021 11:40:16 +0100 Subject: [PATCH] Implement `getMetaData()` in all important models --- .../Icingadb/Model/AcknowledgementHistory.php | 19 +++++++++++ library/Icingadb/Model/ActionUrl.php | 8 +++++ library/Icingadb/Model/Checkcommand.php | 14 ++++++++ .../Icingadb/Model/CheckcommandArgument.php | 18 ++++++++++ library/Icingadb/Model/CheckcommandEnvvar.php | 11 +++++++ library/Icingadb/Model/CommentHistory.php | 20 +++++++++++ library/Icingadb/Model/DowntimeHistory.php | 25 ++++++++++++++ library/Icingadb/Model/Endpoint.php | 12 +++++++ library/Icingadb/Model/Environment.php | 7 ++++ library/Icingadb/Model/Eventcommand.php | 14 ++++++++ .../Icingadb/Model/EventcommandArgument.php | 18 ++++++++++ library/Icingadb/Model/EventcommandEnvvar.php | 11 +++++++ library/Icingadb/Model/FlappingHistory.php | 17 ++++++++++ library/Icingadb/Model/History.php | 14 ++++---- library/Icingadb/Model/HostState.php | 33 +++++++++++++++++++ library/Icingadb/Model/IconImage.php | 8 +++++ library/Icingadb/Model/NotesUrl.php | 8 +++++ library/Icingadb/Model/Notification.php | 21 ++++++++++++ .../Icingadb/Model/NotificationHistory.php | 26 +++++++-------- .../Icingadb/Model/Notificationcommand.php | 14 ++++++++ .../Model/NotificationcommandArgument.php | 18 ++++++++++ .../Model/NotificationcommandEnvvar.php | 11 +++++++ library/Icingadb/Model/ServiceState.php | 33 +++++++++++++++++++ library/Icingadb/Model/StateHistory.php | 22 +++++++++++++ library/Icingadb/Model/Timeperiod.php | 14 ++++++++ library/Icingadb/Model/TimeperiodRange.php | 10 ++++++ library/Icingadb/Model/Zone.php | 14 ++++++++ 27 files changed, 420 insertions(+), 20 deletions(-) diff --git a/library/Icingadb/Model/AcknowledgementHistory.php b/library/Icingadb/Model/AcknowledgementHistory.php index 4c6b8580..97eb566b 100644 --- a/library/Icingadb/Model/AcknowledgementHistory.php +++ b/library/Icingadb/Model/AcknowledgementHistory.php @@ -47,6 +47,25 @@ class AcknowledgementHistory extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Acknowledgement Environment Id (History)'), + 'endpoint_id' => t('Acknowledgement Endpoint Id (History)'), + 'object_type' => t('Acknowledgement Object Type (History)'), + 'host_id' => t('Acknowledgement Host Id (History)'), + 'service_id' => t('Acknowledgement Service Id (History)'), + 'set_time' => t('Acknowledgement Set Time (History)'), + 'clear_time' => t('Acknowledgement Clear Time (History)'), + 'author' => t('Acknowledgement Author (History)'), + 'cleared_by' => t('Acknowledgement Cleared By (History)'), + 'comment' => t('Acknowledgement Comment (History)'), + 'expire_time' => t('Acknowledgement Expire Time (History)'), + 'is_sticky' => t('Acknowledgement Is Sticky (History)'), + 'is_persistent' => t('Acknowledgement Is Persistent (History)') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new BoolCast([ diff --git a/library/Icingadb/Model/ActionUrl.php b/library/Icingadb/Model/ActionUrl.php index 774a5536..0245fe85 100644 --- a/library/Icingadb/Model/ActionUrl.php +++ b/library/Icingadb/Model/ActionUrl.php @@ -27,6 +27,14 @@ class ActionUrl extends Model ]; } + public function getMetaData() + { + return [ + 'action_url' => t('Action Url'), + 'environment_id' => t('Action Url Environment Id') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/Checkcommand.php b/library/Icingadb/Model/Checkcommand.php index 175a16b1..a59a231b 100644 --- a/library/Icingadb/Model/Checkcommand.php +++ b/library/Icingadb/Model/Checkcommand.php @@ -33,6 +33,20 @@ class Checkcommand extends Model ]; } + public function getMetaData() + { + return [ + 'zone_id' => t('Checkcommand Zone Id'), + 'environment_id' => t('Checkcommand Environment Id'), + 'name_checksum' => t('Checkcommand Name Checksum'), + 'properties_checksum' => t('Checkcommand Properties Checksum'), + 'name' => t('Checkcommand Name'), + 'name_ci' => t('Checkcommand Name (CI)'), + 'command' => t('Checkcommand'), + 'timeout' => t('Checkcommand Timeout') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/CheckcommandArgument.php b/library/Icingadb/Model/CheckcommandArgument.php index 0d9a6c7d..e5624c16 100644 --- a/library/Icingadb/Model/CheckcommandArgument.php +++ b/library/Icingadb/Model/CheckcommandArgument.php @@ -37,6 +37,24 @@ class CheckcommandArgument extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Checkcommand Argument Command Id'), + 'argument_key' => t('Checkcommand Argument Key'), + 'environment_id' => t('Checkcommand Argument Environment Id'), + 'properties_checksum' => t('Checkcommand Argument Properties Checksum'), + 'argument_value' => t('Checkcommand Argument Value'), + 'argument_order' => t('Checkcommand Argument Order'), + 'description' => t('Checkcommand Argument Description'), + 'argument_key_override' => t('Checkcommand Argument Key Override'), + 'repeat_key' => t('Checkcommand Argument Repeat Key'), + 'required' => t('Checkcommand Argument Required'), + 'set_if' => t('Checkcommand Argument Set If'), + 'skip_key' => t('Checkcommand Argument Skip Key') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/CheckcommandEnvvar.php b/library/Icingadb/Model/CheckcommandEnvvar.php index d8b08c9d..257d548b 100644 --- a/library/Icingadb/Model/CheckcommandEnvvar.php +++ b/library/Icingadb/Model/CheckcommandEnvvar.php @@ -30,6 +30,17 @@ class CheckcommandEnvvar extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Checkcommand Envvar Command Id'), + 'envvar_key' => t('Checkcommand Envvar Key'), + 'environment_id' => t('Checkcommand Environment Id'), + 'properties_checksum' => t('Checkcommand Properties Checksum'), + 'envvar_value' => t('Checkcommand Envvar Value') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/CommentHistory.php b/library/Icingadb/Model/CommentHistory.php index 6a03b0e2..fd7aa26a 100644 --- a/library/Icingadb/Model/CommentHistory.php +++ b/library/Icingadb/Model/CommentHistory.php @@ -48,6 +48,26 @@ class CommentHistory extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Comment Environment Id (History)'), + 'endpoint_id' => t('Comment Endpoint Id (History)'), + 'object_type' => t('Comment Object Type (History)'), + 'host_id' => t('Comment Host Id (History)'), + 'service_id' => t('Comment Service Id (History)'), + 'entry_time' => t('Comment Entry Time (History)'), + 'author' => t('Comment Author (History)'), + 'removed_by' => t('Comment Removed By (History)'), + 'comment' => t('Comment Comment (History)'), + 'entry_type' => t('Comment Entry Type (History)'), + 'is_persistent' => t('Comment Is Persistent (History)'), + 'expire_time' => t('Comment Expire Time (History)'), + 'remove_time' => t('Comment Remove Time (History)'), + 'has_been_removed' => t('Comment Has Been Removed (History)') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new BoolCast([ diff --git a/library/Icingadb/Model/DowntimeHistory.php b/library/Icingadb/Model/DowntimeHistory.php index d9d8dc12..e9974817 100644 --- a/library/Icingadb/Model/DowntimeHistory.php +++ b/library/Icingadb/Model/DowntimeHistory.php @@ -53,6 +53,31 @@ class DowntimeHistory extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Downtime Environment Id (History)'), + 'endpoint_id' => t('Downtime Endpoint Id (History)'), + 'triggered_by_id' => t('Downtime Triggered By Id (History)'), + 'object_type' => t('Downtime Object Type (History)'), + 'host_id' => t('Downtime Host Id (History)'), + 'service_id' => t('Downtime Service Id (History)'), + 'entry_time' => t('Downtime Entry Time (History)'), + 'author' => t('Downtime Author (History)'), + 'cancelled_by' => t('Downtime Cancelled By (History)'), + 'comment' => t('Downtime Comment (History)'), + 'is_flexible' => t('Downtime Is Flexible (History)'), + 'flexible_duration' => t('Downtime Flexible Duration (History)'), + 'scheduled_start_time' => t('Downtime Scheduled Start (History)'), + 'scheduled_end_time' => t('Downtime Scheduled End (History)'), + 'start_time' => t('Downtime Actual Start (History)'), + 'end_time' => t('Downtime Actual End (History)'), + 'has_been_cancelled' => t('Downtime Has Been Cancelled (History)'), + 'trigger_time' => t('Downtime Trigger Time (History)'), + 'cancel_time' => t('Downtime Cancel Time (History)') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new BoolCast([ diff --git a/library/Icingadb/Model/Endpoint.php b/library/Icingadb/Model/Endpoint.php index bf7b8e5c..e764fc62 100644 --- a/library/Icingadb/Model/Endpoint.php +++ b/library/Icingadb/Model/Endpoint.php @@ -31,6 +31,18 @@ class Endpoint extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Endpoint Environment Id'), + 'name_checksum' => t('Endpoint Name Checksum'), + 'properties_checksum' => t('Endpoint Properties Checksum'), + 'name' => t('Endpoint Name'), + 'name_ci' => t('Endpoint Name (CI)'), + 'zone_id' => t('Endpoint Zone Id') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/Environment.php b/library/Icingadb/Model/Environment.php index 6209ea8d..0c86e3c9 100644 --- a/library/Icingadb/Model/Environment.php +++ b/library/Icingadb/Model/Environment.php @@ -26,6 +26,13 @@ class Environment extends Model ]; } + public function getMetaData() + { + return [ + 'name' => t('Environment Name') + ]; + } + public function createRelations(Relations $relations) { $relations->hasMany('acknowledgement_history', AcknowledgementHistory::class); diff --git a/library/Icingadb/Model/Eventcommand.php b/library/Icingadb/Model/Eventcommand.php index fe04da05..9b864ee6 100644 --- a/library/Icingadb/Model/Eventcommand.php +++ b/library/Icingadb/Model/Eventcommand.php @@ -33,6 +33,20 @@ class Eventcommand extends Model ]; } + public function getMetaData() + { + return [ + 'zone_id' => t('Eventcommand Zone Id'), + 'environment_id' => t('Eventcommand Environment id'), + 'name_checksum' => t('Eventcommand Name Checksum'), + 'properties_checksum' => t('Eventcommand Properties Checksum'), + 'name' => t('Eventcommand Name'), + 'name_ci' => t('Eventcommand Name (CI)'), + 'command' => t('Eventcommand'), + 'timeout' => t('Eventcommand Timeout') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/EventcommandArgument.php b/library/Icingadb/Model/EventcommandArgument.php index 4fb2f300..1be93a0e 100644 --- a/library/Icingadb/Model/EventcommandArgument.php +++ b/library/Icingadb/Model/EventcommandArgument.php @@ -37,6 +37,24 @@ class EventcommandArgument extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Eventcommand Argument Command Id'), + 'argument_key' => t('Eventcommand Argument Key'), + 'environment_id' => t('Eventcommand Argument Environment Id'), + 'properties_checksum' => t('Eventcommand Argument Properties Checksum'), + 'argument_value' => t('Eventcommand Argument Value'), + 'argument_order' => t('Eventcommand Argument Order'), + 'description' => t('Eventcommand Argument Description'), + 'argument_key_override' => t('Eventcommand Argument Key Override'), + 'repeat_key' => t('Eventcommand Argument Repeat Key'), + 'required' => t('Eventcommand Argument Required'), + 'set_if' => t('Eventcommand Argument Set If'), + 'skip_key' => t('Eventcommand Argument Skip Key') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/EventcommandEnvvar.php b/library/Icingadb/Model/EventcommandEnvvar.php index 3e6e7597..0ce20b8a 100644 --- a/library/Icingadb/Model/EventcommandEnvvar.php +++ b/library/Icingadb/Model/EventcommandEnvvar.php @@ -30,6 +30,17 @@ class EventcommandEnvvar extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Eventcommand Envvar Command Id'), + 'envvar_key' => t('Eventcommand Envvar Key'), + 'environment_id' => t('Eventcommand Envvar Environment Id'), + 'properties_checksum' => t('Eventcommand Envvar Properties Checksum'), + 'envvar_value' => t('Eventcommand Envvar Value') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/FlappingHistory.php b/library/Icingadb/Model/FlappingHistory.php index a3509e63..85981480 100644 --- a/library/Icingadb/Model/FlappingHistory.php +++ b/library/Icingadb/Model/FlappingHistory.php @@ -43,6 +43,23 @@ class FlappingHistory extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Flapping Environment Id (History)'), + 'endpoint_id' => t('Flapping Endpoint Id (History)'), + 'object_type' => t('Flapping Object Type (History)'), + 'host_id' => t('Flapping Host Id (History)'), + 'service_id' => t('Flapping Service Id (History)'), + 'start_time' => t('Flapping Start Time (History)'), + 'end_time' => t('Flapping End Time (History)'), + 'percent_state_change_start' => t('Flapping Percent State Change Start (History)'), + 'percent_state_change_end' => t('Flapping Percent State Change End (History)'), + 'flapping_threshold_low' => t('Flapping Threshold Low (History)'), + 'flapping_threshold_high' => t('Flapping Threshold High (History)') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new Timestamp([ diff --git a/library/Icingadb/Model/History.php b/library/Icingadb/Model/History.php index 12d990fb..e95b3c83 100644 --- a/library/Icingadb/Model/History.php +++ b/library/Icingadb/Model/History.php @@ -50,13 +50,13 @@ class History extends Model public function getMetaData() { return [ - 'environment_id' => t('History Environment Id'), - 'endpoint_id' => t('History Endpoint Id'), - 'object_type' => t('History Object Type'), - 'host_id' => t('History Host Id'), - 'service_id' => t('History Service Id'), - 'event_type' => t('History Event Type'), - 'event_time' => t('History Event Time') + 'environment_id' => t('Environment Id (History)'), + 'endpoint_id' => t('Endpoint Id (History)'), + 'object_type' => t('Event Object Type'), + 'host_id' => t('Host Id (History)'), + 'service_id' => t('Service Id (History)'), + 'event_type' => t('Event Type'), + 'event_time' => t('Event Time') ]; } diff --git a/library/Icingadb/Model/HostState.php b/library/Icingadb/Model/HostState.php index e4278354..3c4b2efb 100644 --- a/library/Icingadb/Model/HostState.php +++ b/library/Icingadb/Model/HostState.php @@ -22,6 +22,39 @@ class HostState extends State return 'host_id'; } + public function getMetaData() + { + return [ + 'environment_id' => t('Host State Environment Id'), + 'state_type' => t('Host State Type'), + 'soft_state' => t('Host Soft State'), + 'hard_state' => t('Host Hard State'), + 'previous_hard_state' => t('Host Previous Hard State'), + 'attempt' => t('Host State Attempt No.'), + 'severity' => t('Host State Severity'), + 'output' => t('Host State Output'), + 'long_output' => t('Host State Long Output'), + 'performance_data' => t('Host State Performance Data'), + 'check_commandline' => t('Host State Check Commandline'), + 'is_problem' => t('Host State Is Problem'), + 'is_handled' => t('Host State Is Handled'), + 'is_reachable' => t('Host State Is Reachable'), + 'is_flapping' => t('Host State Is Flapping'), + 'is_overdue' => t('Host State Is Overdue'), + 'is_acknowledged' => t('Host State Is Acknowledged'), + 'acknowledgement_comment_id' => t('Host State Acknowledgement Comment Id'), + 'in_downtime' => t('Host State In Downtime'), + 'execution_time' => t('Host State Execution Time'), + 'latency' => t('Host State Latency'), + 'timeout' => t('Host State Timeout'), + 'check_source' => t('Host State Check Source'), + 'last_update' => t('Host State Last Update'), + 'last_state_change' => t('Host State Last State Change'), + 'next_check' => t('Host State Next Check'), + 'next_update' => t('Host State Next Update') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/IconImage.php b/library/Icingadb/Model/IconImage.php index a56114ee..317ab63c 100644 --- a/library/Icingadb/Model/IconImage.php +++ b/library/Icingadb/Model/IconImage.php @@ -27,6 +27,14 @@ class IconImage extends Model ]; } + public function getMetaData() + { + return [ + 'icon_image' => t('Icon Image'), + 'environment_id' => t('Icon Image Environment Id') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/NotesUrl.php b/library/Icingadb/Model/NotesUrl.php index 3cc95748..0b299df3 100644 --- a/library/Icingadb/Model/NotesUrl.php +++ b/library/Icingadb/Model/NotesUrl.php @@ -27,6 +27,14 @@ class NotesUrl extends Model ]; } + public function getMetaData() + { + return [ + 'notes_url' => t('Notes Url'), + 'environment_id' => t('Notes Url Environment Id') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/Notification.php b/library/Icingadb/Model/Notification.php index 9a119c34..c380048b 100644 --- a/library/Icingadb/Model/Notification.php +++ b/library/Icingadb/Model/Notification.php @@ -43,6 +43,27 @@ class Notification extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Notification Environment Id'), + 'name_checksum' => t('Notification Name Checksum'), + 'properties_checksum' => t('Notification Properties Checksum'), + 'name' => t('Notification Name'), + 'name_ci' => t('Notification Name (CI)'), + 'host_id' => t('Notification Host Id'), + 'service_id' => t('Notification Service Id'), + 'command_id' => t('Notification Command Id'), + 'times_begin' => t('Notification Times Begin'), + 'times_end' => t('Notification Times End'), + 'notification_interval' => t('Notification Interval'), + 'timeperiod_id' => t('Notification Timeperiod Id'), + 'states' => t('Notification States'), + 'types' => t('Notification Types'), + 'zone_id' => t('Notification Zone Id') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new ReRoute([ diff --git a/library/Icingadb/Model/NotificationHistory.php b/library/Icingadb/Model/NotificationHistory.php index 7ff0cf4e..c3849d0b 100644 --- a/library/Icingadb/Model/NotificationHistory.php +++ b/library/Icingadb/Model/NotificationHistory.php @@ -50,19 +50,19 @@ class NotificationHistory extends Model public function getMetaData() { return [ - 'environment_id' => t('Notification Environment Id'), - 'endpoint_id' => t('Notification Endpoint Id'), - 'object_type' => t('Notification Object Type'), - 'host_id' => t('Notification Host Id'), - 'service_id' => t('Notification Service Id'), - 'notification_id' => t('Notification Id'), - 'type' => t('Notification Type'), - 'send_time' => t('Notification Sent On'), - 'state' => t('Notification Object State'), - 'previous_hard_state' => t('Notification Previous Object State'), - 'author' => t('Notification Author'), - 'text' => t('Notification Text'), - 'users_notified' => t('Notification Users Notified') + 'environment_id' => t('Notification Environment Id (History)'), + 'endpoint_id' => t('Notification Endpoint Id (History)'), + 'object_type' => t('Notification Object Type (History)'), + 'host_id' => t('Notification Host Id (History)'), + 'service_id' => t('Notification Service Id (History)'), + 'notification_id' => t('Notification Id (History)'), + 'type' => t('Notification Type (History)'), + 'send_time' => t('Notification Sent On (History)'), + 'state' => t('Notification Object State (History)'), + 'previous_hard_state' => t('Notification Previous Object State (History)'), + 'author' => t('Notification Author (History)'), + 'text' => t('Notification Text (History)'), + 'users_notified' => t('Notification Users Notified (History)') ]; } diff --git a/library/Icingadb/Model/Notificationcommand.php b/library/Icingadb/Model/Notificationcommand.php index 79828887..ed0a71c4 100644 --- a/library/Icingadb/Model/Notificationcommand.php +++ b/library/Icingadb/Model/Notificationcommand.php @@ -33,6 +33,20 @@ class Notificationcommand extends Model ]; } + public function getMetaData() + { + return [ + 'zone_id' => t('Notificationcommand Zone Id'), + 'environment_id' => t('Notificationcommand Environment Id'), + 'name_checksum' => t('Notificationcommand Name Checksum'), + 'properties_checksum' => t('Notificationcommand Properties Checksum'), + 'name' => t('Notificationcommand Name'), + 'name_ci' => t('Notificationcommand Name (CI)'), + 'command' => t('Notificationcommand'), + 'timeout' => t('Notificationcommand Timeout') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/NotificationcommandArgument.php b/library/Icingadb/Model/NotificationcommandArgument.php index b1f0008b..b93a886d 100644 --- a/library/Icingadb/Model/NotificationcommandArgument.php +++ b/library/Icingadb/Model/NotificationcommandArgument.php @@ -37,6 +37,24 @@ class NotificationcommandArgument extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Notificationcommand Argument Command Id'), + 'argument_key' => t('Notificationcommand Argument Key'), + 'environment_id' => t('Notificationcommand Argument Environment Id'), + 'properties_checksum' => t('Notificationcommand Argument Properties Checksum'), + 'argument_value' => t('Notificationcommand Argument Value'), + 'argument_order' => t('Notificationcommand Argument Order'), + 'description' => t('Notificationcommand Argument Description'), + 'argument_key_override' => t('Notificationcommand Argument Key Override'), + 'repeat_key' => t('Notificationcommand Argument Repeat Key'), + 'required' => t('Notificationcommand Argument Required'), + 'set_if' => t('Notificationcommand Argument Set If'), + 'skip_key' => t('Notificationcommand Argument Skip Key') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/NotificationcommandEnvvar.php b/library/Icingadb/Model/NotificationcommandEnvvar.php index c9dfa6d1..9cf74403 100644 --- a/library/Icingadb/Model/NotificationcommandEnvvar.php +++ b/library/Icingadb/Model/NotificationcommandEnvvar.php @@ -30,6 +30,17 @@ class NotificationcommandEnvvar extends Model ]; } + public function getMetaData() + { + return [ + 'command_id' => t('Notificationcommand Envvar Command Id'), + 'envvar_key' => t('Notificationcommand Envvar Key'), + 'environment_id' => t('Notificationcommand Envvar Environment Id'), + 'properties_checksum' => t('Notificationcommand Envvar Properties Checksum'), + 'envvar_value' => t('Notificationcommand Envvar Value') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/ServiceState.php b/library/Icingadb/Model/ServiceState.php index 6b7673a0..d9b485ae 100644 --- a/library/Icingadb/Model/ServiceState.php +++ b/library/Icingadb/Model/ServiceState.php @@ -19,6 +19,39 @@ class ServiceState extends State return 'service_id'; } + public function getMetaData() + { + return [ + 'environment_id' => t('Service State Environment Id'), + 'state_type' => t('Service State Type'), + 'soft_state' => t('Service Soft State'), + 'hard_state' => t('Service Hard State'), + 'previous_hard_state' => t('Service Previous Hard State'), + 'attempt' => t('Service State Attempt No.'), + 'severity' => t('Service State Severity'), + 'output' => t('Service State Output'), + 'long_output' => t('Service State Long Output'), + 'performance_data' => t('Service State Performance Data'), + 'check_commandline' => t('Service State Check Commandline'), + 'is_problem' => t('Service State Is Problem'), + 'is_handled' => t('Service State Is Handled'), + 'is_reachable' => t('Service State Is Reachable'), + 'is_flapping' => t('Service State Is Flapping'), + 'is_overdue' => t('Service State Is Overdue'), + 'is_acknowledged' => t('Service State Is Acknowledged'), + 'acknowledgement_comment_id' => t('Service State Acknowledgement Comment Id'), + 'in_downtime' => t('Service State In Downtime'), + 'execution_time' => t('Service State Execution Time'), + 'latency' => t('Service State Latency'), + 'timeout' => t('Service State Timeout'), + 'check_source' => t('Service State Check Source'), + 'last_update' => t('Service State Last Update'), + 'last_state_change' => t('Service State Last State Change'), + 'next_check' => t('Service State Next Check'), + 'next_update' => t('Service State Next Update') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/StateHistory.php b/library/Icingadb/Model/StateHistory.php index 7a6809ef..15a004a9 100644 --- a/library/Icingadb/Model/StateHistory.php +++ b/library/Icingadb/Model/StateHistory.php @@ -49,6 +49,28 @@ class StateHistory extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('State Environment Id (History)'), + 'endpoint_id' => t('State Endpoint Id (History)'), + 'object_type' => t('State Object Type (History)'), + 'host_id' => t('State Host Id (History)'), + 'service_id' => t('State Service Id (History)'), + 'event_time' => t('State Event Time (History)'), + 'state_type' => t('State Type (History)'), + 'soft_state' => t('Soft State (History)'), + 'hard_state' => t('Hard State (History)'), + 'attempt' => t('State Attempt No. (History)'), + 'previous_soft_state' => t('Previous Soft State (History)'), + 'previous_hard_state' => t('Previous Hard State (History)'), + 'output' => t('State Output (History)'), + 'long_output' => t('State Long Output (History)'), + 'max_check_attempts' => t('State Max Check Attempts (History)'), + 'check_source' => t('State Check Source (History)') + ]; + } + public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new Timestamp([ diff --git a/library/Icingadb/Model/Timeperiod.php b/library/Icingadb/Model/Timeperiod.php index bcf91d96..405a6b61 100644 --- a/library/Icingadb/Model/Timeperiod.php +++ b/library/Icingadb/Model/Timeperiod.php @@ -33,6 +33,20 @@ class Timeperiod extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Timeperiod Environment Id'), + 'name_checksum' => t('Timeperiod Name Checksum'), + 'properties_checksum' => t('Timeperiod Properties Checksum'), + 'name' => t('Timeperiod Name'), + 'name_ci' => t('Timeperiod Name (CI)'), + 'display_name' => t('Timeperiod Display Name'), + 'prefer_includes' => t('Timeperiod Prefer Includes'), + 'zone_id' => t('Timeperiod Zone Id') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/TimeperiodRange.php b/library/Icingadb/Model/TimeperiodRange.php index c992a123..baf02d34 100644 --- a/library/Icingadb/Model/TimeperiodRange.php +++ b/library/Icingadb/Model/TimeperiodRange.php @@ -29,6 +29,16 @@ class TimeperiodRange extends Model ]; } + public function getMetaData() + { + return [ + 'timeperiod_id' => t('Timeperiod Range Period Id'), + 'range_key' => t('Timeperiod Range Key'), + 'environment_id' => t('Timeperiod Range Environment Id'), + 'range_value' => t('Timeperiod Range Value') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class); diff --git a/library/Icingadb/Model/Zone.php b/library/Icingadb/Model/Zone.php index 4f8d5ff9..471848cb 100644 --- a/library/Icingadb/Model/Zone.php +++ b/library/Icingadb/Model/Zone.php @@ -33,6 +33,20 @@ class Zone extends Model ]; } + public function getMetaData() + { + return [ + 'environment_id' => t('Zone Environment Id'), + 'name_checksum' => t('Zone Name Checksum'), + 'properties_checksum' => t('Zone Properties Checksum'), + 'name' => t('Zone Name'), + 'name_ci' => t('Zone Name (CI)'), + 'is_global' => t('Zone Is Global'), + 'parent_id' => t('Zone Parent Id'), + 'depth' => t('Zone Depth') + ]; + } + public function createRelations(Relations $relations) { $relations->belongsTo('environment', Environment::class);