Module: Elasticsearch::API::Encryption::Actions

Defined in:
lib/elasticsearch/api/actions/encryption/reset.rb

Instance Method Summary collapse

Instance Method Details

#reset(arguments = {}) ⇒ Object

Reset the project encryption key. Destroy the current project encryption key (PEK) and generate a new one. This is the recovery path for when the on-disk encrypted PEK becomes permanently inaccessible, for example because the key encryption material protecting it was lost. All data that was encrypted under the destroyed key becomes permanently unrecoverable. Each feature that stores encrypted data decides how to handle its own data during the reset: some features drop the encrypted values entirely, while others preserve the rest of the affected data and only clear the values that can no longer be decrypted. Because this operation causes permanent data loss, it requires the accept_data_loss query parameter to be set to true. This functionality is experimental and is not ready for production usage. Experimental features may change or be removed at any time. Elastic will work to fix any issues, but experimental features are not subject to the support SLA of official GA features. Specific Support terms apply.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :accept_data_loss (Boolean)

    Acknowledge that resetting the project encryption key permanently destroys all data that was encrypted under the current key. The request fails if this is not set to true. (Required)

  • :master_timeout (Time)

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

  • :timeout (Time)

    The 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.

  • :error_trace (Boolean)

    When set to true Elasticsearch will include the full stack trace of errors when they occur.

  • :filter_path (String, Array<String>)

    Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch.

  • :human (Boolean)

    When set to true will return statistics in a format suitable for humans. For example "exists_time": "1h" for humans and "exists_time_in_millis": 3600000 for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines.

  • :pretty (Boolean)

    If set to true the returned JSON will be "pretty-formatted". Only use this option for debugging only.

  • :headers (Hash)

    Custom HTTP headers

See Also:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/elasticsearch/api/actions/encryption/reset.rb', line 62

def reset(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'encryption.reset' }

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

  body = nil

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

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