From 35045900387ae19d8fb24af61d754744b2d2cbb4 Mon Sep 17 00:00:00 2001 From: dblock Date: Thu, 11 Jan 2024 10:09:32 -0500 Subject: [PATCH] Use instructions from #11844 to run the plugin. Signed-off-by: dblock --- plugins/api/README.md | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/plugins/api/README.md b/plugins/api/README.md index ae9cd7c484bb6..5448d7181c491 100644 --- a/plugins/api/README.md +++ b/plugins/api/README.md @@ -12,25 +12,45 @@ A plugin that returns the OpenSearch API in the OpenAPI format. ### Run -Modify `gradle/run.gradle`. +When you run OpenSearch with `./gradlew run -PinstalledPlugins="['api']"` you should see the plugin loaded in the logs. + +``` +[2023-09-27T08:35:48,627][INFO ][o.o.p.PluginsService] [runTask-0] loaded plugin [api] +``` + +Alternately you can modify `gradle/run.gradle`. ```gradle testClusters { runTask { - testDistribution = 'archive' plugin(':plugins:api') } } ``` - When you run OpenSearch with `./gradlew run` you should see the plugin loaded in the logs. - -``` -[2023-09-27T08:35:48,627][INFO ][o.o.p.PluginsService] [runTask-0] loaded plugin [api] -``` - -### Test +### Try ```sh $ curl http://localhost:9200/_plugins/api ``` + +Returns an OpenAPI spec. + +```json +{ + "openapi": "3.0.1", + "info": { + "title": "opensearch", + "description": "The OpenSearch Project: https://opensearch.org/", + "version": "3.0.0-SNAPSHOT" + }, + "paths": { + "/_nodes": { + "get": {} + }, + "/_cluster/state/:metric": { + "get": {} + }, + ... + } +```