Forum Discussion
How to check existing persistence profiles with iControl REST python SDK?
Sorry, I'm not familiar with Python, but here's a fragment of how I populate an html option field with perl. Notice there are 2 persist types I'm fetching: source-addr, and cookie.
@PersistTypes = ("source-addr", "cookie");
foreach (@PersistTypes) {
$line = "";
$PFILE="";
open($PFILE, '-|', 'curl -k -u' . $F5User . ":" . $F5Pass . ' -v https://' . $LTM . '/mgmt/tm/ltm/persistence/' . $_ . '?\$select=name 2>/dev/null') or die $!;
while ($line = <$PFILE>) {
$line =~ s{^.*[}{}; Remove everything up to and including the 1st "["
$line =~ tr/]{]"}//d;
$line =~ s/name://g;
push (@Persist, split(',',$line));
} End while
close($PFILE);
} End foreach (@PersistTypes)
foreach $PersistItem (@Persist) {
if ($PersistItem eq $PersistProfile) {
$PersistValues .= "$PersistItem";
}
else {
$PersistValues .= "$PersistItem";
}
} End foreach $PersistItem (@Persist)
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com