mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Add imports support for Hostgroup
This commit is contained in:
parent
0af3ed4452
commit
878841e33e
@ -37,5 +37,10 @@ class IcingaHostGroupForm extends DirectorObjectForm
|
|||||||
'label' => $this->translate('Display Name'),
|
'label' => $this->translate('Display Name'),
|
||||||
'description' => $this->translate('The name which should displayed.')
|
'description' => $this->translate('The name which should displayed.')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('text', 'imports', array(
|
||||||
|
'label' => $this->translate('Imports'),
|
||||||
|
'description' => $this->translate('The inherited hostgroup template names')
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,8 @@ class IcingaHostGroup extends IcingaObject
|
|||||||
{
|
{
|
||||||
protected $table = 'icinga_hostgroup';
|
protected $table = 'icinga_hostgroup';
|
||||||
|
|
||||||
|
protected $supportsImports = true;
|
||||||
|
|
||||||
protected $defaultProperties = array(
|
protected $defaultProperties = array(
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'object_name' => null,
|
'object_name' => null,
|
||||||
|
17
schema/mysql-changes/upgrade_15.sql
Normal file
17
schema/mysql-changes/upgrade_15.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE icinga_hostgroup_inheritance (
|
||||||
|
hostgroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_hostgroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (hostgroup_id, parent_hostgroup_id),
|
||||||
|
UNIQUE KEY unique_order (hostgroup_id, weight),
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_hostgroup
|
||||||
|
FOREIGN KEY host (hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_parent_hostgroup
|
||||||
|
FOREIGN KEY host (parent_hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
@ -460,6 +460,24 @@ CREATE TABLE icinga_hostgroup (
|
|||||||
KEY search_idx (display_name)
|
KEY search_idx (display_name)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
CREATE TABLE icinga_hostgroup_inheritance (
|
||||||
|
hostgroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
parent_hostgroup_id INT(10) UNSIGNED NOT NULL,
|
||||||
|
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||||
|
PRIMARY KEY (hostgroup_id, parent_hostgroup_id),
|
||||||
|
UNIQUE KEY unique_order (hostgroup_id, weight),
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_hostgroup
|
||||||
|
FOREIGN KEY host (hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_parent_hostgroup
|
||||||
|
FOREIGN KEY host (parent_hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE icinga_servicegroup (
|
CREATE TABLE icinga_servicegroup (
|
||||||
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||||
object_name VARCHAR(255) DEFAULT NULL,
|
object_name VARCHAR(255) DEFAULT NULL,
|
||||||
|
@ -3,7 +3,7 @@ CREATE TABLE icinga_timeperiod_inheritance (
|
|||||||
parent_timeperiod_id integer NOT NULL,
|
parent_timeperiod_id integer NOT NULL,
|
||||||
weight integer DEFAULT NULL,
|
weight integer DEFAULT NULL,
|
||||||
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
CONSTRAINT icinga_timeperiod_inheritance_timeperiodr
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiod
|
||||||
FOREIGN KEY (timeperiod_id)
|
FOREIGN KEY (timeperiod_id)
|
||||||
REFERENCES icinga_timeperiod (id)
|
REFERENCES icinga_timeperiod (id)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
|
20
schema/pgsql-changes/upgrade-6.sql
Normal file
20
schema/pgsql-changes/upgrade-6.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
CREATE TABLE icinga_hostgroup_inheritance (
|
||||||
|
hostgroup_id integer NOT NULL,
|
||||||
|
parent_hostgroup_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (hostgroup_id, parent_hostgroup_id),
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_hostgroup
|
||||||
|
FOREIGN KEY (hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_parent_hostgroup
|
||||||
|
FOREIGN KEY (parent_hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX hostgroup_inheritance_unique_order ON icinga_hostgroup_inheritance (hostgroup_id, weight);
|
||||||
|
CREATE INDEX hostgroup_inheritance_hostgroup ON icinga_hostgroup_inheritance (hostgroup_id);
|
||||||
|
CREATE INDEX hostgroup_inheritance_hostgroup_parent ON icinga_hostgroup_inheritance (parent_hostgroup_id);
|
@ -202,7 +202,7 @@ CREATE TABLE icinga_timeperiod_inheritance (
|
|||||||
parent_timeperiod_id integer NOT NULL,
|
parent_timeperiod_id integer NOT NULL,
|
||||||
weight integer DEFAULT NULL,
|
weight integer DEFAULT NULL,
|
||||||
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
PRIMARY KEY (timeperiod_id, parent_timeperiod_id),
|
||||||
CONSTRAINT icinga_timeperiod_inheritance_timeperiodr
|
CONSTRAINT icinga_timeperiod_inheritance_timeperiod
|
||||||
FOREIGN KEY (timeperiod_id)
|
FOREIGN KEY (timeperiod_id)
|
||||||
REFERENCES icinga_timeperiod (id)
|
REFERENCES icinga_timeperiod (id)
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
@ -566,6 +566,28 @@ CREATE UNIQUE INDEX hostgroup_object_name ON icinga_hostgroup (object_name);
|
|||||||
CREATE INDEX hostgroup_search_idx ON icinga_hostgroup (display_name);
|
CREATE INDEX hostgroup_search_idx ON icinga_hostgroup (display_name);
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE icinga_hostgroup_inheritance (
|
||||||
|
hostgroup_id integer NOT NULL,
|
||||||
|
parent_hostgroup_id integer NOT NULL,
|
||||||
|
weight integer DEFAULT NULL,
|
||||||
|
PRIMARY KEY (hostgroup_id, parent_hostgroup_id),
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_hostgroup
|
||||||
|
FOREIGN KEY (hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE,
|
||||||
|
CONSTRAINT icinga_hostgroup_inheritance_parent_hostgroup
|
||||||
|
FOREIGN KEY (parent_hostgroup_id)
|
||||||
|
REFERENCES icinga_hostgroup (id)
|
||||||
|
ON DELETE RESTRICT
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX hostgroup_inheritance_unique_order ON icinga_hostgroup_inheritance (hostgroup_id, weight);
|
||||||
|
CREATE INDEX hostgroup_inheritance_hostgroup ON icinga_hostgroup_inheritance (hostgroup_id);
|
||||||
|
CREATE INDEX hostgroup_inheritance_hostgroup_parent ON icinga_hostgroup_inheritance (parent_hostgroup_id);
|
||||||
|
|
||||||
|
|
||||||
CREATE TABLE icinga_servicegroup (
|
CREATE TABLE icinga_servicegroup (
|
||||||
id serial,
|
id serial,
|
||||||
object_name character varying(255) DEFAULT NULL,
|
object_name character varying(255) DEFAULT NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user