consul/command
Matt Keeler afa1cc98d1
Implement data filtering of some endpoints (#5579)
Fixes: #4222 

# Data Filtering

This PR will implement filtering for the following endpoints:

## Supported HTTP Endpoints

- `/agent/checks`
- `/agent/services`
- `/catalog/nodes`
- `/catalog/service/:service`
- `/catalog/connect/:service`
- `/catalog/node/:node`
- `/health/node/:node`
- `/health/checks/:service`
- `/health/service/:service`
- `/health/connect/:service`
- `/health/state/:state`
- `/internal/ui/nodes`
- `/internal/ui/services`

More can be added going forward and any endpoint which is used to list some data is a good candidate.

## Usage

When using the HTTP API a `filter` query parameter can be used to pass a filter expression to Consul. Filter Expressions take the general form of:

```
<selector> == <value>
<selector> != <value>
<value> in <selector>
<value> not in <selector>
<selector> contains <value>
<selector> not contains <value>
<selector> is empty
<selector> is not empty
not <other expression>
<expression 1> and <expression 2>
<expression 1> or <expression 2>
```

Normal boolean logic and precedence is supported. All of the actual filtering and evaluation logic is coming from the [go-bexpr](https://github.com/hashicorp/go-bexpr) library

## Other changes

Adding the `Internal.ServiceDump` RPC endpoint. This will allow the UI to filter services better.
2019-04-16 12:00:15 -04:00
..
acl Handle rules translation when coming from the JSON compat HCL (#5662) 2019-04-15 14:34:36 -04:00
agent Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
catalog Implement data filtering of some endpoints (#5579) 2019-04-16 12:00:15 -04:00
connect Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
debug Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
event Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
exec Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
flags replace old fork of text package (#4501) 2018-08-14 12:23:18 -07:00
forceleave Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
helpers Move data source loading into a command helpers function 2018-05-24 10:34:08 -04:00
info Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
intention Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
join Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
keygen commands: get HTTP API flags for usage automatically 2017-10-18 00:08:45 +02:00
keyring Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
kv Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
leave Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
lock Merge pull request #5376 from hashicorp/fix-tests 2019-04-04 17:09:32 -04:00
maint Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
members Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
monitor Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
operator Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
reload Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
rtt Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
services Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
snapshot Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
tls tls: allow to add ip addresses as Subject Alternative Names when creating certificates (#5602) 2019-04-04 14:32:02 +02:00
validate Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
version commands: run all tests in parallel (again) 2017-10-18 00:08:45 +02:00
watch Pass a testing.T into NewTestAgent and TestAgent.Start (#5342) 2019-02-14 10:59:14 -05:00
commands_oss.go Builtin tls helper (#5078) 2018-12-19 09:22:49 +01:00
registry.go Abandon daemonize for simpler solution (preserving history): 2018-06-25 12:24:10 -07:00