Skip to content

Instantly share code, notes, and snippets.

@GRomR1
Created May 13, 2023 07:50
Show Gist options
  • Save GRomR1/19bb8c9a6584cc47ea2587cc09fd6178 to your computer and use it in GitHub Desktop.
Save GRomR1/19bb8c9a6584cc47ea2587cc09fd6178 to your computer and use it in GitHub Desktop.
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