Forum Discussion
Adding metadata to an iControl object using pycontrol
- Jan 26, 2016
I'm using bigsuds instead of pycontrol, but I was able to get the following to work on 11.3 and 11.5.3.
import bigsuds b = bigsuds.BIGIP(hostname='1.2.3.4') vip = b.LocalLB.VirtualAddressV2.get_list()[0] b.LocalLB.VirtualAddressV2.add_metadata([vip], [['owner']], [['daryll']]) vip_metadata = b.LocalLB.VirtualAddressV2.get_metadata([vip]) for meta_data in vip_metadata: print b.LocalLB.VirtualAddressV2.get_metadata_value([vip],[[meta_data]])
If you are at the CLI of the bigip and run 'tmsh save sys config', then you should see metadata attached to the vip. Something like this in /config/bipip.conf:
ltm virtual-address /Common/192.168.1.41 { address 192.168.1.41 mask 255.255.255.255 metadata { owner { value daryll } }
Perhaps there is an issue with pycontrol? I used only bigsuds. Please let me know how that works out for you.
-Kelly
I'm using bigsuds instead of pycontrol, but I was able to get the following to work on 11.3 and 11.5.3.
import bigsuds
b = bigsuds.BIGIP(hostname='1.2.3.4')
vip = b.LocalLB.VirtualAddressV2.get_list()[0]
b.LocalLB.VirtualAddressV2.add_metadata([vip], [['owner']], [['daryll']])
vip_metadata = b.LocalLB.VirtualAddressV2.get_metadata([vip])
for meta_data in vip_metadata:
print b.LocalLB.VirtualAddressV2.get_metadata_value([vip],[[meta_data]])
If you are at the CLI of the bigip and run 'tmsh save sys config', then you should see metadata attached to the vip. Something like this in /config/bipip.conf:
ltm virtual-address /Common/192.168.1.41 {
address 192.168.1.41
mask 255.255.255.255
metadata {
owner {
value daryll
}
}
Perhaps there is an issue with pycontrol? I used only bigsuds. Please let me know how that works out for you.
-Kelly
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