module Elasticsearch::API::Transform::Actions

Public Instance Methods

delete_transform(arguments = {}) click to toggle source

Deletes an existing transform.

@option arguments [String] :transform_id The id of the transform to delete @option arguments [Boolean] :force When ‘true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. @option arguments [Boolean] :delete_dest_index When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. @option arguments [Time] :timeout Controls the time to wait for the transform deletion @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/delete-transform.html

# File lib/elasticsearch/api/actions/transform/delete_transform.rb, line 35
def delete_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.delete_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_transform/#{Utils.__listify(_transform_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_node_stats(arguments = {}) click to toggle source

Retrieves transform usage information for transform nodes.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-transform-node-stats.html

# File lib/elasticsearch/api/actions/transform/get_node_stats.rb, line 31
def get_node_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.get_node_stats' }

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

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_transform/_node_stats'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_transform(arguments = {}) click to toggle source

Retrieves configuration information for transforms.

@option arguments [String] :transform_id The id or comma delimited list of id expressions of the transforms to get, ‘_all’ or ‘*’ implies get all transforms @option arguments [Integer] :from skips a number of transform configs, defaults to 0 @option arguments [Integer] :size specifies a max number of transforms to get, defaults to 100 @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes ‘_all` string or when no transforms have been specified) @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on transform PUT @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-transform.html

# File lib/elasticsearch/api/actions/transform/get_transform.rb, line 36
def get_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  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 = Elasticsearch::API::HTTP_GET
  path   = if _transform_id
             "_transform/#{Utils.__listify(_transform_id)}"
           else
             '_transform'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
get_transform_stats(arguments = {}) click to toggle source

Retrieves usage information for transforms.

@option arguments [String] :transform_id The id of the transform for which to get stats. ‘_all’ or ‘*’ implies all transforms @option arguments [Number] :from skips a number of transform stats, defaults to 0 @option arguments [Number] :size specifies a max number of transform stats to get, defaults to 100 @option arguments [Time] :timeout Controls the time to wait for the stats @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes ‘_all` string or when no transforms have been specified) @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/get-transform-stats.html

# File lib/elasticsearch/api/actions/transform/get_transform_stats.rb, line 36
def get_transform_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform_stats' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_GET
  path   = "_transform/#{Utils.__listify(_transform_id)}/_stats"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
preview_transform(arguments = {}) click to toggle source

Previews a transform.

@option arguments [String] :transform_id The id of the transform to preview. @option arguments [Time] :timeout Controls the time to wait for the preview @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The definition for the transform to preview

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/preview-transform.html

# File lib/elasticsearch/api/actions/transform/preview_transform.rb, line 34
def preview_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.preview_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

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

  body = arguments.delete(:body)

  _transform_id = arguments.delete(:transform_id)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _transform_id
           "_transform/#{Utils.__listify(_transform_id)}/_preview"
         else
           '_transform/_preview'
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
put_transform(arguments = {}) click to toggle source

Instantiates a transform.

@option arguments [String] :transform_id The id of the new transform. @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false. @option arguments [Time] :timeout Controls the time to wait for the transform to start @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The transform definition (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/put-transform.html

# File lib/elasticsearch/api/actions/transform/put_transform.rb, line 35
def put_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.put_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = arguments.delete(:body)

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_transform/#{Utils.__listify(_transform_id)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
reset_transform(arguments = {}) click to toggle source

Resets an existing transform.

@option arguments [String] :transform_id The id of the transform to reset @option arguments [Boolean] :force When ‘true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. @option arguments [Time] :timeout Controls the time to wait for the transform to reset @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/reset-transform.html

# File lib/elasticsearch/api/actions/transform/reset_transform.rb, line 34
def reset_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.reset_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_transform/#{Utils.__listify(_transform_id)}/_reset"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
schedule_now_transform(arguments = {}) click to toggle source

Schedules now a transform.

@option arguments [String] :transform_id The id of the transform. (Required) @option arguments [Time] :timeout Controls the time to wait for the scheduling to take place @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/schedule-now-transform.html

# File lib/elasticsearch/api/actions/transform/schedule_now_transform.rb, line 33
def schedule_now_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.schedule_now_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_transform/#{Utils.__listify(_transform_id)}/_schedule_now"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
start_transform(arguments = {}) click to toggle source

Starts one or more transforms.

@option arguments [String] :transform_id The id of the transform to start @option arguments [String] :from Restricts the set of transformed entities to those changed after this time @option arguments [Time] :timeout Controls the time to wait for the transform to start @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/start-transform.html

# File lib/elasticsearch/api/actions/transform/start_transform.rb, line 34
def start_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.start_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_transform/#{Utils.__listify(_transform_id)}/_start"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
stop_transform(arguments = {}) click to toggle source

Stops one or more transforms.

@option arguments [String] :transform_id The id of the transform to stop @option arguments [Boolean] :force Whether to force stop a failed transform or not. Default to false @option arguments [Boolean] :wait_for_completion Whether to wait for the transform to fully stop before returning or not. Default to false @option arguments [Time] :timeout Controls the time to wait until the transform has stopped. Default to 30 seconds @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes ‘_all` string or when no transforms have been specified) @option arguments [Boolean] :wait_for_checkpoint Whether to wait for the transform to reach a checkpoint before stopping. Default to false @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/stop-transform.html

# File lib/elasticsearch/api/actions/transform/stop_transform.rb, line 37
def stop_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.stop_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_transform/#{Utils.__listify(_transform_id)}/_stop"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
update_transform(arguments = {}) click to toggle source

Updates certain properties of a transform.

@option arguments [String] :transform_id The id of the transform. (Required) @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false. @option arguments [Time] :timeout Controls the time to wait for the update @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The update transform definition (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/update-transform.html

# File lib/elasticsearch/api/actions/transform/update_transform.rb, line 35
def update_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.update_transform' }

  defined_params = [:transform_id].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'transform_id' missing" unless arguments[:transform_id]

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

  body = arguments.delete(:body)

  _transform_id = arguments.delete(:transform_id)

  method = Elasticsearch::API::HTTP_POST
  path   = "_transform/#{Utils.__listify(_transform_id)}/_update"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end
upgrade_transforms(arguments = {}) click to toggle source

Upgrades all transforms.

@option arguments [Boolean] :dry_run Whether to only check for updates but don’t execute @option arguments [Time] :timeout Controls the time to wait for the upgrade @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/8.16/upgrade-transforms.html

# File lib/elasticsearch/api/actions/transform/upgrade_transforms.rb, line 33
def upgrade_transforms(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'transform.upgrade_transforms' }

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

  body   = nil

  method = Elasticsearch::API::HTTP_POST
  path   = '_transform/_upgrade'
  params = Utils.process_params(arguments)

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