Sync: allow notification, dependency, scheduled dt

fixes #925
fixes #1209
fixes #1211
fixes #1212
This commit is contained in:
Thomas Gelf 2019-09-06 09:39:35 +02:00
parent 7d7c4defdf
commit 4fcda464e8
5 changed files with 53 additions and 16 deletions

View File

@ -8,7 +8,7 @@ class SyncRuleForm extends DirectorObjectForm
{
public function setup()
{
$availableTypes = array(
$availableTypes = [
'host' => $this->translate('Host'),
'hostgroup' => $this->translate('Host Group'),
'service' => $this->translate('Service'),
@ -19,9 +19,12 @@ class SyncRuleForm extends DirectorObjectForm
'datalistEntry' => $this->translate('Data List Entry'),
'command' => $this->translate('Command'),
'timePeriod' => $this->translate('Time Period'),
'notification' => $this->translate('Notification'),
'scheduledDowntime' => $this->translate('Scheduled Downtime'),
'dependency' => $this->translate('Dependency'),
'endpoint' => $this->translate('Endpoint'),
'zone' => $this->translate('Zone'),
);
];
$this->addElement('text', 'rule_name', array(
'label' => $this->translate('Rule name'),

View File

@ -0,0 +1,21 @@
ALTER TABLE sync_rule MODIFY object_type enum(
'host',
'service',
'command',
'user',
'hostgroup',
'servicegroup',
'usergroup',
'datalistEntry',
'endpoint',
'zone',
'timePeriod',
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
) NOT NULL;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (166, NOW());

View File

@ -1484,7 +1484,10 @@ CREATE TABLE sync_rule (
'endpoint',
'zone',
'timePeriod',
'serviceSet'
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
) NOT NULL,
update_policy ENUM('merge', 'override', 'ignore') NOT NULL,
purge_existing ENUM('y', 'n') NOT NULL DEFAULT 'n',

View File

@ -0,0 +1,7 @@
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'scheduledDowntime';
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'notification';
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'dependency';
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (166, NOW());

View File

@ -31,7 +31,10 @@ CREATE TYPE enum_sync_rule_object_type AS ENUM(
'endpoint',
'zone',
'timePeriod',
'serviceSet'
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
);
CREATE TYPE enum_sync_rule_update_policy AS ENUM('merge', 'override', 'ignore');
CREATE TYPE enum_sync_property_merge_policy AS ENUM('override', 'merge');