fix async example (#330)
Signed-off-by: Jay Zarfoss <jzarfoss@farmersbusinessnetwork.com>
This commit is contained in:
+3
-3
@@ -476,10 +476,10 @@ print(response)
|
||||
|
||||
## Using IAM authentication with an async client
|
||||
|
||||
Make sure to use the `AsyncHttpConnection` connection class with the async `AWSV4SignerAsyncAuth` signer.
|
||||
Make sure to use `AsyncOpenSearch` with the `AsyncHttpConnection` connection class with the async `AWSV4SignerAsyncAuth` signer.
|
||||
|
||||
```python
|
||||
from opensearchpy import OpenSearch, AsyncHttpConnection, AWSV4SignerAsyncAuth
|
||||
from opensearchpy import AsyncOpenSearch, AsyncHttpConnection, AWSV4SignerAsyncAuth
|
||||
import boto3
|
||||
|
||||
host = '' # cluster endpoint, for example: my-test-domain.us-east-1.es.amazonaws.com
|
||||
@@ -489,7 +489,7 @@ credentials = boto3.Session().get_credentials()
|
||||
auth = AWSV4SignerAsyncAuth(credentials, region, service)
|
||||
index_name = 'python-test-index3'
|
||||
|
||||
client = OpenSearch(
|
||||
client = AsyncOpenSearch(
|
||||
hosts = [{'host': host, 'port': 443}],
|
||||
http_auth = auth,
|
||||
use_ssl = True,
|
||||
|
||||
Reference in New Issue
Block a user