PowerShell module for the F5 LTM REST API
Running the following...
$LTMCredentials = Get-Credential
$LTMName = "name"
Import-Module F5-LTM
$F5Session = New-F5session -LTMName $LTMName -LTMCredentials $LTMCredentials -PassThrough
Get-Pool -F5Session $F5Session | Select-Object -ExpandProperty fullPath
Gives the following errors:
[BEGIN ERROR MESSAGES]
Supply values for the following parameters: ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null. At C:\Users\a_blashmet\Documents\WindowsPowerShell\Modules\F5-LTM\Private\Invoke-F5RestMethod.ps1:40 char:50 + $message = $_.ErrorDetails.Message | ConvertFrom-json | Select-Objec ... + ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Invoke-F5RestMethod : "401 F5 Authorization Required: At C:\Users\a_blashmet\Documents\WindowsPowerShell\Modules\F5-LTM\Public\New-F5Session.ps1:95 char:13 + $JSON = Invoke-F5RestMethod -Method Get -Uri $VersionURL -F5Session $newSess ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-F5RestMethod
ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null. At C:\Users\a_blashmet\Documents\WindowsPowerShell\Modules\F5-LTM\Private\Invoke-F5RestMethod.ps1:40 char:50 + $message = $_.ErrorDetails.Message | ConvertFrom-json | Select-Objec ... + ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
Invoke-F5RestMethod : "401 F5 Authorization Required: At C:\Users\a_blashmet\Documents\WindowsPowerShell\Modules\F5-LTM\Public\Get-Pool.ps1:32 char:21 + $JSON = Invoke-F5RestMethod -Method Get -Uri $URI -F5Session $F5Sess ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-F5RestMethod
[END ERROR MESSAGES]
The content of $F5Session is:
Name : usdc-ltm-tst-mgmt BaseURL : Credential : System.Management.Automation.PSCredential WebSession : Microsoft.PowerShell.Commands.WebRequestSession LTMVersion :
So the version of the LTM isn't being picked up, which is 11.6, but it's not clear whether the session is established.
Looking at New-F5Session.ps1, it appears the user credentials need access to https://$LTMName/mgmt/tm/ltm/.
When I visit that URI from a browser and enter my credentials, I get:
{"code":401,"message":"Authorization failed: user= resource=/mgmt/tm/ltm verb=GET uri:
I ensured that Terminal Access is set to tmsh for this account and verified that it has Manager access on all partitions.
Is there any other access or config that I am missing?
Thank you for any help.