Adds help for several Cmdlets

This commit is contained in:
Lord Hepipud 2020-04-28 15:24:57 +02:00
parent 00990c52e1
commit 7fa21a8f86
11 changed files with 225 additions and 0 deletions

View file

@ -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() function Get-IcingaDirectorSelfServiceConfig()
{ {
param( param(

View file

@ -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() function Get-IcingaDirectorSelfServiceTicket()
{ {
param( param(

View file

@ -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() function Register-IcingaDirectorSelfServiceHost()
{ {
param( param(

View file

@ -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() function Get-IcingaConfigTreeCount()
{ {
param( param(

View file

@ -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() function Get-IcingaPowerShellConfig()
{ {
param( param(

View file

@ -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() function New-IcingaPowerShellConfigItem()
{ {
param( param(

View file

@ -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() function Read-IcingaPowerShellConfig()
{ {
$ConfigDir = Get-IcingaPowerShellConfigDir; $ConfigDir = Get-IcingaPowerShellConfigDir;

View file

@ -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() function Remove-IcingaPowerShellConfig()
{ {
param( param(

View file

@ -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() function Set-IcingaPowerShellConfig()
{ {
param( param(

View file

@ -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() function Test-IcingaPowerShellConfigItem()
{ {
param( param(

View file

@ -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() function Write-IcingaPowerShellConfig()
{ {
param( param(