From a495a20417ea375abd9421dd54c0d3e04c586354 Mon Sep 17 00:00:00 2001 From: jayzfbn <117106747+jayzfbn@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:30:48 -0700 Subject: [PATCH] fix async example (#330) Signed-off-by: Jay Zarfoss --- USER_GUIDE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 2bf83fe5..0861bba1 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -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,