[hlrc] add index templates exist API#36132
Conversation
This commit adds support for the index templates exist API, using the existing GetIndexTemplatesRequest request object. Also adds links to the index template APIs which are supported in the client
|
Pinging @elastic/es-core-features |
hub-cap
left a comment
There was a problem hiding this comment.
Only real issue is that you dont have a request class thats not a server based request class. Please duplicate it and remove all the server junk from it and this should be good to go.
| throw new IllegalArgumentException("Must provide at least one index template name"); | ||
| } | ||
|
|
||
| if (Arrays.stream(getIndexTemplatesRequest.names()).anyMatch(indexTemplate -> Strings.hasText(indexTemplate) == false)) { |
There was a problem hiding this comment.
Can you create a copy of GetIndexTemplatesRequest and move the validation into that instead? Put it in o.e.client.indices. Also remove all of the to/from transport action stuff, and do your best to make constructor params final.
|
@hub-cap I pushed changes for a new |
hub-cap
left a comment
There was a problem hiding this comment.
Awesome, 2 nit/question, hopefully they work out. But I dont need to see this again, the new client side object looks way better than the old one. Great job.
| /** | ||
| * @return the timeout for waiting for the master node to respond | ||
| */ | ||
| public TimeValue getMasterNodeTimeout() { |
There was a problem hiding this comment.
check out TimedRequest, see if it will work here.
There was a problem hiding this comment.
The API doesn't support the timeout parameter that TimedRequest has - I figured it was less bad to duplicate it here vs. have the timeout methods unsupported in this class
| final Optional<ValidationException> parent = super.validate(); | ||
| final ValidationException validationException = parent.orElse(new ValidationException()); | ||
| if (names().isEmpty()) { | ||
| validationException.addValidationError("must provide at least one name"); |
There was a problem hiding this comment.
is it possible to move this to the constructor instead? the whole validate() thing was a relic that i brought forward for back compat on the existing internal APIs in HLRC. We prefer it in the constructor so it can bomb out with a stack trace that shows where it was set, rather than some weird place after the fact (which is what validate does)
There was a problem hiding this comment.
For sure, completely agree
This commit adds support for the index templates exist API, creating new client-side request types for that API and the get index templates API. Also adds links in hlrc docs to pages for supported index template APIs
This commit adds support for the index templates exist API, creating new client-side request types for that API and the get index templates API. Also adds links in hlrc docs to pages for supported index template APIs
This commit adds support for the index templates exist API, using the
existing GetIndexTemplatesRequest request object. Also adds links to the
index template APIs which are supported in the client
For #27205