Forum Discussion
Satoshi_Toyosa1
Dec 10, 2018Employee
I do not know PowerShell, but from the error message,
The requested virtual server
(/Common/iControl.CommonVirtualServerDefinition) was not found
, I would say that the virtual does not exist. Check if exists.
If that's not the case, I suspect the data format of the persistence profile(s). It must be given in array (
[]
). For example, to perform the task equivalent to the following tmsh command (adding cookie
persistence profile to the virtual vs
😞
tmsh modify ltm virtual vs persist replace-all-with { cookie }
You need to PATCH the
/mgmt/tm/ltm/virtual/vs
endpoint with the data {"persist":[ {"name":"cookie"} ]}
.
A curl call looks like this:
curl -sku : https:///mgmt/tm/ltm/virtual/vs \
-X PATCH -H "Content-type: application/json" \
-d '{"persist":[ {"name":"cookie"} ]}'