icinga-powershell-framework/lib/daemons/RestAPI/tools/New-IcingaForWindowsRESTEnvironment.psm1

31 lines
1.1 KiB
PowerShell
Raw Normal View History

2021-12-09 11:42:06 -05:00
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);
}