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
Delete component templates.
-
#exists_component_template(arguments = {}) ⇒ Object
(also: #exists_component_template?)
Check component templates.
-
#get_component_template(arguments = {}) ⇒ Object
Get component templates.
-
#info(arguments = {}) ⇒ Object
Get cluster info.
-
#put_component_template(arguments = {}) ⇒ Object
Create or update a component template.
Instance Method Details
#delete_component_template(arguments = {}) ⇒ Object
Delete component templates. Deletes component templates. Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases.
38 39 40 41 42 43 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/cluster/delete_component_template.rb', line 38 def delete_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cluster.delete_component_template" } 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? 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, request_opts) ) end |
#exists_component_template(arguments = {}) ⇒ Object Also known as: exists_component_template?
Check component templates. Returns information about whether a particular component template exists.
39 40 41 42 43 44 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/cluster/exists_component_template.rb', line 39 def exists_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cluster.exists_component_template" } 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? 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, request_opts) ) end |
#get_component_template(arguments = {}) ⇒ Object
Get component templates. Retrieves information about component templates.
40 41 42 43 44 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-serverless/api/cluster/get_component_template.rb', line 40 def get_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cluster.get_component_template" } 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 "_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, request_opts) ) end |
#info(arguments = {}) ⇒ Object
Get cluster info. Returns basic information about the cluster.
33 34 35 36 37 38 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/cluster/info.rb', line 33 def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cluster.info" } defined_params = [:target].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? 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, request_opts) ) end |
#put_component_template(arguments = {}) ⇒ Object
Create or update a component template. 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.
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/cluster/put_component_template.rb', line 51 def put_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || "cluster.put_component_template" } 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? 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, request_opts) ) end |