Created
May 13, 2023 07:50
-
-
Save GRomR1/19bb8c9a6584cc47ea2587cc09fd6178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from opensearchpy import AsyncOpenSearch, AsyncHttpConnection | |
async def main(): | |
client = AsyncOpenSearch( | |
hosts = [{'host': 'localhost', 'port': 9200}], | |
http_auth = ("admin", "admin"), | |
use_ssl = True, | |
verify_certs = False, | |
ssl_show_warn=False, | |
connection_class = AsyncHttpConnection | |
) | |
print(f"{id(client)} {await client.info()}") | |
await client.close() | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment