Skip to content

Changing examples to use hosts instead of Cloud ID #230

Open
@JessicaGarson

Description

@JessicaGarson

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
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions