hashicorp/serf — pull request #149 by ryanuber (2014-02-27 07:16:24+00:00)
Title: Filter members via RPC

While hacking on a Python Serf client, I realized that all client implementations are going to have to implement tag and status filtering on their own. To me this seemed like something I should be able to ask the agent for using a request body.

This pull shifts the filtering logic from the commands into the agent so that it may be asked to return a subset of members.

I have also slightly changed the regex implementation for tag and status filtering. Previously, asking for something like `role=a` would match things like `role=cache`, `role=database`, etc, but one would expect `role=a` to only return nodes with `role=a` exactly. To fix this, I added line start and end anchors in the regex, so if you really wanted to match all roles containing the letter `a`, you would do something like `role=*a*`, which is more expressive IMO. Also, I added a a substitution so that stars get converted to `.*`. This seems like the more expected functionality of passing stars.

As always, open to thoughts or suggestions on all of this stuff.