F5Networks / f5-openstack-agent

The F5 Agent for OpenStack Neutron allows you to deploy BIG-IP services in an OpenStack environment.
http://clouddocs.f5.com/products/openstack/agent/latest
Apache License 2.0
14 stars 38 forks source link

Implement lbaas-loadbalancer-stats command #40

Closed jlongstaf closed 7 years ago

jlongstaf commented 8 years ago

Add support for returning load balancer stats: active_connections bytes_in bytes_out total_connections

swormke commented 8 years ago

@jlongstaf as we discussed today here is an example using f5-sdk as is today to get the stats for all pool members. The stats will be a dictionary after the json() call.

pool = bigip.ltm.pools.pool.load(name=pool_name, partition=pool_partition)
for member in pool.members_s.get_collection():
    resp = bigip._meta_data['icr_session'].get(member._meta_data['uri'] + 'stats')
    stats = resp.json()

@zancas does have the Stat object in his backlog (F5Networks/f5-common-python#293) , but for now you can use the above to make progress. We can come back as part of phase 2 and refactor to use the new object when it is done.