20

Verify connection to Elasticsearch by sethmlarson · Pull Request #1623 · elastic...

 3 years ago
source link: https://github.com/elastic/elasticsearch-py/pull/1623
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Member

sethmlarson commented on Jun 28

edited

Follows this logic for verifying a connection to Elasticsearch:

Before the first API request:

  1. Make an API request to /, inspect the response:
  2. If call to / fails with 401 or 403 pass the check and show a warning (message will be linked later). This happens if the monitor permission missing for user. The subsequent checks must be ignored.
  3. If there's no version field or if the version field value is <6.0.0 raise an error.
  4. If there is a version field and it's >= 6.0.0 and <7.0.0:
    • If there is no tagline field or if the tagline field value isn't You know, for Search raise an error.
  5. If there is a version field and it's >=7.0.0 and <7.14.0:
    • If there is no tagline field or if the tagline field value isn't You know, for Search raise an error.
    • If there is no build_flavor field or if the build_flavor field value isn't default raise an error.
  6. If there is a version field and it's >=7.14.0:
    • If there is no X-Elastic-Product HTTP header in the response or if the X-Elastic-Product HTTP header value isn't Elasticsearch raise an error.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK