Merge pull request #301 from Icinga/feature/scheduled_by

Introduce downtime#scheduled_by
This commit is contained in:
Alexander Aleksandrovič Klimov 2021-09-02 10:31:59 +02:00 committed by GitHub
commit 956590cb99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 0 deletions

View file

@ -24,6 +24,7 @@ type Downtime struct {
IsInEffect types.Bool `json:"is_in_effect"`
StartTime types.UnixMilli `json:"start_time"`
EndTime types.UnixMilli `json:"end_time"`
ScheduledBy types.String `json:"scheduled_by"`
ZoneId types.Binary `json:"zone_id"`
}

View file

@ -51,6 +51,7 @@ type DowntimeHistory struct {
ScheduledEndTime types.UnixMilli `json:"scheduled_end_time"`
StartTime types.UnixMilli `json:"start_time"`
EndTime types.UnixMilli `json:"end_time"`
ScheduledBy types.String `json:"scheduled_by"`
TriggerTime types.UnixMilli `json:"trigger_time"`
}

View file

@ -594,6 +594,7 @@ CREATE TABLE downtime (
is_in_effect enum('n', 'y') NOT NULL,
start_time bigint unsigned DEFAULT NULL COMMENT 'Time when the host went into a problem state during the downtimes timeframe',
end_time bigint unsigned DEFAULT NULL COMMENT 'Problem state assumed: scheduled_end_time if fixed, start_time + flexible_duration otherwise',
scheduled_by varchar(767) DEFAULT NULL COMMENT 'Name of the ScheduledDowntime which created this Downtime. 255+1+255+1+255, i.e. "host.name!service.name!scheduled-downtime-name"',
zone_id binary(20) DEFAULT NULL COMMENT 'zone.id',
@ -958,6 +959,7 @@ CREATE TABLE downtime_history (
scheduled_end_time bigint unsigned NOT NULL,
start_time bigint unsigned NOT NULL COMMENT 'Time when the host went into a problem state during the downtimes timeframe',
end_time bigint unsigned NOT NULL COMMENT 'Problem state assumed: scheduled_end_time if fixed, start_time + duration otherwise',
scheduled_by varchar(767) DEFAULT NULL COMMENT 'Name of the ScheduledDowntime which created this Downtime. 255+1+255+1+255, i.e. "host.name!service.name!scheduled-downtime-name"',
has_been_cancelled enum('n', 'y') NOT NULL,
trigger_time bigint unsigned NOT NULL,
cancel_time bigint unsigned DEFAULT NULL,

View file

@ -97,6 +97,7 @@ ALTER TABLE comment
MODIFY is_persistent enum('n','y') NOT NULL,
MODIFY is_sticky enum('n','y') NOT NULL;
ALTER TABLE downtime
ADD COLUMN scheduled_by varchar(767) DEFAULT NULL COMMENT 'Name of the ScheduledDowntime which created this Downtime. 255+1+255+1+255, i.e. "host.name!service.name!scheduled-downtime-name"' AFTER end_time,
MODIFY name varchar(548) NOT NULL COMMENT '255+1+255+1+36, i.e. "host.name!service.name!UUID"',
MODIFY is_flexible enum('n','y') NOT NULL,
MODIFY is_in_effect enum('n','y') NOT NULL;
@ -107,6 +108,7 @@ ALTER TABLE user
ALTER TABLE zone
MODIFY is_global enum('n','y') NOT NULL;
ALTER TABLE downtime_history
ADD COLUMN scheduled_by varchar(767) DEFAULT NULL COMMENT 'Name of the ScheduledDowntime which created this Downtime. 255+1+255+1+255, i.e. "host.name!service.name!scheduled-downtime-name"' AFTER end_time,
MODIFY is_flexible enum('n','y') NOT NULL,
MODIFY has_been_cancelled enum('n','y') NOT NULL;
ALTER TABLE comment_history