avi.vs.persist

DataScript

Function avi.vs.persist()
Description Load balances the request to the optional provided Pool or the pool attached to the virtual service.
This function also creates a key-value persistence entry for the same. The key being the passed parameter and value being the load balanced IP,port (Eg: 10.10.10.10-80).
Optional lifetime ensures that the persistence table entry is created with the passed lifetime.
The default is 300s.
Under the hood, this API, performs traditional load balancing and automatically creates a persistence table entry with value being the load balanced backend server.
Repeatedly calling out this API will refresh the timeout.
Events VS_DATASCRIPT_EVT_L4_REQUEST
Parameter Key , [lifetime], [pool]
Returns No return value
Example

if username == “my_user” then
avi.vs.persist(username, 3600, “POOL_80”)


Note: In Avi Vantage release 18.2.3, this API yields from a DataScript and no further statements after this API will run. This is a terminal API.