Module: Elasticsearch::API::Cat::Actions

Included in:
CatClient
Defined in:
lib/elasticsearch/api/namespace/cat.rb,
lib/elasticsearch/api/actions/cat/help.rb,
lib/elasticsearch/api/actions/cat/count.rb,
lib/elasticsearch/api/actions/cat/nodes.rb,
lib/elasticsearch/api/actions/cat/tasks.rb,
lib/elasticsearch/api/actions/cat/health.rb,
lib/elasticsearch/api/actions/cat/master.rb,
lib/elasticsearch/api/actions/cat/shards.rb,
lib/elasticsearch/api/actions/cat/aliases.rb,
lib/elasticsearch/api/actions/cat/indices.rb,
lib/elasticsearch/api/actions/cat/plugins.rb,
lib/elasticsearch/api/actions/cat/recovery.rb,
lib/elasticsearch/api/actions/cat/segments.rb,
lib/elasticsearch/api/actions/cat/fielddata.rb,
lib/elasticsearch/api/actions/cat/nodeattrs.rb,
lib/elasticsearch/api/actions/cat/snapshots.rb,
lib/elasticsearch/api/actions/cat/templates.rb,
lib/elasticsearch/api/actions/cat/allocation.rb,
lib/elasticsearch/api/actions/cat/thread_pool.rb,
lib/elasticsearch/api/actions/cat/repositories.rb,
lib/elasticsearch/api/actions/cat/pending_tasks.rb

Instance Method Summary collapse

Instance Method Details

#aliases(arguments = {}) ⇒ Object

Returns information about aliases, including associated routing values and filters.

Examples:

Display all aliases in the cluster


puts client.cat.aliases

Display indices for the ‘year-2013’ alias


puts client.cat.aliases name: 'year-2013'

Display header names in the output


puts client.cat.aliases v: true

Return only the ‘alias’ and ‘index’ columns


puts client.cat.aliases h: ['alias', 'index']

Return only the ‘alias’ and ‘index’ columns, using short names


puts client.cat.aliases h: 'a,i'

Return the output sorted by the alias name


puts client.cat.aliases s: 'alias'

Return the information as Ruby objects


client.cat.aliases format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of alias names to return

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/cat/aliases.rb', line 48

