mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
31 lines
1.1 KiB
PowerShell
31 lines
1.1 KiB
PowerShell
|
|
function New-IcingaForWindowsRESTEnvironment()
|
||
|
|
{
|
||
|
|
param (
|
||
|
|
[int]$ThreadCount = 5
|
||
|
|
);
|
||
|
|
|
||
|
|
$Global:Icinga.Public.Daemons.Add(
|
||
|
|
'RESTApi',
|
||
|
|
@{
|
||
|
|
'ApiRequests' = @{ };
|
||
|
|
'ApiCallThreadAssignment' = @{ };
|
||
|
|
'TotalThreads' = $ThreadCount;
|
||
|
|
'LastThreadId' = 0;
|
||
|
|
# This will add another hashtable to our previous
|
||
|
|
# IcingaPowerShellRestApi hashtable to store actual
|
||
|
|
# endpoint configurations for the API
|
||
|
|
'RegisteredEndpoints' = @{ };
|
||
|
|
# This will add another hashtable to our previous
|
||
|
|
# IcingaPowerShellRestApi hashtable to store actual
|
||
|
|
# command aliases for execution for the API
|
||
|
|
'CommandAliases' = @{ };
|
||
|
|
# This will add another hashtable to our previous
|
||
|
|
# IcingaPowerShellRestApi hashtable to store actual
|
||
|
|
# command aliases for execution for the API
|
||
|
|
'ClientBlacklist' = @{ };
|
||
|
|
}
|
||
|
|
);
|
||
|
|
|
||
|
|
Add-IcingaThreadPool -Name 'RESTApiPool' -MaxInstances ($ThreadCount * 2);
|
||
|
|
}
|