GitHub user cestella opened a pull request:
https://github.com/apache/metron/pull/797
METRON-1243: Add a REST endpoint which allows us to get a list of all
indices
## Contributor Comments
The Alerts UI currently hard-codes the set of indices. It would be
preferred to use the REST API to get a list of index names for a given writer
(e.g. elasticsearch, solr, hdfs).
This functions in the following way:
* If an index config exists, then the index name will be returned. If
unspecified, then the sensor name is used
* If a parser exists and an index does NOT exist, then it will be included.
* If the writer is disabled in the index config, then it will NOT be
included.
Mind, this is a branch off of METRON-1241, so this is going to be messy
until it gets merged. Probably hold off on the review until then.
Test plan coming!
## Pull Request Checklist
Thank you for submitting a contribution to Apache Metron.
Please refer to our [Development
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
for the complete guide to follow for contributions.
Please refer also to our [Build Verification
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
for complete smoke testing guides.
In order to streamline the review of the contribution we ask you follow
these guidelines and ask you to double check the following:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? If not one needs to
be created at [Metron
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [ ] Does your PR title start with METRON-XXXX where XXXX is the JIRA
number you are trying to resolve? Pay particular attention to the hyphen "-"
character.
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically master)?
### For code changes:
- [ ] Have you included steps to reproduce the behavior or problem that is
being changed or addressed?
- [ ] Have you included steps or a guide to how the change may be verified
and tested manually?
- [ ] Have you ensured that the full suite of tests and checks have been
executed in the root metron folder via:
```
mvn -q clean integration-test install && build_utils/verify_licenses.sh
```
- [ ] Have you written or updated unit tests and or integration tests to
verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] Have you verified the basic functionality of the build by building
and running locally with Vagrant full-dev environment or the equivalent?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in
which it is rendered by building and verifying the site-book? If not then run
the following commands and the verify changes via
`site-book/target/site/index.html`:
```
cd site-book
mvn site
```
#### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
It is also recommended that [travis-ci](https://travis-ci.org) is set up
for your personal repository such that your branches are built there before
submitting a pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cestella/incubator-metron all_indices
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/797.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #797
----
commit 0570ba18d773688bfc2d71e2f081155583c21a2e
Author: cstella <[email protected]>
Date: 2017-10-09T19:03:32Z
Abstracting zookeeper substantially.
commit e59a82266c7cefb2a4fe6c033e9b14c2fe7c001b
Author: cstella <[email protected]>
Date: 2017-10-09T20:10:57Z
Updating tests to use the new API.
commit 8d64f05f33bb248ae3306cb580ac589400887b81
Author: cstella <[email protected]>
Date: 2017-10-09T20:15:51Z
Missed a couple of tests.
commit a195ae51e3c5a04079c2b401ae325bcf4e46c05e
Author: cstella <[email protected]>
Date: 2017-10-09T20:32:41Z
moved the cache into commons.
commit 0932c30e9af4b75285c7003e722888e4a5675f9f
Author: cstella <[email protected]>
Date: 2017-10-09T21:15:20Z
Updating test.
commit 7c05716ceb6db505ec323f7b04716df07399a05c
Author: cstella <[email protected]>
Date: 2017-10-09T23:41:44Z
Refactored tests to mock the configurations cache
commit 8a295a271fe94995283e02b2b291f50ec2db30ef
Author: cstella <[email protected]>
Date: 2017-10-10T00:13:41Z
fixing tests.
commit dd41e6ed9a28a3b30102aad76f5396c51cf540f4
Author: cstella <[email protected]>
Date: 2017-10-10T00:54:57Z
Updating some weird bugs.
commit 24df486a0c0d254f14f298ba8fb09e14152a2bf8
Author: cstella <[email protected]>
Date: 2017-10-10T01:47:05Z
updating config test.
commit e6d48efd03bd848ca4eefd11c4277b2148550330
Author: cstella <[email protected]>
Date: 2017-10-10T02:42:48Z
Updating log4j properties to debug travis.
commit 3e320d63512a860f571ee3fc0a8b41fa98b7558d
Author: cstella <[email protected]>
Date: 2017-10-10T02:59:00Z
updating with better logging
commit 09019a52a4c689cdb71b512643c6f381dec114cf
Author: cstella <[email protected]>
Date: 2017-10-10T03:17:20Z
reducing logging.
commit 9948df08bd2dc7a11e10bf800fe71427ba482b44
Author: cstella <[email protected]>
Date: 2017-10-10T03:41:32Z
Removing debugging
commit 9134b81a5e1d5200e698131b0f66fc3ea015c56b
Author: cstella <[email protected]>
Date: 2017-10-10T03:45:41Z
Better error debugging...
commit bbe87c5f1e29cb362f0dac90eb33f537285c1b27
Author: cstella <[email protected]>
Date: 2017-10-10T03:47:21Z
Warn level.
commit 105127ed32003f0defdc7a7bed1f7357a69128ab
Author: cstella <[email protected]>
Date: 2017-10-10T03:55:34Z
Small error in getTypes()
commit 475853cb72ab891ead4a360ca37c0e53035ba183
Author: cstella <[email protected]>
Date: 2017-10-10T04:36:11Z
Updating configurations util
commit a0ce71be196b6c8c068a2f4ee4697af5a4e8d0f1
Author: cstella <[email protected]>
Date: 2017-10-10T04:45:35Z
Updating integration tests.
commit c3c3c36e664c9e9216e04c72a06005a37d2a2652
Author: cstella <[email protected]>
Date: 2017-10-10T06:21:18Z
Fixing tests.
commit a13c24a8daaf303704dc1313387b04f415cb236f
Author: cstella <[email protected]>
Date: 2017-10-10T14:54:59Z
Updating infrastructure to be more spring-friendly.
commit 316eb5e24f6e46cd7d4364532834a460eeeac898
Author: cstella <[email protected]>
Date: 2017-10-10T15:45:56Z
Fixed test.
commit e476cbaf5600f9428edffb25cd570eea90c8d957
Author: cstella <[email protected]>
Date: 2017-10-10T16:16:45Z
Updating test to not be so chatty.
commit 0cb5bbcdfe1e17212620c752c200b78fe7ca6106
Author: cstella <[email protected]>
Date: 2017-10-10T20:48:00Z
Found another classpath bug...
commit 8afa6c40733a2b53fb1d7a39264bc43ab9fb43a5
Author: cstella <[email protected]>
Date: 2017-10-10T22:13:09Z
Add a rest endpoint that returns the list of indices based on zookeeper
configs.
commit b3f1fb8d37430c2a6d306817ee5c8832ce9054cc
Author: cstella <[email protected]>
Date: 2017-10-10T22:26:31Z
Updating functionality to take into account whether the index is enabled or
disabled
----
---