def aliases(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  name = arguments.delete(:name)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/aliases', Utils.__listify(name)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#allocation(arguments = {}) ⇒ Object

Return shard allocation information

Examples:

Display allocation for all nodes in the cluster


puts client.cat.allocation

Display allocation for node with name ‘node-1’


puts client.cat.allocation node_id: 'node-1'

Display header names in the output


puts client.cat.allocation v: true

Display only specific columns in the output (see the ‘help` parameter)


puts client.cat.allocation h: ['node', 'shards', 'disk.percent']

Display only specific columns in the output, using the short names


puts client.cat.allocation h: 'n,s,dp'

Return the information as Ruby objects


client.cat.allocation format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :node_id (List)

    A comma-separated list of node IDs or names to limit the returned information

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/cat/allocation.rb', line 45

def allocation(arguments={})
  valid_params = [
    :bytes,
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  node_id = arguments.delete(:node_id)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/allocation', Utils.__listify(node_id)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#count(arguments = {}) ⇒ Object

Return document counts for the entire cluster or specific indices

Examples:

Display number of documents in the cluster


puts client.cat.count

Display number of documents in an index


puts client.cat.count index: 'index-a'

Display number of documents in a list of indices


puts client.cat.count index: ['index-a', 'index-b']

Display header names in the output


puts client.cat.count v: true

Return the information as Ruby objects


client.cat.count format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to limit the returned information

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/cat/count.rb', line 40

def count(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  index = arguments.delete(:index)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/count', Utils.__listify(index)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#fielddata(arguments = {}) ⇒ Object

Return information about field data usage across the cluster

Examples:

Return the total size of field data


client.cat.fielddata

Return both the total size and size for specific fields


client.cat.fielddata fields: 'title,body'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :fields (List)

    A comma-separated list of fields to include in the output

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/elasticsearch/api/actions/cat/fielddata.rb', line 28

def fielddata(arguments={})
  valid_params = [
    :bytes,
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s,
    :fields ]

  fields = arguments.delete(:fields)

  method = HTTP_GET
  path   = Utils.__pathify "_cat/fielddata", Utils.__listify(fields)
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#health(arguments = {}) ⇒ Object

Display a terse version of the Elasticsearch::API::Cluster::Actions#health API output

Examples:

Display cluster health


puts client.cat.health

Display header names in the output


puts client.cat.health v: true

Return the information as Ruby objects


client.cat.health format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :ts (Boolean)

    Whether to display timestamp information

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/cat/health.rb', line 32

def health(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :ts,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/health"
  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]
  body   = nil

  perform_request(method, path, params, body).body
end

#help(arguments = {}) ⇒ Object

Help information for the Cat API

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :help (Boolean)

    Return help information

See Also:



12
13
14
15
16
17
18
19
20
21
# File 'lib/elasticsearch/api/actions/cat/help.rb', line 12

def help(arguments={})
  valid_params = [
    :help ]
  method = HTTP_GET
  path   = "_cat"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#indices(arguments = {}) ⇒ Object

Return the most important statistics about indices, across the cluster nodes

Use the ‘help` parameter to display available statistics.

Examples:

Display information for all indices


puts client.cat.indices

Display information for a specific index


puts client.cat.indices index: 'index-a'

Display information for indices matching a pattern


puts client.cat.indices index: 'index-*'

Display header names in the output


puts client.cat.indices v: true

Display only specific columns in the output (see the ‘help` parameter)


puts client.cat.indices h: ['index', 'docs.count', 'fielddata.memory_size', 'filter_cache.memory_size']

Display only specific columns in the output, using the short names


puts client.cat.indices h: 'i,dc,ss,mt', v: true

Return the information as Ruby objects


client.cat.indices format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to limit the returned information

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :pri (Boolean)

    Limit the returned information on primary shards only (default: false)

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :health (String)

    A health status (“green”, “yellow”, or “red” to filter only indices matching the specified health status (options: green, yellow, red)

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/elasticsearch/api/actions/cat/indices.rb', line 54

def indices(arguments={})
  valid_params = [
    :bytes,
    :h,
    :health,
    :help,
    :local,
    :master_timeout,
    :pri,
    :v,
    :s ]

  index = arguments.delete(:index)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/indices', Utils.__listify(index)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#master(arguments = {}) ⇒ Object

Display basic information about the master node

Examples:


puts client.cat.master

Display header names in the output


puts client.cat.master v: true

Return the information as Ruby objects


client.cat.master format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/api/actions/cat/master.rb', line 31

def master(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/master"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#nodeattrs(arguments = {}) ⇒ Object

Display custom node attributes

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/elasticsearch/api/actions/cat/nodeattrs.rb', line 17

def nodeattrs(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]
  method = 'GET'
  path   = "_cat/nodeattrs"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#nodes(arguments = {}) ⇒ Object

Display information about cluster topology and nodes statistics

Examples:

Display basic information about nodes in the cluster (host, node name, memory usage, master, etc.)


puts client.cat.nodes

Display header names in the output


puts client.cat.nodes v: true

Display only specific columns in the output (see the ‘help` parameter)


puts client.cat.nodes h: %w(name version jdk disk.avail heap.percent load merges.total_time), v: true

Display only specific columns in the output, using the short names


puts client.cat.nodes h: 'n,v,j,d,hp,l,mtt', v: true

Return the information as Ruby objects


client.cat.nodes format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :full_id (Boolean)

    Return the full node ID instead of the shortened version (default: false)

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/cat/nodes.rb', line 40

def nodes(arguments={})
  valid_params = [
    :full_id,
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/nodes"

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h], :escape => false) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#pending_tasks(arguments = {}) ⇒ Object

Display the information from the Elasticsearch::API::Cluster::Actions#pending_tasks API in a tabular format

Examples:


puts client.cat.pending_tasks

Display header names in the output


puts client.cat.pending_tasks v: true

Return the information as Ruby objects


client.cat.pending_tasks format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/elasticsearch/api/actions/cat/pending_tasks.rb', line 31

def pending_tasks(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/pending_tasks"
  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]
  body   = nil

  perform_request(method, path, params, body).body
end

#plugins(arguments = {}) ⇒ Object

Return information about installed plugins

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

See Also:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/elasticsearch/api/actions/cat/plugins.rb', line 18

def plugins(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]
  method = 'GET'
  path   = "_cat/plugins"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#recovery(arguments = {}) ⇒ Object

Display information about the recovery process (allocating shards)

Examples:

Display information for all indices


puts client.cat.recovery

Display information for a specific index


puts client.cat.recovery index: 'index-a'

Display information for indices matching a pattern


puts client.cat.recovery index: 'index-*'

Display header names in the output


puts client.cat.recovery v: true

Display only specific columns in the output (see the ‘help` parameter)


puts client.cat.recovery h: ['node', 'index', 'shard', 'percent']

Display only specific columns in the output, using the short names


puts client.cat.recovery h: 'n,i,s,per'

Return the information as Ruby objects


client.cat.recovery format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to limit the returned information

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/elasticsearch/api/actions/cat/recovery.rb', line 49

def recovery(arguments={})
  valid_params = [
    :bytes,
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  index = arguments.delete(:index)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/recovery', Utils.__listify(index)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#repositories(arguments = {}) ⇒ Object

Shows all repositories registered in a cluster

Examples:

Return list of repositories


client.cat.repositories

Return only id for each repository


client.cat.repositories h: 'id'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/elasticsearch/api/actions/cat/repositories.rb', line 24

def repositories(arguments={})
  valid_params = [
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/repositories"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#segments(arguments = {}) ⇒ Object

Display information about the segments in the shards of an index

Examples:

Display information for all indices


puts client.cat.segments

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to limit the returned information

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/elasticsearch/api/actions/cat/segments.rb', line 21

def segments(arguments={})
  valid_params = [
    :bytes,
    :index,
    :h,
    :help,
    :v,
    :s ]
  method = 'GET'
  path   = "_cat/segments"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#shards(arguments = {}) ⇒ Object

Display shard allocation across nodes

Examples:

Display information for all indices


puts client.cat.shards

Display information for a specific index


puts client.cat.shards index: 'index-a'

Display information for a list of indices


puts client.cat.shards index: ['index-a', 'index-b']

Display header names in the output


puts client.cat.shards v: true

Display shard size in choice of units


puts client.cat.shards bytes: 'b'

Display only specific columns in the output (see the ‘help` parameter)


puts client.cat.shards h: ['node', 'index', 'shard', 'prirep', 'docs', 'store', 'merges.total']

Display only specific columns in the output, using the short names


puts client.cat.shards h: 'n,i,s,p,d,sto,mt'

Return the information as Ruby objects


client.cat.shards format: 'json'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to limit the returned information

  • :bytes (String)

    The unit in which to display byte values (options: b, k, m, g)

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/elasticsearch/api/actions/cat/shards.rb', line 53

def shards(arguments={})
  valid_params = [
    :local,
    :master_timeout,
    :bytes,
    :h,
    :help,
    :v,
    :s ]

  index = arguments.delete(:index)

  method = HTTP_GET

  path   = Utils.__pathify '_cat/shards', Utils.__listify(index)

  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]

  body   = nil

  perform_request(method, path, params, body).body
