cluster: Elasticsearch cluster endpoints

Description Usage Arguments Details Examples

Description

Elasticsearch cluster endpoints

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
cluster_settings(index = NULL, raw = FALSE, callopts = list(),
  verbose = TRUE, ...)

cluster_health(index = NULL, level = NULL, wait_for_status = NULL,
  wait_for_relocating_shards = NULL, wait_for_active_shards = NULL,
  wait_for_nodes = NULL, timeout = NULL, raw = FALSE,
  callopts = list(), verbose = TRUE, ...)

cluster_state(index = NULL, metrics = NULL, raw = FALSE,
  callopts = list(), verbose = TRUE, ...)

cluster_stats(index = NULL, raw = FALSE, callopts = list(),
  verbose = TRUE, ...)

cluster_reroute(body, raw = FALSE, callopts = list(), ...)

cluster_pending_tasks(index = NULL, raw = FALSE, callopts = list(),
  verbose = TRUE, ...)

Arguments

index

Index

raw

If TRUE (default), data is parsed to list. If FALSE, then raw JSON.

callopts

Curl args passed on to httr::POST()

verbose

If TRUE (default) the url call used printed to console.

...

Further args passed on to elastic search HTTP API as parameters.

level

Can be one of cluster, indices or shards. Controls the details level of the health information returned. Defaults to cluster.

wait_for_status

One of green, yellow or red. Will wait (until the timeout provided) until the status of the cluster changes to the one provided or better, i.e. green > yellow > red. By default, will not wait for any status.

wait_for_relocating_shards

A number controlling to how many relocating shards to wait for. Usually will be 0 to indicate to wait till all relocations have happened. Defaults to not wait.

wait_for_active_shards

A number controlling to how many active shards to wait for. Defaults to not wait.

wait_for_nodes

The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and <N. Alternatively, it is possible to use ge(N), le(N), gt(N) and lt(N) notation.

timeout

A time based parameter controlling how long to wait if one of the wait_for_XXX are provided. Defaults to 30s.

metrics

One or more of version, master_node, nodes, routing_table, metadata, and blocks. See Details.

body

Query, either a list or json.

Details

metrics param options:

Additional parameters that can be passed in:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Not run: 
cluster_settings()
cluster_health()

cluster_state()
cluster_state(metrics = "version")
cluster_state(metrics = "nodes")
cluster_state(metrics = c("version", "nodes"))
cluster_state(metrics = c("version", "nodes", 'blocks'))
cluster_state("shakespeare", metrics = "metadata")
cluster_state(c("shakespeare", "flights"), metrics = "metadata")

cluster_stats()
cluster_pending_tasks()

body <- '{
  "commands" : [ {
    "move" :
      {
        "index" : "test", "shard" : 0,
        "from_node" : "node1", "to_node" : "node2"
      }
    },
    {
      "allocate" : {
          "index" : "test", "shard" : 1, "node" : "node3"
      }
    }
  ]
}'
# cluster_reroute(body =  body)

cluster_health()
# cluster_health(wait_for_status = "yellow", timeout = "3s")

## End(Not run)

ropensci/elastic documentation built on Aug. 11, 2018, 3:46 a.m.