Resolve import errors API

[experimental] 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. Resolve errors from the import API.

To resolve errors, you can:

  • Retry certain saved objects
  • Overwrite specific saved objects
  • Change references to different saved objects

Request

POST <kibana host>:<port>/api/saved_objects/_resolve_import_errors

POST <kibana host>:<port>/s/<space_id>/api/saved_objects/_resolve_import_errors

Path parameters

space_id

(Optional, string) An identifier for the space. If space_id is not provided in the URL, the default space is used.

Request body

The request body must include the multipart/form-data type.

file

The same file given to the import API.

retries

(array) A list of type, id, replaceReferences, and overwrite objects to retry. The property replaceReferences is a list of type, from, and to used to change the object references.

Response body

success

Top-level property that indicates if the errors successfully resolved.

successCount

Indicates the number of successfully resolved records.

errors

(array) Specifies the objects that failed to resolve.

Response code

200

Indicates a successful call.

Examples

Retry a dashboard import:

  1. $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard"}]'

The file.ndjson file contains the following:

  1. {"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}

The API returns the following:

  1. {
  2. "success": true,
  3. "successCount": 1
  4. }

Resolve errors for a dashboard and overwrite the existing saved object:

  1. $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard","overwrite":true}]'

The file.ndjson file contains the following:

  1. {"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
  2. {"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}

The API returns the following:

  1. {
  2. "success": true,
  3. "successCount": 1
  4. }

Resolve errors for a visualization by replacing the index pattern with another:

  1. $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"missing","to":"existing"}]}]'

The file.ndjson file contains the following:

  1. {"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"missing"}]}

The API returns the following:

  1. {
  2. "success": true,
  3. "successCount": 1
  4. }

Most Popular