valid_connection: Validate healthy Elasticsearch connection.

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Validates healthy Elasticsearch connections by attempting to call the cluster healthcheck endpoint. In doing to, it defends against incorrect URLs to Elasticsearch clusters. Requires that URLs point directly to a master node - i.e. the endpoint that would return the default Elasticsearch message, "You Know, for Search", e.g. 'http://localhost:9200'.

Usage

1

Arguments

url

The URL to validate.

Value

Boolean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
url <- "http://localhost:9200"
valid_connection(url)
# TRUE

url <- "http://localhost:9201"
valid_connection(url)
#  Error: Failed to connect to localhost port 9201: Connection refused

## End(Not run)

AlexIoannides/elasticsearchr documentation built on July 31, 2019, 9:36 a.m.