end

#snapshots(arguments = {}) ⇒ Object

Shows all snapshots that belong to a specific repository

Examples:

Return snapshots for ‘my_repository’


client.cat.snapshots repository: 'my_repository'

Return id, status and start_epoch for ‘my_repository’


client.cat.snapshots repository: 'my_repository', h: 'id,status,start_epoch'

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

Raises:

  • (ArgumentError)

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/elasticsearch/api/actions/cat/snapshots.rb', line 24

def snapshots(arguments={})
  raise ArgumentError, "Required argument 'repository' missing" if !arguments[:repository] && !arguments[:help]

  valid_params = [
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  repository = arguments.delete(:repository)

  method = HTTP_GET
  path   = Utils.__pathify "_cat/snapshots", Utils.__escape(repository)
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#tasks(arguments = {}) ⇒ Object

Return currently running tasks

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :format (String)

    a short version of the Accept header, e.g. json, yaml

  • :node_id (List)

    A comma-separated list of node IDs or names to limit the returned information; use ‘_local` to return information from the node you’re connecting to, leave empty to get information from all nodes

  • :actions (List)

    A comma-separated list of actions that should be returned. Leave empty to return all.

  • :detailed (Boolean)

    Return detailed task information (default: false)

  • :parent_node (String)

    Return tasks with specified parent node.

  • :parent_task (Number)

    Return tasks with specified parent task id. Set to -1 to return all.

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/elasticsearch/api/actions/cat/tasks.rb', line 21

def tasks(arguments={})
  valid_params = [
    :format,
    :node_id,
    :actions,
    :detailed,
    :parent_node,
    :parent_task,
    :h,
    :help,
    :v,
    :s ]
  method = 'GET'
  path   = "_cat/tasks"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#templates(arguments = {}) ⇒ Object

Returns information about existing templates

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    A pattern that returned template names must match

  • :format (String)

    a short version of the Accept header, e.g. json, yaml

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :h (List)

    Comma-separated list of column names to display

  • :help (Boolean)

    Return help information

  • :v (Boolean)

    Verbose mode. Display column headers

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

See Also:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/elasticsearch/api/actions/cat/templates.rb', line 19

def templates(arguments={})
  valid_params = [
    :name,
    :format,
    :local,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]
  method = HTTP_GET
  path   = "_cat/templates"
  params = Utils.__validate_and_extract_params arguments, valid_params
  body   = nil

  perform_request(method, path, params, body).body
end

#thread_pool(arguments = {}) ⇒ Object

Display thread pool statistics across nodes (use the ‘help` parameter to display a list of avaialable thread pools)

