Skip to content

Commit d803d12

Browse files
committed
add changes to docs
1 parent 71ab3e1 commit d803d12

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

docs/configuration.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ If you want to connect to Elastic Cloud, you can use your Cloud ID and use basic
9595
[source,php]
9696
----
9797
$client = ClientBuilder::create()
98-
->setElasticCloudId('<elastic-cloud-id>', '<username>', '<secure-password>') <1>, <2>
98+
->setElasticCloudId('<elastic-cloud-id>') <1>
99+
->setBasicAuthentication('<username>', '<secure-password>') <2>
99100
->build();
100101
----
101102
<1> Your Cloud ID provided by the Elastic Cloud platform
@@ -105,7 +106,7 @@ $client = ClientBuilder::create()
105106
----
106107
$client = ClientBuilder::create()
107108
->setElasticCloudId('<elastic-cloud-id>') <1>
108-
->setApiKeyPairAuthentication('<id>', '<api_key>') <2>
109+
->setApiKey('<id>', '<api_key>') <2>
109110
->build();
110111
----
111112
<1> Your Cloud ID provided by the Elastic Cloud platform
@@ -267,7 +268,7 @@ $client = ClientBuilder::create()
267268
->build();
268269
----
269270

270-
For more details, please see the dedicated page on
271+
For more details, please see the dedicated page on
271272
<<connection_pool,configuring connection pools>>.
272273

273274
=== Setting the Connection Selector

docs/security.asciidoc

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,16 @@ cluster will use the appropriate credentials depending on the node being talked
2626

2727
=== ApiKey Authentication
2828

29-
If your Elasticsearch cluster is secured by API keys as described https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html[here], you have two options to provide the values to the client.
30-
Either use the `id` and `api_key` pair from the create API key API response or use the encoded token as described https://www.elastic.co/guide/en/elasticsearch/reference/7.1/security-api-create-api-key.html#_examples_83[here] in the last code snippet.
29+
If your Elasticsearch cluster is secured by API keys as described https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html[here], you can use these values to connect the client with your cluster, as illustrated in the following code snippet.
3130

3231
[source,php]
3332
----
3433
$client = ClientBuilder::create()
35-
->setApiKeyPairAuthentication('id', 'api_key') <1>
34+
->setApiKey('id', 'api_key') <1>
3635
->build();
3736
----
3837
<1> ApiKey pair of `id` and `api_key` from the create API key response.
3938

40-
[source,php]
41-
----
42-
$client = ClientBuilder::create()
43-
->setApiKeyAuthentication('encoded-api-key') <1>
44-
->build();
45-
----
46-
<1> Encoded ApiKey pair
47-
4839
=== SSL Encryption
4940

5041
Configuring SSL is a little more complex. You need to identify if your certificate has been signed by a public

0 commit comments

Comments
 (0)