Module: ElasticsearchServerless::API::Cat::Actions

Defined in:
lib/elasticsearch-serverless/api/cat/help.rb,
lib/elasticsearch-serverless/api/cat/count.rb,
lib/elasticsearch-serverless/api/cat/aliases.rb,
lib/elasticsearch-serverless/api/cat/indices.rb,
lib/elasticsearch-serverless/api/cat/ml_jobs.rb,
lib/elasticsearch-serverless/api/cat/transforms.rb,
lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb,
lib/elasticsearch-serverless/api/cat/ml_trained_models.rb,
lib/elasticsearch-serverless/api/cat/component_templates.rb,
lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb

Instance Method Summary collapse

Instance Method Details

#aliases(arguments = {}) ⇒ Object

Shows information about currently configured aliases to indices including filter and routing infos.

Options Hash (arguments):

  • :name (String, Array<String>)

    A comma-separated list of aliases to retrieve. Supports wildcards (+*+). To retrieve all aliases, omit this parameter or use * or _all.

  • :expand_wildcards (String, Array<String>)

    Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def aliases(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _name
             "_cat/aliases/#{Utils.listify(_name)}"
           else
             "_cat/aliases"
           end
  params = Utils.process_params(arguments)
  params[:h] = Utils.listify(params[:h]) if params[:h]

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#component_templates(arguments = {}) ⇒ Object

Returns information about existing component_templates templates.

Options Hash (arguments):

  • :name (String)

    The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def component_templates(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _name
             "_cat/component_templates/#{Utils.listify(_name)}"
           else
             "_cat/component_templates"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#count(arguments = {}) ⇒ Object

Provides quick access to the document count of the entire cluster, or individual indices.

Options Hash (arguments):

  • :index (String, Array)

    Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (+*+). To target all data streams and indices, omit this parameter or use * or _all.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def count(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _index = arguments.delete(:index)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _index
             "_cat/count/#{Utils.listify(_index)}"
           else
             "_cat/count"
           end
  params = Utils.process_params(arguments)
  params[:h] = Utils.listify(params[:h]) if params[:h]

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#help(arguments = {}) ⇒ Object

Returns help for the Cat APIs.

Options Hash (arguments):

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/elasticsearch-serverless/api/cat/help.rb', line 38

def help(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  method = ElasticsearchServerless::API::HTTP_GET
  path   = "_cat"
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#indices(arguments = {}) ⇒ Object

Returns information about indices: number of primaries and replicas, document counts, disk size, …

Options Hash (arguments):

  • :index (String, Array)

    Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (+*+). To target all data streams and indices, omit this parameter or use * or _all.

  • :bytes (String)

    The unit used to display byte values.

  • :expand_wildcards (String, Array<String>)

    The type of index that wildcard patterns can match.

  • :health (String)

    The health status used to limit returned indices. By default, the response includes indices of any health status.

  • :include_unloaded_segments (Boolean)

    If true, the response includes information from segments that are not loaded into memory.

  • :pri (Boolean)

    If true, the response only includes information from primary shards.

  • :time (String)

    The unit used to display time values.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def indices(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _index = arguments.delete(:index)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _index
             "_cat/indices/#{Utils.listify(_index)}"
           else
             "_cat/indices"
           end
  params = Utils.process_params(arguments)
  params[:h] = Utils.listify(params[:h]) if params[:h]

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#ml_data_frame_analytics(arguments = {}) ⇒ Object

Gets configuration and usage information about data frame analytics jobs.

Options Hash (arguments):

  • :id (String)

    The ID of the data frame analytics to fetch

  • :allow_no_match (Boolean)

    Whether to ignore if a wildcard expression matches no configs. (This includes _all string or when no configs have been specified)

  • :bytes (String)

    The unit in which to display byte values

  • :h (String, Array<String>)

    Comma-separated list of column names to display. Server default: create_time,id,state,type.

  • :s (String, Array<String>)

    Comma-separated list of column names or column aliases used to sort the response.

  • :time (Time)

    Unit used to display time values.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb', line 44

def ml_data_frame_analytics(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _id = arguments.delete(:id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _id
             "_cat/ml/data_frame/analytics/#{Utils.listify(_id)}"
           else
             "_cat/ml/data_frame/analytics"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#ml_datafeeds(arguments = {}) ⇒ Object

Gets configuration and usage information about datafeeds.

Options Hash (arguments):

  • :datafeed_id (String)

    A numerical character string that uniquely identifies the datafeed.

  • :allow_no_match (Boolean)

    Specifies what to do when the request: * Contains wildcard expressions and there are no datafeeds that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty datafeeds array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :h (String, Array<String>)

    Comma-separated list of column names to display. Server default: [‘bc’, ‘id’, ‘sc’, ‘s’].

  • :s (String, Array<String>)

    Comma-separated list of column names or column aliases used to sort the response.

  • :time (String)

    The unit used to display time values.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb', line 43

def ml_datafeeds(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _datafeed_id = arguments.delete(:datafeed_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _datafeed_id
             "_cat/ml/datafeeds/#{Utils.listify(_datafeed_id)}"
           else
             "_cat/ml/datafeeds"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#ml_jobs(arguments = {}) ⇒ Object

Gets configuration and usage information about anomaly detection jobs.

Options Hash (arguments):

  • :job_id (String)

    Identifier for the anomaly detection job.

  • :allow_no_match (Boolean)

    Specifies what to do when the request: * Contains wildcard expressions and there are no jobs that match. * Contains the _all string or no identifiers and there are no matches. * Contains wildcard expressions and there are only partial matches. If true, the API returns an empty jobs array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :bytes (String)

    The unit used to display byte values.

  • :h (String, Array<String>)

    Comma-separated list of column names to display. Server default: buckets.count,data.processed_records,forecasts.total,id,model.bytes,model.memory_status,state.

  • :s (String, Array<String>)

    Comma-separated list of column names or column aliases used to sort the response.

  • :time (String)

    The unit used to display time values.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch-serverless/api/cat/ml_jobs.rb', line 44

def ml_jobs(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _job_id = arguments.delete(:job_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _job_id
             "_cat/ml/anomaly_detectors/#{Utils.listify(_job_id)}"
           else
             "_cat/ml/anomaly_detectors"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#ml_trained_models(arguments = {}) ⇒ Object

Gets configuration and usage information about inference trained models.

Options Hash (arguments):

  • :model_id (String)

    A unique identifier for the trained model.

  • :allow_no_match (Boolean)

    Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If true, the API returns an empty array when there are no matches and the subset of results when there are partial matches. If false, the API returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :bytes (String)

    The unit used to display byte values.

  • :h (String, Array<String>)

    A comma-separated list of column names to display.

  • :s (String, Array<String>)

    A comma-separated list of column names or aliases used to sort the response.

  • :from (Integer)

    Skips the specified number of transforms.

  • :size (Integer)

    The maximum number of transforms to display.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def ml_trained_models(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _model_id = arguments.delete(:model_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _model_id
             "_cat/ml/trained_models/#{Utils.listify(_model_id)}"
           else
             "_cat/ml/trained_models"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end

#transforms(arguments = {}) ⇒ Object

Gets configuration and usage information about transforms.

Options Hash (arguments):

  • :transform_id (String)

    A transform identifier or a wildcard expression. If you do not specify one of these options, the API returns information for all transforms.

  • :allow_no_match (Boolean)

    Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If true, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches. If false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :from (Integer)

    Skips the specified number of transforms. Server default: 0.

  • :h (String, Array<String>)

    Comma-separated list of column names to display. Server default: changes_last_detection_time,checkpoint,checkpoint_progress,documents_processed,id,last_search_time,state.

  • :s (String, Array<String>)

    Comma-separated list of column names or column aliases used to sort the response.

  • :time (String)

    The unit used to display time values.

  • :size (Integer)

    The maximum number of transforms to obtain. Server default: 100.

  • :format (String)

    Specifies the format to return the columnar data in, can be set to text, json, cbor, yaml, or smile. Server default: text.

  • :h (String, Array<String>)

    List of columns to appear in the response. Supports simple wildcards.

  • :help (Boolean)

    When set to true will output available columns. This option can’t be combined with any other query string option.

  • :local (Boolean)

    If true, the request computes the list of selected nodes from the local cluster state. If false the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node.

  • :master_timeout (Time)

    Period to wait for a connection to the master node. Server default: 30s.

  • :s (String, Array<String>)

    List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting :asc or :desc as a suffix to the column name.

  • :v (Boolean)

    When set to true will enable verbose output.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

def transforms(arguments = {})
  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _transform_id
             "_cat/transforms/#{Utils.listify(_transform_id)}"
           else
             "_cat/transforms"
           end
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end