consul/agent/structs
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.go Fixes for CVE-2019-8336 2019-03-04 19:13:24 +00:00
acl_cache.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_cache_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_legacy.go acl: add stub hooks to support some plumbing in enterprise (#4951) 2018-11-13 15:35:54 -06:00
acl_legacy_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_test.go Disregard rules when set on a management token (#5261) 2019-01-23 15:48:38 -05:00
catalog.go
check_definition.go agent: fix formatting 2018-11-07 02:16:03 -08:00
check_definition_test.go agent: fix formatting 2018-11-07 02:16:03 -08:00
check_type.go agent/structs: check is alias if node is empty 2018-07-12 09:36:11 -07:00
config_entry.go Cleaned up some error handling/comments around config entries 2019-04-02 15:42:12 -07:00
connect.go fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
connect_ca.go connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
connect_ca_test.go connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
connect_proxy_config.go Implement data filtering of some endpoints (#5579) 2019-04-16 12:00:15 -04:00
connect_proxy_config_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
connect_test.go
errors.go Implement /v1/agent/health/service/<service name> endpoint (#3551) 2019-01-07 09:39:23 -05:00
intention.go fsm: add Intention operations to transactions for internal use 2018-10-19 10:02:28 -07:00
intention_test.go
operator.go
prepared_query.go Improve Connect with Prepared Queries (#5291) 2019-02-04 09:36:51 -05:00
prepared_query_test.go
sanitize_oss.go acl: add stub hooks to support some plumbing in enterprise (#4951) 2018-11-13 15:35:54 -06:00
service_definition.go fix typos reported by golangci-lint:misspell (#5434) 2019-03-06 11:13:28 -06:00
service_definition_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
snapshot.go
structs.go Implement data filtering of some endpoints (#5579) 2019-04-16 12:00:15 -04:00
structs_filtering_test.go Implement data filtering of some endpoints (#5579) 2019-04-16 12:00:15 -04:00
structs_test.go correct name 2019-01-25 11:00:56 +01:00
testing_catalog.go Add SidecarService Syntax sugar to Service Definition (#4686) 2018-10-10 16:55:34 +01:00
testing_connect_proxy_config.go Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
testing_intention.go
testing_service_definition.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
txn.go txn: update existing txn api docs with new operations 2019-01-15 16:54:07 -08:00