Skip to content

Add rest and transport plumbing #40997

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

Closed
wants to merge 1 commit into from

Conversation

hub-cap
Copy link
Contributor

@hub-cap hub-cap commented Apr 9, 2019

Also wired up a bit more of the plugin and tested against a live
cluster.

Also wired up a bit more of the plugin and tested against a live
cluster.
@hub-cap hub-cap added WIP :Data Management/Indices APIs APIs to create and manage indices and templates v8.0.0 v7.2.0 labels Apr 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@hub-cap
Copy link
Contributor Author

hub-cap commented Apr 9, 2019

This is a work in progress. its not close to done, but I wanted to get something that other people can work against. I still need some tests at the very minimum. I also want to make sure the naming of things is good, so thats something I would like to discuss as well. I am also not 100% sure what label to put it under.


import java.io.IOException;

public class RestGenEnrichPolicyAction extends BaseRestHandler {
Copy link
Member

Choose a reason for hiding this comment

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

RestGenEnrichPolicyAction -> RestGetEnrichPolicyAction


public RestGenEnrichPolicyAction(final Settings settings, final RestController controller) {
super(settings);
controller.registerHandler(RestRequest.Method.GET, "/{index}/_enrich", this);
Copy link
Member

@martijnvg martijnvg Apr 9, 2019

Choose a reason for hiding this comment

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

I think we should have the following path structure: /_enrich/policy/{name}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, so completely remove the {index} and only put it in the payload of the policy itself, right?

Copy link
Member

Choose a reason for hiding this comment

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

So the payload would contain the: source index, decorate fields etc.
The name (or id) of the policy would exist in the url path.

@martijnvg
Copy link
Member

Should we adding this api to the enrich plugin instead? I think the only reason that we would want to add this to xpack-core is for transport client support (at least we did in the past iirc)? I don't think we should be adding transport client support and just hlrc support, so we can keep this inside the enrich plugin instead?

@jasontedor jasontedor added :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP and removed :Data Management/Indices APIs APIs to create and manage indices and templates labels Apr 9, 2019
@droberts195
Copy link
Contributor

I think the only reason that we would want to add this to xpack-core is for transport client support

What would happen if another X-Pack plugin wanted to use this functionality? For example, at the moment ML calls the has_privileges API in security, and only needs a compile time dependency on the x-pack-core plugin, not x-pack-security. So if in the future ML wanted to call an enrich action and the actions were in the x-pack-enrich plugin it would need to depend on x-pack-enrich. But then years later suppose that x-pack-ml and x-pack-enrich wanted to depend on different versions of some other 3rd party library. Is this starting to erode the benefits of splitting up X-Pack?

This is all very theoretical at the moment, but may be something to consider.

@martijnvg
Copy link
Member

@droberts195 Good point. I did not consider this. Maybe we should consider this on an api by api basis. I don't think that ml will need to depend on all of enrich's APIs? So if in the future ml needs to use specific APIs then we can just move those specific api(s) to xpack-core? I do lean towards moving as much as possible code into the specific xpack plugin directories.

@hub-cap
Copy link
Contributor Author

hub-cap commented Apr 15, 2019

Should we adding this api to the enrich plugin instead? I think the only reason that we would want to add this to xpack-core is for transport client support (at least we did in the past iirc)? I don't think we should be adding transport client support and just hlrc support, so we can keep this inside the enrich plugin instead?

Since transport client, even tho its deprecated, is supported for all of 7, wouldn't that mean that we should support all of the calls that we can do even if the HLRC ones exist? I recently told @dimitris-athanasiou this was the case with some new stuff he was working on, so im CC'ing him on this :)

@martijnvg
Copy link
Member

Since transport client, even tho its deprecated, is supported for all of 7, wouldn't that mean that we should support all of the calls that we can do even if the HLRC ones exist?

I don't think we have to support new APIs in the transport client, now that it has been deprecated and because there is an alternative.

@hub-cap
Copy link
Contributor Author

hub-cap commented Apr 16, 2019

there is an alternative.

Yes but the alternative might require a complete app rewrite if you want to use the rest client instead of the transport client for the entire 7.x series, or have 2 different ways to access a cluster depending on the APIs that you care to use. This seems painful for our users.

@jakelandis
Copy link
Contributor

This seems painful for our users.

The alternative is allow user to add new code against an API that will taken away in 8.0.0. There will be pain either way. a) code against deprecated now and re-write for 8.0.0 or b) start using the HLRC now. I think the former is actually more painful.

This argument is only for net-new features added in 7.x (like this one). I do believe that minor changes for features pre-existing in 6.x should continue support for the TransportClient.

martijnvg added a commit to martijnvg/elasticsearch that referenced this pull request Apr 17, 2019
This allows the transport client use this class in enrich APIs.

Relates to elastic#40997
jbaiera pushed a commit that referenced this pull request Apr 17, 2019
This allows the transport client use this class in enrich APIs.

Relates to #40997
martijnvg added a commit that referenced this pull request Apr 18, 2019
This allows the transport client use this class in enrich APIs.

Relates to #40997
@hub-cap
Copy link
Contributor Author

hub-cap commented Apr 22, 2019

superseded by #41383, #41384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants