Module: ElasticsearchServerless::API::Cluster::Actions
- Defined in:
- lib/elasticsearch-serverless/api/cluster/info.rb,
lib/elasticsearch-serverless/api/cluster/get_component_template.rb,
lib/elasticsearch-serverless/api/cluster/put_component_template.rb,
lib/elasticsearch-serverless/api/cluster/delete_component_template.rb,
lib/elasticsearch-serverless/api/cluster/exists_component_template.rb
Instance Method Summary collapse
-
#delete_component_template(arguments = {}) ⇒ Object
Deletes component templates.
-
#exists_component_template(arguments = {}) ⇒ Object
(also: #exists_component_template?)
Returns information about whether a particular component template exist.
-
#get_component_template(arguments = {}) ⇒ Object
Retrieves information about component templates.
-
#info(arguments = {}) ⇒ Object
Returns different information about the cluster.
-
#put_component_template(arguments = {}) ⇒ Object
Creates or updates a component template.
Instance Method Details
#delete_component_template(arguments = {}) ⇒ Object
Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/elasticsearch-serverless/api/cluster/delete_component_template.rb', line 35 def delete_component_template(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = ElasticsearchServerless::API::HTTP_DELETE path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#exists_component_template(arguments = {}) ⇒ Object Also known as: exists_component_template?
Returns information about whether a particular component template exist
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/elasticsearch-serverless/api/cluster/exists_component_template.rb', line 34 def exists_component_template(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = ElasticsearchServerless::API::HTTP_HEAD path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#get_component_template(arguments = {}) ⇒ Object
Retrieves information about component templates.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/elasticsearch-serverless/api/cluster/get_component_template.rb', line 36 def get_component_template(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = ElasticsearchServerless::API::HTTP_GET path = if _name "_component_template/#{Utils.listify(_name)}" else "_component_template" end params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#info(arguments = {}) ⇒ Object
Returns different information about the cluster.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch-serverless/api/cluster/info.rb', line 32 def info(arguments = {}) raise ArgumentError, "Required argument 'target' missing" unless arguments[:target] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _target = arguments.delete(:target) method = ElasticsearchServerless::API::HTTP_GET path = "_info/#{Utils.listify(_target)}" params = {} ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#put_component_template(arguments = {}) ⇒ Object
Creates or updates a component template. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
An index template can be composed of multiple component templates. To use a component template, specify it in an index template’s composed_of list. Component templates are only applied to new data streams and indices as part of a matching index template.
Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template.
Component templates are only used during index creation. For data streams, this includes data stream creation and the creation of a stream’s backing indices. Changes to component templates do not affect existing indices, including a stream’s backing indices.
You can use C-style /* */ block comments in component templates. You can include comments anywhere in the request body except before the opening curly bracket.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/elasticsearch-serverless/api/cluster/put_component_template.rb', line 49 def put_component_template(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _name = arguments.delete(:name) method = ElasticsearchServerless::API::HTTP_PUT path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) ElasticsearchServerless::API::Response.new( perform_request(method, path, params, body, headers) ) end |