diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:12 +0000 |
commit | cd989f9c3aff968e19a3aeabc4eb9085787a6673 (patch) | |
tree | fbff2135e7013f196b891bbde54618eb050e4aaf /register-hooks.php | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-director-cd989f9c3aff968e19a3aeabc4eb9085787a6673.tar.xz icingaweb2-module-director-cd989f9c3aff968e19a3aeabc4eb9085787a6673.zip |
Adding upstream version 1.10.2.upstream/1.10.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'register-hooks.php')
-rw-r--r-- | register-hooks.php | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/register-hooks.php b/register-hooks.php new file mode 100644 index 0000000..62fd5f5 --- /dev/null +++ b/register-hooks.php @@ -0,0 +1,146 @@ +<?php + +use Icinga\Application\Modules\Module; +use Icinga\Module\Director\DataType\DataTypeArray; +use Icinga\Module\Director\DataType\DataTypeBoolean; +use Icinga\Module\Director\DataType\DataTypeDatalist; +use Icinga\Module\Director\DataType\DataTypeDirectorObject; +use Icinga\Module\Director\DataType\DataTypeDictionary; +use Icinga\Module\Director\DataType\DataTypeNumber; +use Icinga\Module\Director\DataType\DataTypeSqlQuery; +use Icinga\Module\Director\DataType\DataTypeString; +use Icinga\Module\Director\Import\ImportSourceCoreApi; +use Icinga\Module\Director\Import\ImportSourceDirectorObject; +use Icinga\Module\Director\Import\ImportSourceLdap; +use Icinga\Module\Director\Import\ImportSourceRestApi; +use Icinga\Module\Director\Import\ImportSourceSql; +use Icinga\Module\Director\Job\ConfigJob; +use Icinga\Module\Director\Job\HousekeepingJob; +use Icinga\Module\Director\Job\ImportJob; +use Icinga\Module\Director\Job\SyncJob; +use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayElementByPosition; +use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayFilter; +use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayToRow; +use Icinga\Module\Director\PropertyModifier\PropertyModifierArrayUnique; +use Icinga\Module\Director\PropertyModifier\PropertyModifierBitmask; +use Icinga\Module\Director\PropertyModifier\PropertyModifierCombine; +use Icinga\Module\Director\PropertyModifier\PropertyModifierDictionaryToRow; +use Icinga\Module\Director\PropertyModifier\PropertyModifierDnsRecords; +use Icinga\Module\Director\PropertyModifier\PropertyModifierExtractFromDN; +use Icinga\Module\Director\PropertyModifier\PropertyModifierFromAdSid; +use Icinga\Module\Director\PropertyModifier\PropertyModifierFromLatin1; +use Icinga\Module\Director\PropertyModifier\PropertyModifierGetHostByAddr; +use Icinga\Module\Director\PropertyModifier\PropertyModifierGetHostByName; +use Icinga\Module\Director\PropertyModifier\PropertyModifierGetPropertyFromOtherImportSource; +use Icinga\Module\Director\PropertyModifier\PropertyModifierJoin; +use Icinga\Module\Director\PropertyModifier\PropertyModifierJsonDecode; +use Icinga\Module\Director\PropertyModifier\PropertyModifierLConfCustomVar; +use Icinga\Module\Director\PropertyModifier\PropertyModifierListToObject; +use Icinga\Module\Director\PropertyModifier\PropertyModifierLowercase; +use Icinga\Module\Director\PropertyModifier\PropertyModifierMakeBoolean; +use Icinga\Module\Director\PropertyModifier\PropertyModifierMap; +use Icinga\Module\Director\PropertyModifier\PropertyModifierNegateBoolean; +use Icinga\Module\Director\PropertyModifier\PropertyModifierParseURL; +use Icinga\Module\Director\PropertyModifier\PropertyModifierRegexReplace; +use Icinga\Module\Director\PropertyModifier\PropertyModifierRegexSplit; +use Icinga\Module\Director\PropertyModifier\PropertyModifierRejectOrSelect; +use Icinga\Module\Director\PropertyModifier\PropertyModifierRenameColumn; +use Icinga\Module\Director\PropertyModifier\PropertyModifierReplace; +use Icinga\Module\Director\PropertyModifier\PropertyModifierReplaceNull; +use Icinga\Module\Director\PropertyModifier\PropertyModifierSimpleGroupBy; +use Icinga\Module\Director\PropertyModifier\PropertyModifierSkipDuplicates; +use Icinga\Module\Director\PropertyModifier\PropertyModifierSplit; +use Icinga\Module\Director\PropertyModifier\PropertyModifierStripDomain; +use Icinga\Module\Director\PropertyModifier\PropertyModifierSubstring; +use Icinga\Module\Director\PropertyModifier\PropertyModifierToInt; +use Icinga\Module\Director\PropertyModifier\PropertyModifierTrim; +use Icinga\Module\Director\PropertyModifier\PropertyModifierUppercase; +use Icinga\Module\Director\PropertyModifier\PropertyModifierUpperCaseFirst; +use Icinga\Module\Director\PropertyModifier\PropertyModifierURLEncode; +use Icinga\Module\Director\PropertyModifier\PropertyModifierUuidBinToHex; +use Icinga\Module\Director\PropertyModifier\PropertyModifierXlsNumericIp; +use Icinga\Module\Director\ProvidedHook\CubeLinks; +use Icinga\Module\Director\ProvidedHook\IcingaDbCubeLinks; + +/** @var Module $this */ +if ($this->getConfig()->get('frontend', 'disabled', 'no') !== 'yes') { + $this->provideHook('monitoring/HostActions'); + $this->provideHook('monitoring/ServiceActions'); + $this->provideHook('cube/Actions', CubeLinks::class); + $this->provideHook('cube/IcingaDbActions', IcingaDbCubeLinks::class); +} + +$directorHooks = [ + 'director/DataType' => [ + DataTypeArray::class, + DataTypeBoolean::class, + DataTypeDatalist::class, + DataTypeDictionary::class, + DataTypeNumber::class, + DataTypeDirectorObject::class, + DataTypeSqlQuery::class, + DataTypeString::class + ], + 'director/ImportSource' => [ + ImportSourceDirectorObject::class, + ImportSourceSql::class, + ImportSourceLdap::class, + ImportSourceCoreApi::class, + ImportSourceRestApi::class + ], + 'director/Job' => [ + ConfigJob::class, + HousekeepingJob::class, + ImportJob::class, + SyncJob::class, + ], + 'director/PropertyModifier' => [ + PropertyModifierArrayElementByPosition::class, + PropertyModifierArrayFilter::class, + PropertyModifierArrayToRow::class, + PropertyModifierArrayUnique::class, + PropertyModifierBitmask::class, + PropertyModifierCombine::class, + PropertyModifierDictionaryToRow::class, + PropertyModifierDnsRecords::class, + PropertyModifierExtractFromDN::class, + PropertyModifierFromAdSid::class, + PropertyModifierFromLatin1::class, + PropertyModifierGetHostByAddr::class, + PropertyModifierGetHostByName::class, + PropertyModifierGetPropertyFromOtherImportSource::class, + PropertyModifierJoin::class, + PropertyModifierJsonDecode::class, + PropertyModifierLConfCustomVar::class, + PropertyModifierListToObject::class, + PropertyModifierLowercase::class, + PropertyModifierMakeBoolean::class, + PropertyModifierMap::class, + PropertyModifierNegateBoolean::class, + PropertyModifierParseURL::class, + PropertyModifierRegexReplace::class, + PropertyModifierRegexSplit::class, + PropertyModifierRejectOrSelect::class, + PropertyModifierRenameColumn::class, + PropertyModifierReplace::class, + PropertyModifierReplaceNull::class, + PropertyModifierSimpleGroupBy::class, + PropertyModifierSkipDuplicates::class, + PropertyModifierSplit::class, + PropertyModifierStripDomain::class, + PropertyModifierSubstring::class, + PropertyModifierToInt::class, + PropertyModifierTrim::class, + PropertyModifierUppercase::class, + PropertyModifierUpperCaseFirst::class, + PropertyModifierURLEncode::class, + PropertyModifierUuidBinToHex::class, + PropertyModifierXlsNumericIp::class, + ] +]; + +foreach ($directorHooks as $type => $classNames) { + foreach ($classNames as $className) { + $this->provideHook($type, $className); + } +} |