Skip to content

1.1.0 (24 August 2024)

Compare
Choose a tag to compare
@untergeek untergeek released this 24 Aug 19:35
· 4 commits to main since this release
24c009f

Feature Release

  • Add env_var.yaml to docker_test directory. This allows easy use in
    conjunction with es_client, which can import YAML configuration files in
    one step.

    • env_var.yaml:

      ---
      elasticsearch:
        client:
          hosts: ${ESCLIENT_HOSTS}
          ca_certs: ${ESCLIENT_CA_CERTS}
        other_settings:
          username: ${ESCLIENT_USERNAME}
          password: ${ESCLIENT_PASSWORD}
      
    • Example Flow:

      $ cd ${PROJECT_ROOT}
      $ docker_test/create.sh 8.15.0
      ### Output of create.sh here ###
      $ source .env
      $ env | grep ESCLIENT
      ESCLIENT_CA_CERTS=/path/to/http_ca.crt
      ESCLIENT_HOSTS=https://127.0.0.1:9200
      ESCLIENT_USERNAME=elastic
      ESCLIENT_PASSWORD=REDACTED
      $ python
      >>> import json
      >>> from es_client import Builder
      >>> _ = Builder(configfile='docker_test/env_var.yaml', autoconnect=True)
      >>> client = _.client
      >>> print(json.dumps(dict(client.info()), indent=2))
      {
        "name": "local-node",
        "cluster_name": "local-cluster",
        "cluster_uuid": "snJUMp3TQUWsi86EEWrU4w",
        "version": {
          "number": "8.15.0",
          "build_flavor": "default",
          "build_type": "docker",
          "build_hash": "1a77947f34deddb41af25e6f0ddb8e830159c179",
          "build_date": "2024-08-05T10:05:34.233336849Z",
          "build_snapshot": false,
          "lucene_version": "9.11.1",
          "minimum_wire_compatibility_version": "7.17.0",
          "minimum_index_compatibility_version": "7.0.0"
        },
        "tagline": "You Know, for Search"
      }
      

    It is absolutely necessary to run source ${PROJECT_ROOT}/.env before Builder can read the values in env_var.yaml