Resolve copy saved objects to space conflicts 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. Overwrite saved objects that are returned as errors from the copy saved objects to space API.

Request

POST <kibana host>:<port>/api/spaces/_resolve_copy_saved_objects_errors

POST <kibana host>:<port>/s/<space_id>/api/spaces/_resolve_copy_saved_objects_errors

Prerequisites

Execute the copy saved objects to space API, which returns the errors for you to resolve.

Path parameters

space_id

(Optional, string) The ID of the space that contains the saved objects you want to copy. When space_id is unspecified in the URL, the default space is used. The space_id must be the same value used during the failed copy saved objects to space API operation.

Request body

objects

(Required, object array) The saved objects to copy. The objects must be the same values used during the failed copy saved objects to space API operation.

Properties of objects

  • type

    (Required, string) The saved object type.

    id

    (Required, string) The saved object ID.

includeReferences

(Optional, boolean) When set to true, all saved objects related to the specified saved objects are copied into the target spaces. The includeReferences must be the same values used during the failed copy saved objects to space API operation. The default value is false.

retries

(Required, object) The retry operations to attempt. Object keys represent the target space IDs.

Properties of retries

  • <space_id>

    (Required, array) The errors to resolve for the specified <space_id>.

    Properties of <space_id>

    • type

      (Required, string) The saved object type.

      id

      (Required, string) The saved object ID.

      overwrite

      (Required, boolean) When set to true, the saved object from the source space (desigated by the space_id path parameter) overwrites the conflicting object in the destination space. When set to false, this does nothing.

Response body

<space_id>

(object) An object that describes the result of the copy operation for the space. Includes the dynamic keys in the response.

Properties of <space_id>

  • success

    (boolean) The copy operation was successful. When set to false, some objects may have been copied. For additional information, refer to the successCount and errors properties.

    successCount

    (number) The number of objects that successfully copied.

    errors

    (Optional, array) The errors that occurred during the copy operation. When errors are reported, the success flag is set to false.

    Properties of errors

    • id

      (string) The saved object ID that failed to copy.

      type

      (string) The type of saved object that failed to copy.

      error

      (object) The error that caused the copy operation to fail.

      Properties of error

      type

      (string) The type of error. For example, unsupported_type, missing_references, or unknown.

Examples

Overwrite an index pattern in the marketing space, and a visualization in the sales space:

  1. $ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
  2. {
  3. "objects": [{
  4. "type": "dashboard",
  5. "id": "my-dashboard"
  6. }],
  7. "includeReferences": true,
  8. "retries": {
  9. "marketing": [{
  10. "type": "index-pattern",
  11. "id": "my-pattern",
  12. "overwrite": true
  13. }],
  14. "sales": [{
  15. "type": "visualization",
  16. "id": "my-viz",
  17. "overwrite": true
  18. }]
  19. }
  20. }

The API returns the following:

  1. {
  2. "marketing": {
  3. "success": true,
  4. "successCount": 1
  5. },
  6. "sales": {
  7. "success": true,
  8. "successCount": 1
  9. }
  10. }

Most Popular