Module: ElasticsearchServerless::API::Transform::Actions

Defined in:
lib/elasticsearch-serverless/api/transform/get_transform.rb,
lib/elasticsearch-serverless/api/transform/put_transform.rb,
lib/elasticsearch-serverless/api/transform/stop_transform.rb,
lib/elasticsearch-serverless/api/transform/reset_transform.rb,
lib/elasticsearch-serverless/api/transform/start_transform.rb,
lib/elasticsearch-serverless/api/transform/delete_transform.rb,
lib/elasticsearch-serverless/api/transform/update_transform.rb,
lib/elasticsearch-serverless/api/transform/preview_transform.rb,
lib/elasticsearch-serverless/api/transform/get_transform_stats.rb,
lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb

Instance Method Summary collapse

Instance Method Details

#delete_transform(arguments = {}) ⇒ Object

Deletes an existing transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. (Required)

  • :force (Boolean)

    If this value is false, the transform must be stopped before it can be deleted. If true, the transform is deleted regardless of its current state.

  • :delete_dest_index (Boolean)

    If this value is true, the destination index is deleted together with the transform. If false, the destination index will not be deleted

  • :timeout (Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/elasticsearch-serverless/api/transform/delete_transform.rb', line 35

def delete_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_DELETE
  path   = "_transform/#{Utils.listify(_transform_id)}"
  params = Utils.process_params(arguments)

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

#get_transform(arguments = {}) ⇒ Object

Retrieves configuration information for transforms.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String, Array<String>)

    Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>.

  • :allow_no_match (Boolean)

    Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :from (Integer)

    Skips the specified number of transforms. Server default: 0.

  • :size (Integer)

    Specifies the maximum number of transforms to obtain. Server default: 100.

  • :exclude_generated (Boolean)

    Excludes fields that were automatically added when creating the transform. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  body = nil

  _transform_id = arguments.delete(:transform_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = if _transform_id
             "_transform/#{Utils.listify(_transform_id)}"
           else
             "_transform"
           end
  params = Utils.process_params(arguments)

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

#get_transform_stats(arguments = {}) ⇒ Object

Retrieves usage information for transforms.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String, Array<String>)

    Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using _all, by specifying * as the <transform_id>, or by omitting the <transform_id>. (Required)

  • :allow_no_match (Boolean)

    Specifies what to do when the request: 1. Contains wildcard expressions and there are no transforms that match. 2. Contains the _all string or no identifiers and there are no matches. 3. Contains wildcard expressions and there are only partial matches. If this parameter is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :from (Integer)

    Skips the specified number of transforms. Server default: 0.

  • :size (Integer)

    Specifies the maximum number of transforms to obtain. Server default: 100.

  • :timeout (Time)

    Controls the time to wait for the stats

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch-serverless/api/transform/get_transform_stats.rb', line 36

def get_transform_stats(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_GET
  path   = "_transform/#{Utils.listify(_transform_id)}/_stats"
  params = Utils.process_params(arguments)

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

#preview_transform(arguments = {}) ⇒ Object

Previews a transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in the request body.

  • :timeout (Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

See Also:



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/transform/preview_transform.rb', line 34

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

  body = arguments.delete(:body)

  _transform_id = arguments.delete(:transform_id)

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

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

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

#put_transform(arguments = {}) ⇒ Object

Instantiates a transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (Required)

  • :defer_validation (Boolean)

    When the transform is created, a series of validations occur to ensure its success. For example, there is a check for the existence of the source indices and a check that the destination index is not part of the source index pattern. You can use this parameter to skip the checks, for example when the source index does not exist until after the transform is created. The validations are always run when you start the transform, however, with the exception of privilege checks.

  • :timeout (Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch-serverless/api/transform/put_transform.rb', line 35

def put_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_PUT
  path   = "_transform/#{Utils.listify(_transform_id)}"
  params = Utils.process_params(arguments)

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

#reset_transform(arguments = {}) ⇒ Object

Resets an existing transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (Required)

  • :force (Boolean)

    If this value is true, the transform is reset regardless of its current state. If it’s false, the transform must be stopped before it can be reset.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/elasticsearch-serverless/api/transform/reset_transform.rb', line 33

def reset_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_POST
  path   = "_transform/#{Utils.listify(_transform_id)}/_reset"
  params = Utils.process_params(arguments)

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

#schedule_now_transform(arguments = {}) ⇒ Object

Schedules now a transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. (Required)

  • :timeout (Time)

    Controls the time to wait for the scheduling to take place Server default: 30s.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/elasticsearch-serverless/api/transform/schedule_now_transform.rb', line 33

def schedule_now_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_POST
  path   = "_transform/#{Utils.listify(_transform_id)}/_schedule_now"
  params = Utils.process_params(arguments)

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

#start_transform(arguments = {}) ⇒ Object

Starts one or more transforms.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. (Required)

  • :timeout (Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.

  • :from (String)

    Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/elasticsearch-serverless/api/transform/start_transform.rb', line 34

def start_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_POST
  path   = "_transform/#{Utils.listify(_transform_id)}/_start"
  params = Utils.process_params(arguments)

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

#stop_transform(arguments = {}) ⇒ Object

Stops one or more transforms.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, use _all or * as the identifier. (Required)

  • :allow_no_match (Boolean)

    Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the _all string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. If it is true, the API returns a successful acknowledgement message when there are no matches. When there are only partial matches, the API stops the appropriate transforms. If it is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true.

  • :force (Boolean)

    If it is true, the API forcefully stops the transforms.

  • :timeout (Time)

    Period to wait for a response when wait_for_completion is true. If no response is received before the timeout expires, the request returns a timeout exception. However, the request continues processing and eventually moves the transform to a STOPPED state. Server default: 30s.

  • :wait_for_checkpoint (Boolean)

    If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, the transform stops as soon as possible.

  • :wait_for_completion (Boolean)

    If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns immediately and the indexer is stopped asynchronously in the background.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/elasticsearch-serverless/api/transform/stop_transform.rb', line 37

def stop_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_POST
  path   = "_transform/#{Utils.listify(_transform_id)}/_stop"
  params = Utils.process_params(arguments)

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

#update_transform(arguments = {}) ⇒ Object

Updates certain properties of a transform.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :transform_id (String)

    Identifier for the transform. (Required)

  • :defer_validation (Boolean)

    When true, deferrable validations are not run. This behavior may be desired if the source index does not exist until after the transform is created.

  • :timeout (Time)

    Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch-serverless/api/transform/update_transform.rb', line 35

def update_transform(arguments = {})
  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 = ElasticsearchServerless::API::HTTP_POST
  path   = "_transform/#{Utils.listify(_transform_id)}/_update"
  params = Utils.process_params(arguments)

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