Examples:

Display information about all thread pools across nodes


puts client.cat.thread_pool

Display header names in the output


puts client.cat.thread_pool v: true

Display information about the indexing thread pool


puts client.cat.thread_pool h: %w(h ip index.active index.size index.queue index.rejected), v: true

Display information about the indexing and search threads, using the short names


puts client.cat.thread_pool h: 'host,ia,is,iq,ir,sa,ss,sq,sr', v: true

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :full_id (Boolean)

    Display the complete node ID

  • :size (String)

    The multiplier in which to display values (Options: k, m, g, t, p)

  • :thread_pool_patterns (List)

    A comma-separated list of regular expressions to filter the thread pools in the output

  • :h (List)

    Comma-separated list of column names to display – see the ‘help` argument

  • :v (Boolean)

    Display column headers as part of the output

  • :s (List)

    Comma-separated list of column names or column aliases to sort by

  • :format (String)

    The output format. Options: ‘text’, ‘json’; default: ‘text’

  • :help (Boolean)

    Return information about headers

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/cat/thread_pool.rb', line 41

def thread_pool(arguments={})
  valid_params = [
    :full_id,
    :size,
    :local,
    :thread_pool_patterns,
    :master_timeout,
    :h,
    :help,
    :v,
    :s ]

  method = HTTP_GET
  path   = "_cat/thread_pool"
  params = Utils.__validate_and_extract_params arguments, valid_params
  params[:h] = Utils.__listify(params[:h]) if params[:h]
  body   = nil

  perform_request(method, path, params, body).body
end