Forum Discussion
Satoshi_Toyosa1
Aug 21, 2017Employee
Hi Roger,
I assume this is the task you want to do:
tmsh:
modify ltm pool members modify { { ratio } }
iControl REST (curl):
curl -sku -H "Content-type: application/json" -X PATCH -d '{"ratio":}' https:///mgmt/tm/ltm/pool//members/
e.g. (changing the ratio of the member ~Commmon~apache:80 in the pool CentOS to 10),
curl -sku admin:admin -H "Content-type: application/json" -X PATCH
-d '{"ratio":10}'
https://192.168.0.2/mgmt/tm/ltm/pool/CentOS/members/~Common~apache:80
A Python code for the above example would look like this (there should be better ways to do this):
from f5.bigip import ManagementRoot
mgmt = ManagementRoot('192.168.0.2', 'admin', 'admin')
pool = mgmt.tm.ltm.pools.pool.load(name='CentOS', partition='Common')
members = pool.members_s.get_collection()
for member in members:
print '{}: Ratio {}'.format(member.name, member.ratio)
if member.name == 'apache:80':
member.update(ratio=10)
break