Skip to content

Commit

Permalink
Use instructions from opensearch-project#11844 to run the plugin.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jan 11, 2024
1 parent 48221f7 commit 3504590
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions plugins/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
},
...
}
```

0 comments on commit 3504590

Please sign in to comment.