Forum Discussion
How to Get FailOver Status via iControl REST?
Hello Patric_Jonsson
I use your example in powershell but and error appear
I tried to fix, but there are something that is missed.
Could you re-check the code?
I think that point of view to perform the task to know if the device is active/standby is pretty cool 🙂
PS C:\Windows\system32> $Response = (Invoke-WebRequest -Method "GET" -Headers $headers -Uri "https://$f5/mgmt/tm/cm/failover-status?`$select=status").content | ConvertFrom-Json $content.entries.'https://localhost/mgmt/tm/cm/failover-status/0'.nestedStats.entries.status.description
ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At line:1 char:154
+ ... rtFrom-Json $content.entries.'https://localhost/mgmt/tm/cm/failover-s ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFromJsonCommand
finally I did !!
$response = (Invoke-WebRequest -Method "GET" -Headers $headers -Uri "https://$f5/mgmt/tm/cm/failover-status?`$select=status").content
$qestate = ($response | ConvertFrom-Json).entries.'https://localhost/mgmt/tm/cm/failover-status/0'.nestedStats.entries.status.description
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com