Implement getMetaData() in all important models

This commit is contained in:
Johannes Meyer 2021-03-08 11:40:16 +01:00
parent 3762064549
commit 72386601fa
27 changed files with 420 additions and 20 deletions

View file

@ -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([

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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([

View file

@ -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([

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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([

View file

@ -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')
];
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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([

View file

@ -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)')
];
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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([

View file

@ -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);

View file

@ -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);

View file

@ -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);