diff --git a/lib/apis/Get-IcingaDirectorSelfServiceConfig.psm1 b/lib/apis/Get-IcingaDirectorSelfServiceConfig.psm1 index f934f26..e6614c4 100644 --- a/lib/apis/Get-IcingaDirectorSelfServiceConfig.psm1 +++ b/lib/apis/Get-IcingaDirectorSelfServiceConfig.psm1 @@ -1,3 +1,27 @@ +<# +.SYNOPSIS + Will fetch the current host configuration or general configuration depending + if a host or template key is specified from the Icinga Director Self-Service API +.DESCRIPTION + Use the Self-Service API of the Icinga Director to connect to it and fetch the + configuration to apply for this host. The configuration itself is differentiated + if a template or the specific host key is used +.FUNCTIONALITY + Fetches host or general configuration form the Icinga Director Self-Service API +.EXAMPLE + PS>Get-IcingaDirectorSelfServiceConfig -DirectorUrl 'https://example.com/icingaweb2/director -ApiKey 457g6b98054v76vb5490ß276bv0457v6054b76; +.PARAMETER DirectorUrl + The URL pointing directly to the Icinga Web 2 Director module +.PARAMETER ApiKey + Either the template or host key to authenticate against the Self-Service API +.INPUTS + System.String +.OUTPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Get-IcingaDirectorSelfServiceConfig() { param( diff --git a/lib/apis/Get-IcingaDirectorSelfServiceTicket.psm1 b/lib/apis/Get-IcingaDirectorSelfServiceTicket.psm1 index 48fca58..2e2bfaa 100644 --- a/lib/apis/Get-IcingaDirectorSelfServiceTicket.psm1 +++ b/lib/apis/Get-IcingaDirectorSelfServiceTicket.psm1 @@ -1,3 +1,26 @@ +<# +.SYNOPSIS + Will fetch the ticket for certificate signing by using the Icinga Director + Self-Service API +.DESCRIPTION + Use the Self-Service API of the Icinga Director to connect to it and fetch the + ticket to sign Icinga 2 certificate requests +.FUNCTIONALITY + Fetches the ticket for certificate signing form the Icinga Director Self-Service API +.EXAMPLE + PS>Get-IcingaDirectorSelfServiceTicket -DirectorUrl 'https://example.com/icingaweb2/director -ApiKey 457g6b98054v76vb5490ß276bv0457v6054b76; +.PARAMETER DirectorUrl + The URL pointing directly to the Icinga Web 2 Director module +.PARAMETER ApiKey + The host key to authenticate against the Self-Service API +.INPUTS + System.String +.OUTPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Get-IcingaDirectorSelfServiceTicket() { param( diff --git a/lib/apis/Register-IcingaDirectorSelfServiceHost.psm1 b/lib/apis/Register-IcingaDirectorSelfServiceHost.psm1 index f5503d5..633a954 100644 --- a/lib/apis/Register-IcingaDirectorSelfServiceHost.psm1 +++ b/lib/apis/Register-IcingaDirectorSelfServiceHost.psm1 @@ -1,3 +1,33 @@ +<# +.SYNOPSIS + Register the current host wihtin the Icinga Director by using the + Self-Service API and return the host key +.DESCRIPTION + This function will register the current host within the Icinga Director in case + it is not already registered and returns the host key for storing it on disk + to allow the host to fetch detailed configurations like zones and endppoints +.FUNCTIONALITY + Register a host within the Icinga Director by using the Self-Service API +.EXAMPLE + PS>Register-IcingaDirectorSelfServiceHost -DirectorUrl 'https://example.com/icingaweb2/director -Hostname 'examplehost' -ApiKey 457g6b98054v76vb5490ß276bv0457v6054b76 -Endpoint 'icinga.example.com'; +.PARAMETER DirectorUrl + The URL pointing directly to the Icinga Web 2 Director module +.PARAMETER Hostname + The name of the current host to register within the Icinga Director +.PARAMETER ApiKey + The template key to authenticate against the Self-Service API +.PARAMETER Endpoint + The IP or FQDN to one of the parent Icinga 2 nodes this Agent will connect to + for determining which network interface shall be used by Icinga for connecting + and to apply hostalive/ping checks to +.INPUTS + System.String +.OUTPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Register-IcingaDirectorSelfServiceHost() { param( diff --git a/lib/config/Get-IcingaConfigTreeCount.psm1 b/lib/config/Get-IcingaConfigTreeCount.psm1 index a295d52..67f76a9 100644 --- a/lib/config/Get-IcingaConfigTreeCount.psm1 +++ b/lib/config/Get-IcingaConfigTreeCount.psm1 @@ -1,3 +1,22 @@ +<# +.SYNOPSIS + Returns the amount of items for a config item +.DESCRIPTION + Returns the amount of items for a config item +.FUNCTIONALITY + Returns the amount of items for a config item +.EXAMPLE + PS>Get-IcingaConfigTreeCount -Path 'framework.daemons'; +.PARAMETER Path + The path to the config item to check for +.INPUTS + System.String +.OUTPUTS + System.Integer +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Get-IcingaConfigTreeCount() { param( diff --git a/lib/config/Get-IcingaPowerShellConfig.psm1 b/lib/config/Get-IcingaPowerShellConfig.psm1 index 65abd70..4aed09d 100644 --- a/lib/config/Get-IcingaPowerShellConfig.psm1 +++ b/lib/config/Get-IcingaPowerShellConfig.psm1 @@ -1,3 +1,22 @@ +<# +.SYNOPSIS + Returns the configuration for a provided config path +.DESCRIPTION + Returns the configuration for a provided config path +.FUNCTIONALITY + Returns the configuration for a provided config path +.EXAMPLE + PS>Get-IcingaPowerShellConfig -Path 'framework.daemons'; +.PARAMETER Path + The path to the config item to check for +.INPUTS + System.String +.OUTPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Get-IcingaPowerShellConfig() { param( diff --git a/lib/config/New-IcingaPowerShellConfigItem.psm1 b/lib/config/New-IcingaPowerShellConfigItem.psm1 index ddff776..2de7a6a 100644 --- a/lib/config/New-IcingaPowerShellConfigItem.psm1 +++ b/lib/config/New-IcingaPowerShellConfigItem.psm1 @@ -1,3 +1,24 @@ +<# +.SYNOPSIS + Creates a new config entry with given arguments +.DESCRIPTION + Creates a new config entry with given arguments +.FUNCTIONALITY + Creates a new config entry with given arguments +.EXAMPLE + PS>New-IcingaPowerShellConfigItem -ConfigObject $PSObject -ConfigKey 'keyname' -ConfigValue 'keyvalue'; +.PARAMETER ConfigObject + The custom config object to modify +.PARAMETER ConfigKey + The key which is added to the config object +.PARAMETER ConfigValue + The value written for the ConfigKey +.INPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function New-IcingaPowerShellConfigItem() { param( diff --git a/lib/config/Read-IcingaPowerShellConfig.psm1 b/lib/config/Read-IcingaPowerShellConfig.psm1 index cf989f2..84d74af 100644 --- a/lib/config/Read-IcingaPowerShellConfig.psm1 +++ b/lib/config/Read-IcingaPowerShellConfig.psm1 @@ -1,3 +1,18 @@ +<# +.SYNOPSIS + Reads the entire configuration and returns it as custom object +.DESCRIPTION + Reads the entire configuration and returns it as custom object +.FUNCTIONALITY + Reads the entire configuration and returns it as custom object +.EXAMPLE + PS>Read-IcingaPowerShellConfig; +.OUTPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Read-IcingaPowerShellConfig() { $ConfigDir = Get-IcingaPowerShellConfigDir; diff --git a/lib/config/Remove-IcingaPowerShellConfig.psm1 b/lib/config/Remove-IcingaPowerShellConfig.psm1 index a6c0dfd..a9a9ab6 100644 --- a/lib/config/Remove-IcingaPowerShellConfig.psm1 +++ b/lib/config/Remove-IcingaPowerShellConfig.psm1 @@ -1,3 +1,20 @@ +<# +.SYNOPSIS + Removes a config entry from a given path +.DESCRIPTION + Removes a config entry from a given path +.FUNCTIONALITY + Removes a config entry from a given path +.EXAMPLE + PS>Remove-IcingaPowerShellConfig -Path 'framework.daemons'; +.PARAMETER Path + The path to the config item to remove +.INPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Remove-IcingaPowerShellConfig() { param( diff --git a/lib/config/Set-IcingaPowerShellConfig.psm1 b/lib/config/Set-IcingaPowerShellConfig.psm1 index 195d6e1..c5b6069 100644 --- a/lib/config/Set-IcingaPowerShellConfig.psm1 +++ b/lib/config/Set-IcingaPowerShellConfig.psm1 @@ -1,3 +1,22 @@ +<# +.SYNOPSIS + Sets a config entry for a given path to a certain value +.DESCRIPTION + Sets a config entry for a given path to a certain value +.FUNCTIONALITY + Sets a config entry for a given path to a certain value +.EXAMPLE + PS>Set-IcingaPowerShellConfig -Path 'framework.daemons.servicecheck' -Value $DaemonConfig; +.PARAMETER Path + The path to the config item to be set +.PARAMETER Value + The value to be set for a specific config path +.INPUTS + System.String +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Set-IcingaPowerShellConfig() { param( diff --git a/lib/config/Test-IcingaPowerShellConfigItem.psm1 b/lib/config/Test-IcingaPowerShellConfigItem.psm1 index 95c3fe4..e910ef1 100644 --- a/lib/config/Test-IcingaPowerShellConfigItem.psm1 +++ b/lib/config/Test-IcingaPowerShellConfigItem.psm1 @@ -1,3 +1,24 @@ +<# +.SYNOPSIS + Test if a config entry on an object is already present +.DESCRIPTION + Test if a config entry on an object is already present +.FUNCTIONALITY + Test if a config entry on an object is already present +.EXAMPLE + PS>Test-IcingaPowerShellConfigItem -ConfigObject $PSObject -ConfigKey 'keyname'; +.PARAMETER ConfigObject + The custom config object to check for +.PARAMETER ConfigKey + The key which is checked +.INPUTS + System.String +.OUTPUTS + System.Boolean +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Test-IcingaPowerShellConfigItem() { param( diff --git a/lib/config/Write-IcingaPowerShellConfig.psm1 b/lib/config/Write-IcingaPowerShellConfig.psm1 index 3dfbdda..5375c8d 100644 --- a/lib/config/Write-IcingaPowerShellConfig.psm1 +++ b/lib/config/Write-IcingaPowerShellConfig.psm1 @@ -1,3 +1,20 @@ +<# +.SYNOPSIS + Writes a given config object to disk +.DESCRIPTION + Writes a given config object to disk +.FUNCTIONALITY + Writes a given config object to disk +.EXAMPLE + PS>Write-IcingaPowerShellConfig -Config $PSObject; +.PARAMETER Config + A PSObject containing the entire configuration to write +.INPUTS + System.Object +.LINK + https://github.com/Icinga/icinga-powershell-framework +#> + function Write-IcingaPowerShellConfig() { param(