Forum Discussion
gerald_wegener_
Nimbostratus
Sep 23, 2008pycontrol - upload data group external file
I am a pycontrol newbie and have been unable to figure out how to reload a data group list (external) file once it has be edited. The name of the data group is 'blacklisttest' type:external contents:address and the external file location/name is /var/class/blacklist. I basically copy the blacklisted file to bipip and would like a way to activate rather than using 'b load'
I can see how to use 'get' using pycontrol but can't figure out how to reload the class file:
b.LocalLB_Class.get_external_class_file_name(class_names = ['blacklisttest'])
{'return': ['/var/class/blacklist']}
Thank you for any help.
8 Replies
Sort By
- There isn't a "load class" command per-say. As far as I know the only way to forcefully reload an external class is to do a configuration load (b load, or System.ConfigSync.install_configuration()). I'm not sure if this will work, but you could try to make a call to set_external_class_file_name to a different value and then back to your target file. This may cause the system to reload it since it's a different file. Not sure, but worth a try.
- gerald_wegener_
Nimbostratus
Thanks Joe. Is there some way to issue a 'b load' using pycontrol? - gerald_wegener_
Nimbostratus
Oh yeah I forgot to mention that - As you sugested I did try doing a: - The System.ConfigSync.download_configuration() method will download the compressed configuration archive (*.ucs) files from the BIG-IP to your local system. See my tech tip on configuration archiving for more details on how this method works:
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=259
- Actually, I just saw this on an internal thread that if you want to force a reload of a external class, all you need to do is to change one of the attributes on the class. Changing the filename, type, or mode will force a reload. So, the easiest way would likely be to call the LocalLB.Class.set_external_class_file_mode method toggling the class from FILE_MODE_TYPE_READ_WRITE to FILE_MODE_TYPE_READ.
- gerald_wegener_
Nimbostratus
- L4L7_53191
Nimbostratus
What BigIP version are you running? The pyControl library is essentially just a wrapper for the iControl calls, so this seems surprising. I will try as well and see what I get. - gerald_wegener_
Nimbostratus
9.3.1 HF3
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