Forum Discussion
mhite_60883
Mar 24, 2011Cirrocumulus
set_address_class_member_data_value method help
Hello! I'm having no luck getting the set_address_class_member_data_value method to work.
In short, I'm issuing the following API command using pycontrol:
c.set_address_class_member_data_value([dealloc_address_class], [["pending"]])
where c is a BIG-IP class object.
dealloc_address_class contains:
(LocalLB.Class.AddressClass){
name = "dev_staging_allocation"
members[] =
(LocalLB.Class.AddressEntry){
address = "5.5.5.7"
netmask = "255.255.255.255"
},
}
"dev_staging_allocation" is a class/data-group on the BIG-IP that contains a list of "unallocated" IP addresses.
I am trying to update the associated value -- which is currently the string "unallocated" -- and want to change it to "pending." The API call succeeds with no error but the value is not updated on the BIG-IP. I see the following in the icontrol debug logs:
Mar 23 16:08:06 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB:-------------------------------------
Mar 23 16:08:06 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: Portal:User/Partition map:
Mar 23 16:08:06 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: Portal: User: admin, Partition: Common
Mar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB:+++++++++++++++++++++++++++++++++++++
Mar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB:Class::set_address_class_member_data_value ( ) called by user "admin"
Mar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB: Class name: dev_staging_allocation
Mar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB: Value class members:
Mar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB: [0] 5.5.5.7/255.255.255.255 -> p[<)(0[?[HdHdhV`:`:[ar 23 16:08:07 local/s0-bigip-lb2 debug iControlPortal.cgi[16402]: LocalLB:---------------------------------
The garbage characters in the last log line are obviously concerning. Any idea what's going on?
- L4L7_53191NimbostratusI think so. Let me look at this and get back to you (on list). I want to get a working sample going that is clear - these can be tricky.
- mhite_60883CirrocumulusThanks for checking it out, Matt. You are a scholar and a gentleman!
- L4L7_53191NimbostratusOk. First off, let me give you a heads up in advance: this one is odd, and it's definitely one of the outliers I've seen in the API. So typically we do a SequenceSequence object like this to represent the items:
c = b.LocalLB.Class Setup our types. add_entry = c.typefactory.create('LocalLB.Class.AddressEntry') cl_member = c.typefactory.create('LocalLB.Class.AddressClass') seq = c.typefactory.create('Common.StringSequence') seq_seq = c.typefactory.create('Common.StringSequenceSequence') Set our attributes. add_entry.address='192.168.1.100' add_entry.netmask='255.255.255.255' cl_member.name = 'dc-post' cl_member.members = [add_entry] Ok, now for the wierd part. seq.values = ['MY_NEW_VALUE'] seq_seq.items = [seq.values] orig_val = c.get_address_class_member_data_value(class_members = [cl_member]) print "Here is the original value: ", orig_val print "Setting new value..." c.set_address_class_member_data_value(class_members = [cl_member],values= [seq_seq]) new_val = c.get_address_class_member_data_value(class_members = [cl_member]) print "Getting new value...", new_val
- mhite_60883CirrocumulusIt works! You made my day -- thanks. I'd gladly buy you and our D. Whitt friend a beer or two for your time and help!
- L4L7_53191NimbostratusSweet! Come out to the customer summit in Chicago this year and I'll take you up on the offer :)
- mhite_60883CirrocumulusAs long as it's not a winter conference in Chicago ;)
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