Skip to content

Commit

Permalink
Added clientOptions documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffyactive committed Jun 10, 2022
1 parent d87f6d1 commit 0341100
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ __barnacles-elasticsearch__ supports the following options:
| Property | Default | Description |
|:--------------|:---------------------------|:-------------------------------|
| node | "http:https://localhost:9200" | Elasticsearch node |
| clientOptions | null | Object of parameters for client instantiation |
| client | null | An instantiated Elasticsearch client |
| printErrors | false | Print errors to the console (for debug) |
| eventsToStore | { raddec: {}, dynamb: {} } | See default event-specific properties below |
Expand All @@ -45,6 +46,28 @@ For raddec events, all [raddec](https://github.com/reelyactive/raddec/) toFlatte
By default __barnacles-elasticsearch__ will connect and write to localhost:9200.


Connecting to an Elastic Cloud instance
---------------------------------------

Connecting to the Elastic Cloud is straightforward using the _clientOptions_ as follows:

```javascript
const clientOptions = {
cloud: { id: "copy-paste from Elastic Cloud dashboard" },
auth: {
username: "pareto-anywhere",
password: "password"
}
}
barnacles.addInterface(BarnaclesElasticsearch, clientOptions);
```

Connecting to a self-hosted instance
------------------------------------

See the [Elasticsearch JavaScript client API documentation on connecting](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-connecting.html) to select the appropriate _clientOptions_ for your instance.


Contributing
------------

Expand Down

0 comments on commit 0341100

Please sign in to comment.