Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

Troubleshooting Invoke-RestMethod API call.

Hi Experts, In one of my scenario i am trying to remove iRule from virtual server by calling "Remove-iRuleFromVirtualServer.ps1" which is internally calling below somewhere.

$Result = Invoke-RestMethod @PSBoundParameters but this is throwing me an exception as below and I am not sure where exactly to look into.

Invoke-RestMethod : {"code":400,"message":"\"virtual\" unexpected argument","errorStack":[],"apiError":26214401} At C:\Users\mitesh.neema\Documents\WorkingPSStructure_Copy\Invoke-F5RestMethod.ps1:30 char:19 + $Result = Invoke-RestMethod @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

 Actual file can be found here:

https://github.com/joel74/POSH-LTM-Rest/blob/master/F5-LTM/Public/Invoke-RestMethodOverride.ps1#L26

Notice line number#26.

Any help

0
Rate this Question

Answers to this Question