Forum Discussion
rathid
Nimbostratus
Aug 09, 2017Customer persistence profiles
So in our company we have few of application using custom persistence profile but I can get only get persistence timeout value for standard one which are included in f5 sdk those are ssls, cookies d...
Satoshi_Toyosa1
Aug 14, 2017Ret. Employee
A sample code below does something similar to that of tmsh list ltm persistence cookie all-properties.
from sys import argv
from f5.bigip import ManagementRoot
Management IP, user name, and password
mgmt = ManagementRoot("127.0.0.1", "admin", "secret")
cookies = mgmt.tm.ltm.persistence.cookies.get_collection()
print(' of cookie persitence profiles: {}'.format(len(cookies)))
for c in cookies:
print('---- {}'.format(c.name))
for key, value in c.raw.iteritems():
print('{} = {}'.format(key, value))
Sample output (partial). The "cookie-test" is a custom cookie persistence profile, inherited from cookie.
---- cookie-test
selfLink = https://localhost/mgmt/tm/ltm/persistence/cookie/~Common~cookie-test?ver=13.0.0
secure = enabled
generation = 234
matchAcrossServices = disabled
defaultsFromReference = {u'link': u'https://localhost/mgmt/tm/ltm/persistence/cookie/~Common~cookie?ver=13.0.0'}
cookieName = mycookie
defaultsFrom = /Common/cookie
mirror = disabled
hashLength = 0
description = none
method = insert
_meta_data = {'reduction_forcing_pairs': [('enabled', 'disabled'), ('online', 'offline'), ('vlansEnabled', 'vlansDisabled')], 'container': , 'exclusive_attributes': [], 'allowed_commands': [], 'read_only_attributes': [], 'allowed_lazy_attributes': [], 'uri': u'https://192.168.226.148:443/mgmt/tm/ltm/persistence/cookie/~Common~cookie-test/', 'required_json_kind': 'tm:ltm:persistence‌🍪‌cookiestate', 'bigip': , 'icontrol_version': '', 'required_command_parameters': set([]), 'icr_session': , 'required_load_parameters': set(['name']), 'required_creation_parameters': set(['name']), 'creation_uri_frag': '', 'object_has_stats': True, 'creation_uri_qargs': {u'ver': [u'13.0.0']}, 'minimum_version': '11.5.0'}
appService = none
matchAcrossPools = disabled
alwaysSend = disabled
fullPath = /Common/cookie-test
overrideConnectionLimit = disabled
kind = tm:ltm:persistence‌🍪‌cookiestate
name = cookie-test
cookieEncryption = disabled
partition = Common
matchAcrossVirtuals = disabled
expiration = 0
timeout = 180
hashOffset = 0
httponly = enabled
If you want the universal persistence profile(s), change the cookies part to universals (note the last "s"). Try other persistence profiles in the similar manner.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects