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
-
#aliases(arguments = {}) ⇒ Object
Get aliases.
-
#component_templates(arguments = {}) ⇒ Object
Get component templates.
-
#count(arguments = {}) ⇒ Object
Get a document count.
-
#help(arguments = {}) ⇒ Object
Get CAT help.
-
#indices(arguments = {}) ⇒ Object
Get index information.
-
#ml_data_frame_analytics(arguments = {}) ⇒ Object
Get data frame analytics jobs.
-
#ml_datafeeds(arguments = {}) ⇒ Object
Get datafeeds.
-
#ml_jobs(arguments = {}) ⇒ Object
Get anomaly detection jobs.
-
#ml_trained_models(arguments = {}) ⇒ Object
Get trained models.
-
#transforms(arguments = {}) ⇒ Object
Get transforms.
Instance Method Details
#aliases(arguments = {}) ⇒ Object
Get aliases. Retrieves the cluster’s index aliases, including filter and routing information. The API does not return data stream aliases. CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/elasticsearch-serverless/api/cat/aliases.rb', line 46 def aliases(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.aliases" } defined_params = [:name].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#component_templates(arguments = {}) ⇒ Object
Get component templates. Returns information about component templates in a cluster. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get component template API.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/elasticsearch-serverless/api/cat/component_templates.rb', line 50 def component_templates(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.component_templates" } defined_params = [:name].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#count(arguments = {}) ⇒ Object
Get a document count. Provides quick access to a document count for a data stream, an index, or an entire cluster. The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the count API.
47 48 49 50 51 52 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-serverless/api/cat/count.rb', line 47 def count(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.count" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#help(arguments = {}) ⇒ Object
Get CAT help. Returns help for the CAT APIs.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch-serverless/api/cat/help.rb', line 42 def help(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.help" } 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, request_opts) ) end |
#indices(arguments = {}) ⇒ Object
Get index information. Returns high-level information about indices in a cluster, including backing indices for data streams. Use this request to get the following information for each index in a cluster:
-
shard count
-
document count
-
deleted document count
-
primary store size
-
total store size of all shards, including shard replicas
These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. To get an accurate count of Elasticsearch documents, use the cat count or count APIs. CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use an index endpoint.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/elasticsearch-serverless/api/cat/indices.rb', line 60 def indices(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.indices" } defined_params = [:index].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#ml_data_frame_analytics(arguments = {}) ⇒ Object
Get data frame analytics jobs. Returns configuration and usage information about data frame analytics jobs. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get data frame analytics jobs statistics API.
52 53 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 79 |
# File 'lib/elasticsearch-serverless/api/cat/ml_data_frame_analytics.rb', line 52 def ml_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.ml_data_frame_analytics" } defined_params = [:id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#ml_datafeeds(arguments = {}) ⇒ Object
Get datafeeds. Returns configuration and usage information about datafeeds. This API returns a maximum of 10,000 datafeeds. If the Elasticsearch security features are enabled, you must have monitor_ml
, monitor
, manage_ml
, or manage
cluster privileges to use this API. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get datafeed statistics API.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/elasticsearch-serverless/api/cat/ml_datafeeds.rb', line 59 def ml_datafeeds(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.ml_datafeeds" } defined_params = [:datafeed_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#ml_jobs(arguments = {}) ⇒ Object
Get anomaly detection jobs. Returns configuration and usage information for anomaly detection jobs. This API returns a maximum of 10,000 jobs. If the Elasticsearch security features are enabled, you must have monitor_ml
, monitor
, manage_ml
, or manage
cluster privileges to use this API. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get anomaly detection job statistics API.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/elasticsearch-serverless/api/cat/ml_jobs.rb', line 60 def ml_jobs(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.ml_jobs" } defined_params = [:job_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#ml_trained_models(arguments = {}) ⇒ Object
Get trained models. Returns configuration and usage information about inference trained models. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get trained models statistics API.
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 79 80 81 |
# File 'lib/elasticsearch-serverless/api/cat/ml_trained_models.rb', line 54 def ml_trained_models(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.ml_trained_models" } defined_params = [:model_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |
#transforms(arguments = {}) ⇒ Object
Get transforms. Returns configuration and usage information about transforms. CAT APIs are only intended for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, use the get transform statistics API.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/elasticsearch-serverless/api/cat/transforms.rb', line 55 def transforms(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cat.transforms" } defined_params = [:transform_id].inject({}) do |set_variables, variable| set_variables[variable] = arguments[variable] if arguments.key?(variable) set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? 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, request_opts) ) end |