Module: Elasticsearch::API::Transform::Actions

Included in:
TransformClient
Defined in:
lib/elasticsearch/api/namespace/transform.rb,
lib/elasticsearch/api/actions/transform/get_transform.rb,
lib/elasticsearch/api/actions/transform/put_transform.rb,
lib/elasticsearch/api/actions/transform/stop_transform.rb,
lib/elasticsearch/api/actions/transform/reset_transform.rb,
lib/elasticsearch/api/actions/transform/start_transform.rb,
lib/elasticsearch/api/actions/transform/delete_transform.rb,
lib/elasticsearch/api/actions/transform/update_transform.rb,
lib/elasticsearch/api/actions/transform/preview_transform.rb,
lib/elasticsearch/api/actions/transform/upgrade_transforms.rb,
lib/elasticsearch/api/actions/transform/get_transform_stats.rb,
lib/elasticsearch/api/actions/transform/schedule_now_transform.rb

Instance Method Summary collapse

Instance Method Details

#delete_transform(arguments = {}) ⇒ Object

Deletes an existing transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform to delete

  • :force (Boolean)

    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.

  • :delete_dest_index (Boolean)

    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.

  • :timeout (Time)

    Controls the time to wait for the transform deletion

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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].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 '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_transform(arguments = {}) ⇒ Object

Retrieves configuration information for transforms.

Options Hash (arguments):

  • :transform_id (String)

    The id or comma delimited list of id expressions of the transforms to get, ‘_all’ or ‘*’ implies get all transforms

  • :from (Integer)

    skips a number of transform configs, defaults to 0

  • :size (Integer)

    specifies a max number of transforms to get, defaults to 100

  • :allow_no_match (Boolean)

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

  • :exclude_generated (Boolean)

    Omits fields that are illegal to set on transform PUT

  • :headers (Hash)

    Custom HTTP headers

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



36
37
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/api/actions/transform/get_transform.rb', line 36

def get_transform(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || "transform.get_transform" }

  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 = 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 = {}) ⇒ Object

Retrieves usage information for transforms.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform for which to get stats. ‘_all’ or ‘*’ implies all transforms

  • :from (Number)

    skips a number of transform stats, defaults to 0

  • :size (Number)

    specifies a max number of transform stats to get, defaults to 100

  • :timeout (Time)

    Controls the time to wait for the stats

  • :allow_no_match (Boolean)

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

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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].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 '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 = {}) ⇒ Object

Previews a transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform to preview.

  • :timeout (Time)

    Controls the time to wait for the preview

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The definition for the transform to preview

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



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
59
60
61
62
63
64
65
66
# 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].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 = 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 = {}) ⇒ Object

Instantiates a transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the new transform.

  • :defer_validation (Boolean)

    If validations should be deferred until transform starts, defaults to false.

  • :timeout (Time)

    Controls the time to wait for the transform to start

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The transform definition (Required)

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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].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 '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 = {}) ⇒ Object

Resets an existing transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform to reset

  • :force (Boolean)

    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.

  • :timeout (Time)

    Controls the time to wait for the transform to reset

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



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
59
# 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].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 '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 = {}) ⇒ Object

Schedules now a transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform. (Required)

  • :timeout (Time)

    Controls the time to wait for the scheduling to take place

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



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/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].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 '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 = {}) ⇒ Object

Starts one or more transforms.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform to start

  • :from (String)

    Restricts the set of transformed entities to those changed after this time

  • :timeout (Time)

    Controls the time to wait for the transform to start

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



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
59
# 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].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 '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 = {}) ⇒ Object

Stops one or more transforms.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform to stop

  • :force (Boolean)

    Whether to force stop a failed transform or not. Default to false

  • :wait_for_completion (Boolean)

    Whether to wait for the transform to fully stop before returning or not. Default to false

  • :timeout (Time)

    Controls the time to wait until the transform has stopped. Default to 30 seconds

  • :allow_no_match (Boolean)

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

  • :wait_for_checkpoint (Boolean)

    Whether to wait for the transform to reach a checkpoint before stopping. Default to false

  • :headers (Hash)

    Custom HTTP headers

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



37
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
# 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].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 '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 = {}) ⇒ Object

Updates certain properties of a transform.

Options Hash (arguments):

  • :transform_id (String)

    The id of the transform. (Required)

  • :defer_validation (Boolean)

    If validations should be deferred until transform starts, defaults to false.

  • :timeout (Time)

    Controls the time to wait for the update

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The update transform definition (Required)

Raises:

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# 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].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 '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 = {}) ⇒ Object

Upgrades all transforms.

Options Hash (arguments):

  • :dry_run (Boolean)

    Whether to only check for updates but don’t execute

  • :timeout (Time)

    Controls the time to wait for the upgrade

  • :headers (Hash)

    Custom HTTP headers

See Also:

Parameters:

  • (defaults to: {})

    a customizable set of options



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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