Forum Discussion
gerald_wegener_
Nimbostratus
Feb 11, 2009Writing to an external class file
I've been able to write using the pyControl API to an internal address data group. However when I use the same syntax and substitute a datagroup that uses an external file I don't see any error messages in pyControl but the entry does not get written to the external file. I tried doing a 'b load' thinking that bipip needs to reload the external class file but that still didn't work. As far as I can tell the syntax I'm using is correct.
So my question is -- is it possible to write via the API to an external class file?
Here is the syntax I'm using from pyControl:
First I do the write ip address 172.21.6.1 to data the group 'blacklisttest' which points to an external file in /var/class/ named 'blacklist'
b.LocalLB_Class.add_address_class_member(class_members = [{'members': [{'address': '172.21.6.1', 'netmask': '25
5.255.255.255'}], 'name': 'blacklisttest'}])
Out[25]: {}
When I check for the enty of 172.21.6.1 it's not there:
b.LocalLB_Class.get_address_class(class_names = ['blacklisttest'])
Out[26]:
{'return': [{'members': [{'address': '10.1.1.1',
'netmask': '255.255.255.255'},
{'address': '10.2.2.2',
'netmask': '255.255.255.255'}],
'name': 'blacklisttest'}]}
In [27]:
Thank you for any help.
4 Replies
Sort By
- gerald_wegener_
Nimbostratus
After some addtional testing I can see that the entries are being added somewhere but not to the external file. Once I do a 'b load' only the entries in the hard file remain (the ones I added via the API are gone). Is there someway to force a write to the external file? - The add_* methods are for internal data groups only, external classes are a different beast. There only API's for external classes are to manage the creation of them. These were really meant for larger lists that are managed off device and would be uploaded in-whole by another process.
- Oops, missed your second message. Since you are working with a large number of entries, you'll want to go with an external class. You can refer to my tech top on the File Transfer API's if you need to.
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=144
- gerald_wegener_
Nimbostratus
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