-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api] collect instance configurations via API #156
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
truthbk
force-pushed
the
jaime/ad6
branch
2 times, most recently
from
September 25, 2017 08:36
e860011
to
35e6278
Compare
[autodiscovery] check for json configs every iteration - improvments in pipeline. [httpclient] url encoded content type with GETs [httpclient] wrap responses. [api] if response is 204 no updates + method refactor
gmmeyer
approved these changes
Oct 6, 2017
@@ -42,7 +42,7 @@ | |||
private long lastCollectionTime; | |||
private Integer minCollectionPeriod; | |||
private long lastRefreshTime; | |||
private LinkedHashMap<String, Object> yaml; | |||
private LinkedHashMap<String, Object> instanceMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows collecting configurations via the API potentially exposed by the agent.
Gson
is great, but I encountered some issues with the unmarshaling of the JSON, so I eventually switched it out forJackson
which seemed to do the trick just fine with a simpler interface.This PR obsoletes the collection of configurations via named pipes - which was never ideal. The code however has not been removed for legacy reasons, and in fact both options can coexist as sources for the configurations.
To better handle API calls, an
HttpClient
andHttpClient.HttpResponse
classes have been introduced. Do not expectHttpClient
to be entirely generic as it has been designed bearing in mind it's a client for our particular API - more specifically it encapsulates the "authentication" which would be absolutely meaningless on a different API.Refactored a few vars and methods to avoid confusion.
Testing could be perhaps extended and or improved, but a basic case to address the JSON unmarshalling, etc has been added.