Os_slb:: passive_persist($method, $string), Return values, Example – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual
Page 109: Context, Usage, Input parameters
Brocade Virtual ADX OpenScript API Guide
97
53-1003243-01
Methods
7
Return Values
None
Example
OS_SLB:: passive_persist($method, $string)
Causes the system to add a persist entry to the system.
Context
This function can be called from HTTP events.
Usage
Can be used with the persist action to perform passive persist.
Input Parameters
The following table contains the input values.
Return Values
None
Example
TABLE 120
Input Values
Name
Type
Description
$method
method
Either value of add or delete.
$string
string
The string to persist on.
use OS_HTTP_REQUEST;
use OS_SLB;
sub HTTP_REQUEST{
OS_SLB::persist("hash-to-bucket", OS_HTTP_REQUEST::url);
}
use OS_SLB;
use OS_HTTP_RESPONSE;
sub HTTP_RESPONSE {
$mySetCookieHeader = OS_HTTP_RESPONSE::header("Set-Cookie");
if ( $mySetCookieHeader =~ m/.*ServerID=(\d+).*/ ) {
$CookieValue = $1;
OS_SLB::passive_persist("add","$CookieValue");
}
}