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": {} + }, + ... + } +```