Skip to content
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
merged 8 commits into from
Oct 9, 2017
Merged

[api] collect instance configurations via API #156

merged 8 commits into from
Oct 9, 2017

Conversation

truthbk
Copy link
Member

@truthbk truthbk commented Sep 22, 2017

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 for Jackson 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 and HttpClient.HttpResponse classes have been introduced. Do not expect HttpClient 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.

@truthbk
Copy link
Member Author

truthbk commented Sep 22, 2017

Tests broken on JDK6 - will look into it. So we don't need to test building on Java6, it's near EOL and we can easily target the JVM6 with the right -target switch. So.... removing it from the actual CI won't cause any harm.

[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
@@ -42,7 +42,7 @@
private long lastCollectionTime;
private Integer minCollectionPeriod;
private long lastRefreshTime;
private LinkedHashMap<String, Object> yaml;
private LinkedHashMap<String, Object> instanceMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍰

@truthbk truthbk added this to the 0.18.0 milestone Oct 9, 2017
@truthbk truthbk merged commit c36514e into master Oct 9, 2017
@truthbk truthbk deleted the jaime/ad6 branch October 9, 2017 16:53
truthbk added a commit that referenced this pull request Sep 14, 2020
truthbk added a commit that referenced this pull request Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants