-
Notifications
You must be signed in to change notification settings - Fork 177
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
[PROPOSAL] Plugins Python Client Interface #90
Comments
Yea, I agree that this is a useful feature and thanks a lot for that 👍 |
Do we really need to have "plugins" between client and alerting. Why not have following format?
@dblock can you provide some feedback? |
1.) I was thinking of following this structure in the image below, which means 2.) Instead, we can always go for the structure Which one do you think we should go for? |
The first question is whether there's a single opensearch-py or opensearch-py and opensearch-alerting-py. If we believe in a vision that OpenSearch is highly extensible, plugins will exist independently, and there will be a version matrix for compatibility where a plugin says "I am compatible with these versions of OpenSearch". Similarly, this means that opensearch-py should not know about plugins, but vice-versa. I would want to add opensearch-alerting-py to my project, which may depend (be compatible with) a range of versions of opensearch-py. I do think it's ok for all these plugin implementations to live in this project until we start shipping clients separately, too, but we just need to be aware of that future. In terms of namespaces, I would definitely keep the namespace Some more thoughts ... I love the idea of extending the client to plugins very much, and definitely appreciate when clients are implemented the language-way (e.g. mongoid was a lot easier to use than a bare-bones mongodb-ruby-driver and eventually became the official client)), as opposed to something that one generates that gets you 80% there. I also really appreciate when clients do a little bit more than the pure API to make the caller's life easier (e.g. when you ask for lists in slack-ruby-client with a block, it automatically paginates results for you keeping track of pages and making additional API requests for you). With this in mind, it seems like https://github.com/opensearch-project/opensearch-dsl-py tries to be such a client for many types of search queries. Making it easy to make calls to plugins in the same vein is a great suggestion. I think it's worth stepping back a little and imagining what the ideal world could look like.
I support anything that gets us closer to this. |
Hello 👋 I'm currently developing a Juju charm for OpenSearch and I'm missing a way of setting CCR (Cross Cluster Replication) via the python client. Right now I'm using the rest API in the documentation to do it, but it raises some concerns that the code might brake in the future if the endpoints changes between different OpenSearch versions. Reading the code of the ElasticSearch client they do have a |
@gabrielcocenza The API is the way to do it right now. OpenSearch follows SemVer so the concern of the APIs breaking will only be an issue at a major versions. I would think the charm you're developing would need to change at that time anyway. Also, the ES client's CCR is similar in name only - I don't believe that theres is compatibility between the OpenSearch and ES implementations of CCR. All this being said, I agree though, yes, going forward it would be nice to have CCR abstracted into the library :) |
This would be great if this happens. Putting curl requests using python is bit cumbersome and also facing issues. https://forum.opensearch.org/t/unable-to-create-monitors-using-curl-request-error-unauthorized/10097 |
A mechanism for plugins was added in #93. Closing. |
What kind of business use case are you trying to solve? What are your requirements?
Although the current state of
opensearch-py
can connect to opensearch database and do transactions seamlessly, To use plugins features likeSearch Plugin
orMonitoring Plugin
, one needs to follow the REST guideline from docs and need to make the requests and the workflow manually. I, right now have a personal requirement of thealerting
feature from theMonitoring Plugin
to be implemented in apythonic
way.What is the problem? What is preventing you from meeting the requirements?
The problem is the lack of python support for the plugins as most of the organizations using the python client would probably use
monitoring
and other plugin features as well. Lack of this particular feature would mean, one needs to useopensearch-py
in one hand and also using the REST API from the docs on the other hand, creating a mixed feeling in the developers heart, unhealthy code and probably some security flaws in the developer's code as well.What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?
I am proposing a pythonic implementation of the plugins API, which would look something like this:
What are your assumptions or prerequisites?
N/A
What are remaining open questions?
List questions that may need to be answered before proceeding with an implementation.
contrib
orplugins
?The text was updated successfully, but these errors were encountered: