-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FEATURE] Register REST API and map to associated extension in ExtensionsOrchestrator #69
Comments
I think we might be able to re-use the vast majority of existing Plugin code for the REST actions. However, we need to carefully address the question of "which JVM is the code executed in". Directly applying the code may end up with OpenSearch's JVM processing the actions, so the registered "actions" need to prompt network communication to a separate request and associated handler. Details below. Current Plugin setup uses a base URI containing public static final String AD_BASE_URI = "/_plugins/_anomaly_detection"; So we can follow this model and use an String restApiBaseString = "/_extensions/_" + extensionNameGoesHere;
String restActionStringToRegister = restApiBaseString + restActionString; Only concern here might be conflicting/duplicate extension names so we may consider using a uniqueID, or an expanded "fully qualified name" (e.g., similar to JPMS module names which are supposed to be globally unique) to deconflict. I'll go ahead with the extension name for now. REST Handlers correspond to public List<RestHandler> getRestHandlers( ... ) {
// ...
RestGetAnomalyDetectorAction restGetAnomalyDetectorAction = new RestGetAnomalyDetectorAction();
// ...
return ImmutableList.of(
restGetAnomalyDetectorAction,
// ...
)
}
} These are eventually registered with OpenSearch (the end goal of this issue) in the for (ActionPlugin plugin : actionPlugins) {
for (RestHandler handler : plugin.getRestHandlers(
settings,
restController,
clusterSettings,
indexScopedSettings,
settingsFilter,
indexNameExpressionResolver,
nodesInCluster
)) {
registerHandler.accept(handler);
}
} This We have the ability to send these this.extensionsOrchestrator.setTransportService(transportService);
this.extensionsOrchestrator.setClusterService(clusterService);
// add this
this.extensionsOrchestrator.setRestController(restController); Way forward: We can either merge #74 (and its OS counterpart) and I can build on it or I can put it into draft and start making the following changes to address this issue:
And finally, to be sure the
@owaiskazi19 and @saratvemulapalli I'd appreciate your thoughts on this approach before I head down this road. |
Further progress from tonight's explorations:
Plan going forward is:
|
Current sequence (will eventually find its way to a DESIGN doc):
Next steps:
|
Is your feature request related to a problem?
See steps 4, 6, and 7 described in #64.
What solution would you like?
Upon receipt of REST API listing provided in #68, The
ExtensionsOrchestrator
should:RestHandler
What alternatives have you considered?
The best location for the map and API redirects to be stored is still an open question.
Do you have any additional context?
See also the DESIGN.md file (draft in #60)
The text was updated successfully, but these errors were encountered: