Skip to content

Commit ebd5c6b

Browse files
committed
[DOCS] Updates connecting with API Key
1 parent 5d60b59 commit ebd5c6b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/connecting.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ image::docs/images/cloud_api_key.png["API key"]
5555
Once you have collected the `Cloud ID` and the `API key` you can use the client
5656
to connect to your Elastic Cloud instance, as follows:
5757

58+
[source,ruby]
59+
------------------------------------
60+
client = Elasticsearch::Client.new(
61+
cloud_id: '<CloudID>',
62+
api_key: '<ApiKey>'
63+
)
64+
------------------------------------
65+
66+
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:
67+
5868
[source,ruby]
5969
------------------------------------
6070
client = Elasticsearch::Client.new(

0 commit comments

Comments
 (0)