Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing examples to use hosts instead of Cloud ID #230

Open
JessicaGarson opened this issue May 1, 2024 · 0 comments
Open

Changing examples to use hosts instead of Cloud ID #230

JessicaGarson opened this issue May 1, 2024 · 0 comments

Comments

@JessicaGarson
Copy link
Contributor

JessicaGarson commented May 1, 2024

Most of the examples in this repo use Could ID instead of hosts, while chatting with @miguelgrinberg and @joemcelroy we noticed that we should probably update them.

What is in most examples is something like this:

ELASTIC_CLOUD_ID = getpass("Elastic Cloud ID: ")

# https://www.elastic.co/search-labs/tutorials/install-elasticsearch/elastic-cloud#creating-an-api-key
ELASTIC_API_KEY = getpass("Elastic Api Key: ")

A version of this could be:

# Create an Elasticsearch client instance
client = Elasticsearch(
    getpass("Host: "),  # Securely get the host for the Elasticsearch cluster
    api_key=getpass("API Key: "),  # Securely get the API key for authentication
)
@JessicaGarson JessicaGarson changed the title Changing examples to use hosts instead of Client ID Changing examples to use hosts instead of Cloud ID May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant