Add imports support for Servicegroup
This commit is contained in:
parent
b8a35e068c
commit
c7f7d37523
|
@ -37,5 +37,10 @@ class IcingaServiceGroupForm extends DirectorObjectForm
|
|||
'label' => $this->translate('Display Name'),
|
||||
'description' => $this->translate('The name which should displayed.')
|
||||
));
|
||||
|
||||
$this->addElement('text', 'imports', array(
|
||||
'label' => $this->translate('Imports'),
|
||||
'description' => $this->translate('The inherited servicegroup template names')
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ class IcingaServiceGroup extends IcingaObject
|
|||
{
|
||||
protected $table = 'icinga_servicegroup';
|
||||
|
||||
protected $supportsImports = true;
|
||||
|
||||
protected $defaultProperties = array(
|
||||
'id' => null,
|
||||
'object_name' => null,
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
CREATE TABLE icinga_servicegroup_inheritance (
|
||||
servicegroup_id INT(10) UNSIGNED NOT NULL,
|
||||
parent_servicegroup_id INT(10) UNSIGNED NOT NULL,
|
||||
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||
PRIMARY KEY (servicegroup_id, parent_servicegroup_id),
|
||||
UNIQUE KEY unique_order (servicegroup_id, weight),
|
||||
CONSTRAINT icinga_servicegroup_inheritance_servicegroup
|
||||
FOREIGN KEY host (servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_servicegroup_inheritance_parent_servicegroup
|
||||
FOREIGN KEY host (parent_servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
@ -488,6 +488,24 @@ CREATE TABLE icinga_servicegroup (
|
|||
KEY search_idx (display_name)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE icinga_servicegroup_inheritance (
|
||||
servicegroup_id INT(10) UNSIGNED NOT NULL,
|
||||
parent_servicegroup_id INT(10) UNSIGNED NOT NULL,
|
||||
weight MEDIUMINT UNSIGNED DEFAULT NULL,
|
||||
PRIMARY KEY (servicegroup_id, parent_servicegroup_id),
|
||||
UNIQUE KEY unique_order (servicegroup_id, weight),
|
||||
CONSTRAINT icinga_servicegroup_inheritance_servicegroup
|
||||
FOREIGN KEY host (servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_servicegroup_inheritance_parent_servicegroup
|
||||
FOREIGN KEY host (parent_servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE icinga_servicegroup_service (
|
||||
servicegroup_id INT(10) UNSIGNED NOT NULL,
|
||||
service_id INT(10) UNSIGNED NOT NULL,
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
CREATE TABLE icinga_servicegroup_inheritance (
|
||||
servicegroup_id integer NOT NULL,
|
||||
parent_servicegroup_id integer NOT NULL,
|
||||
weight integer DEFAULT NULL,
|
||||
PRIMARY KEY (servicegroup_id, parent_servicegroup_id),
|
||||
CONSTRAINT icinga_servicegroup_inheritance_servicegroup
|
||||
FOREIGN KEY (servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_servicegroup_inheritance_parent_servicegroup
|
||||
FOREIGN KEY (parent_servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX servicegroup_inheritance_unique_order ON icinga_servicegroup_inheritance (servicegroup_id, weight);
|
||||
CREATE INDEX servicegroup_inheritance_servicegroup ON icinga_servicegroup_inheritance (servicegroup_id);
|
||||
CREATE INDEX servicegroup_inheritance_servicegroup_parent ON icinga_servicegroup_inheritance (parent_servicegroup_id);
|
|
@ -600,6 +600,28 @@ CREATE UNIQUE INDEX servicegroup_object_name ON icinga_servicegroup (object_name
|
|||
CREATE INDEX servicegroup_search_idx ON icinga_servicegroup (display_name);
|
||||
|
||||
|
||||
CREATE TABLE icinga_servicegroup_inheritance (
|
||||
servicegroup_id integer NOT NULL,
|
||||
parent_servicegroup_id integer NOT NULL,
|
||||
weight integer DEFAULT NULL,
|
||||
PRIMARY KEY (servicegroup_id, parent_servicegroup_id),
|
||||
CONSTRAINT icinga_servicegroup_inheritance_servicegroup
|
||||
FOREIGN KEY (servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE,
|
||||
CONSTRAINT icinga_servicegroup_inheritance_parent_servicegroup
|
||||
FOREIGN KEY (parent_servicegroup_id)
|
||||
REFERENCES icinga_servicegroup (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX servicegroup_inheritance_unique_order ON icinga_servicegroup_inheritance (servicegroup_id, weight);
|
||||
CREATE INDEX servicegroup_inheritance_servicegroup ON icinga_servicegroup_inheritance (servicegroup_id);
|
||||
CREATE INDEX servicegroup_inheritance_servicegroup_parent ON icinga_servicegroup_inheritance (parent_servicegroup_id);
|
||||
|
||||
|
||||
CREATE TABLE icinga_servicegroup_service (
|
||||
servicegroup_id integer NOT NULL,
|
||||
service_id integer NOT NULL,
|
||||
|
|
Loading…
Reference in New Issue