diff --git a/library/Director/DirectorObject/Automation/ImportExport.php b/library/Director/DirectorObject/Automation/ImportExport.php index adaf5cbc..540de5f5 100644 --- a/library/Director/DirectorObject/Automation/ImportExport.php +++ b/library/Director/DirectorObject/Automation/ImportExport.php @@ -8,6 +8,7 @@ use Icinga\Module\Director\Objects\DirectorDatalist; use Icinga\Module\Director\Objects\DirectorJob; use Icinga\Module\Director\Objects\IcingaHostGroup; use Icinga\Module\Director\Objects\IcingaServiceGroup; +use Icinga\Module\Director\Objects\IcingaServiceSet; use Icinga\Module\Director\Objects\IcingaTemplateChoiceHost; use Icinga\Module\Director\Objects\ImportSource; use Icinga\Module\Director\Objects\SyncRule; @@ -21,6 +22,21 @@ class ImportExport $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() { $res = [];