You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started a branch in order to create more objects to make using the library easier.
The plan is to separate out the backends and servers into objects that can be controlled and queried indepently using object methods. I just wanted to share what I will be doing in case you had different design goals or additional input. So for example.
instance.backends.first.servers# returns a list of servers in the backendinstance.backends.first.name# backend nameinstance.backends.first.stats# returns statsinstance.backends.first.downtime# returns downtime stat
instance.servers.first.name# returns the server name/idinstance.servers.first.stats# returns the stats of the serverinstance.servers.first.downtime# returns the downtime statinstance.servers.first.backends# returns the backends the server belongs toinstance.servers.first.disable(backend='all')# disables the server for the backend(s)
I plan to use method_missing to create dynamic methods for stats so that each object appears to have implemented a method to return a paticular stat. This will be in the server and backend object.
example:
defmethod_missing(method, *args, &block)if not stats.has_key?(method.to_s)raiseNoMethodErrorelsestats[method.to_s]endend
I started a branch in order to create more objects to make using the library easier.
The plan is to separate out the backends and servers into objects that can be controlled and queried indepently using object methods. I just wanted to share what I will be doing in case you had different design goals or additional input. So for example.
I plan to use method_missing to create dynamic methods for stats so that each object appears to have implemented a method to return a paticular stat. This will be in the server and backend object.
example:
https://github.com/logicminds/haproxy_manager/blob/backend_class/lib/haproxy_manager
The text was updated successfully, but these errors were encountered: