ImportExport: add ServiceSets
This commit is contained in:
parent
6adc0f7632
commit
9508cf8acd
|
@ -8,6 +8,7 @@ use Icinga\Module\Director\Objects\DirectorDatalist;
|
||||||
use Icinga\Module\Director\Objects\DirectorJob;
|
use Icinga\Module\Director\Objects\DirectorJob;
|
||||||
use Icinga\Module\Director\Objects\IcingaHostGroup;
|
use Icinga\Module\Director\Objects\IcingaHostGroup;
|
||||||
use Icinga\Module\Director\Objects\IcingaServiceGroup;
|
use Icinga\Module\Director\Objects\IcingaServiceGroup;
|
||||||
|
use Icinga\Module\Director\Objects\IcingaServiceSet;
|
||||||
use Icinga\Module\Director\Objects\IcingaTemplateChoiceHost;
|
use Icinga\Module\Director\Objects\IcingaTemplateChoiceHost;
|
||||||
use Icinga\Module\Director\Objects\ImportSource;
|
use Icinga\Module\Director\Objects\ImportSource;
|
||||||
use Icinga\Module\Director\Objects\SyncRule;
|
use Icinga\Module\Director\Objects\SyncRule;
|
||||||
|
@ -21,6 +22,21 @@ class ImportExport
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function serializeAllServiceSets()
|
||||||
|
{
|
||||||
|
// TODO: Export host templates in Inheritance order
|
||||||
|
$res = [];
|
||||||
|
$related = [];
|
||||||
|
foreach (IcingaServiceSet::loadAll($this->connection) as $object) {
|
||||||
|
$res[] = $object->export();
|
||||||
|
foreach ($object->exportRelated() as $key => $relatedObject) {
|
||||||
|
$related[$key] = $relatedObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $res;
|
||||||
|
}
|
||||||
|
|
||||||
public function serializeAllHostTemplateChoices()
|
public function serializeAllHostTemplateChoices()
|
||||||
{
|
{
|
||||||
$res = [];
|
$res = [];
|
||||||
|
|
Loading…
Reference in New Issue