Forum Discussion
6 Replies
- uni_87886Cirrostratus
Could you show the entire request? It should be just
"persist":"none"
- Rudra_MahapatraNimbostratus
Thanks Uni for responding...
I am using HPE OO rest API PUT operation. I have specified {"persist":"none"} in body of request. And I am getting following error --> {"code":404,"message":"01020036:3: The requested persist profile (none) was not found.","errorStack":[]}
As mentioned earlier, it works fine when I provide {"persist":"dest_addr"} or {"persist":"source_addr"}
Regards,
- uniAltostratus
Could you show the entire request? It should be just
"persist":"none"
- Rudra_MahapatraNimbostratus
Thanks Uni for responding...
I am using HPE OO rest API PUT operation. I have specified {"persist":"none"} in body of request. And I am getting following error --> {"code":404,"message":"01020036:3: The requested persist profile (none) was not found.","errorStack":[]}
As mentioned earlier, it works fine when I provide {"persist":"dest_addr"} or {"persist":"source_addr"}
Regards,
- Satoshi_Toyosa1Employee
Use
(without quotation) ornull
(means empty object). Also, use{}
for modification. For example (using curl),PATCH
Check the current persistence configuration of the virtual
(withVS-HTTP
).dest_addr
curl -sku user:pass https:///mgmt/tm/ltm/virtual/VS-HTTP?\$select=persist
Output as below:
{ persist: [ { name: 'dest_addr', partition: 'Common', tmDefault: 'yes', nameReference: { link: 'https://localhost/mgmt/tm/ltm/persistence/dest-addr/~Common~dest_addr?ver=12.1.2' } } ] }
Change it to "none".
curl -sku user:pass https:///mgmt/tm/ltm/virtual/VS-HTTP \ -H "Content-Type: application/json" \ -X PATCH -d '{"persist":{}}'
Now check it again using the GET request. The output should show:
{}
See also "About null values and properties" section of iControl® REST API User Guide, Version 12.1.0, p. 18.
- webguy96Nimbostratus
I would agree the behavior on this seems to not follow some other API calls, however, the code below should work if you don't mind seeing it in PowerShell.
$link = "https://${bigip}/ltm/virtual/~${partition}~${vs}" $hash = @{} $hash.Add("name", ${vs}) $hash.Add("partition", ${partition}) $hash.Add("tmDefault", "yes") $hash.Add("persist", $null)
$json = $hash | ConvertTo-Json
Invoke-RestMethod -Method Patch -Uri ${link} -Credential ${cred} -Body ${json} -ContentType 'application/json' -ErrorAction Stop