Skip to content

Commit

Permalink
[DOCS] Updates connecting with API Key
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Nov 14, 2022
1 parent 5d60b59 commit ebd5c6b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/connecting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ image::docs/images/cloud_api_key.png["API key"]
Once you have collected the `Cloud ID` and the `API key` you can use the client
to connect to your Elastic Cloud instance, as follows:

[source,ruby]
------------------------------------
client = Elasticsearch::Client.new(
cloud_id: '<CloudID>',
api_key: '<ApiKey>'
)
------------------------------------

If you create the API Key through the dev console or the REST API, you may get instead a pair of `id` and `APIKey` values. The client also accepts a Hash for the `api_key` parameter, so you can pass in these values and it will encode the API Key internally:

[source,ruby]
------------------------------------
client = Elasticsearch::Client.new(
Expand Down

0 comments on commit ebd5c6b

Please sign in to comment.