timbo_8_2_29918
Sep 12, 2018Nimbostratus
Rest APi Update iRule
Hi There
I have been researching this all day and cannot seem to get a solution. I am trying to "Update" an iRUle using the Rest API. Im using powershell and am getting the below error:
Invoke-RestMethod : {"code":400,"message":"incomplete command","errorStack":[],"apiError":26214401}
here is my code:
$body = @{apiAnonymous = 'Redirect Traffic to 2 pools based on the URI
when HTTP_REQUEST {
if {[string tolower [HTTP::uri]] contains "/1111/"} {
pool A
} else {
pool B
}
'} | ConvertTo-Json
Invoke-RestMethod -Method PATCH -Uri "https://1.1.1.1/mgmt/tm/ltm/rule/~Partition~coolirule" -Credential $mycreds -body $body -ContentType "application/json"
The only information i can find on this suggests that i delete my iRule and create a new one.... i would like to try and avoid this if i can.
Regards Tim