Module: ElasticsearchServerless::API::QueryRuleset::Actions

Defined in:
lib/elasticsearch-serverless/api/query_ruleset/get.rb,
lib/elasticsearch-serverless/api/query_ruleset/put.rb,
lib/elasticsearch-serverless/api/query_ruleset/list.rb,
lib/elasticsearch-serverless/api/query_ruleset/delete.rb

Instance Method Summary collapse

Instance Method Details

#delete(arguments = {}) ⇒ Object

Deletes a query ruleset. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :ruleset_id (String)

    The unique identifier of the query ruleset to delete (Required)

  • :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/query_ruleset/delete.rb', line 36

def delete(arguments = {})
  raise ArgumentError, "Required argument 'ruleset_id' missing" unless arguments[:ruleset_id]

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

  body = nil

  _ruleset_id = arguments.delete(:ruleset_id)

  method = ElasticsearchServerless::API::HTTP_DELETE
  path   = "_query_rules/#{Utils.listify(_ruleset_id)}"
  params = {}

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

#get(arguments = {}) ⇒ Object

Returns the details about a query ruleset. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :ruleset_id (String)

    The unique identifier of the query ruleset (Required)

  • :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/query_ruleset/get.rb', line 36

def get(arguments = {})
  raise ArgumentError, "Required argument 'ruleset_id' missing" unless arguments[:ruleset_id]

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

  body = nil

  _ruleset_id = arguments.delete(:ruleset_id)

  method = ElasticsearchServerless::API::HTTP_GET
  path   = "_query_rules/#{Utils.listify(_ruleset_id)}"
  params = {}

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

#list(arguments = {}) ⇒ Object

Lists query rulesets. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :from (Integer)

    Starting offset (default: 0)

  • :size (Integer)

    specifies a max number of results to get

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/elasticsearch-serverless/api/query_ruleset/list.rb', line 37

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

  body = nil

  method = ElasticsearchServerless::API::HTTP_GET
  path   = "_query_rules"
  params = Utils.process_params(arguments)

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

#put(arguments = {}) ⇒ Object

Creates or updates a query ruleset. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :ruleset_id (String)

    The unique identifier of the query ruleset to be created or updated (Required)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



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

def put(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'ruleset_id' missing" unless arguments[:ruleset_id]

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

  body = arguments.delete(:body)

  _ruleset_id = arguments.delete(:ruleset_id)

  method = ElasticsearchServerless::API::HTTP_PUT
  path   = "_query_rules/#{Utils.listify(_ruleset_id)}"
  params = {}

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