Resolve copy saved objects to space conflicts APIedit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview 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.

Requestedit

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

Prerequisitesedit

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

Path parametersedit

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 bodyedit

objects

(Required, object array) The saved objects to copy. Must be the same value that was used during the failed Copy Saved Objects to Space 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 will also be copied into the target spaces. You must set this to the same value that you used when executing the Copy Saved Objects to Space API. 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 the conflicts to resolve for the indicated <space_id>. .Properties of <space_id>
Details
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 (designated by the space_id path parameter) will overwrite the the conflicting object in the destination space. When false, this does nothing.

Response bodyedit

<space_id>

(object) Specifies the dynamic keys that are included in the response. An object describing the result of the copy operation for this particular space.

Properties of <space_id>
success
(boolean) Indicates if the copy operation was successful. Note that some objects may have been copied even if this is set to false. Consult the successCount and errors properties of the response for additional information.
successCount
(number) The number of objects that were successfully copied.
errors

(Optional, array) Collection of any errors that were encountered during the copy operation. If any errors are reported, then the success flag will be set to false.

Properties of errors
id
(string) The saved object id which failed to copy.
type
(string) The type of saved object which failed to copy.
error

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

Properties of error
type
(string) Indicates the type of error. May be one of: unsupported_type, missing_references, unknown.

Examplesedit

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

$ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
{
  "objects": [{
    "type": "dashboard",
    "id": "my-dashboard"
  }],
  "includeReferences": true,
  "retries": {
    "marketing": [{
      "type": "index-pattern",
      "id": "my-pattern",
      "overwrite": true
    }],
    "sales": [{
      "type": "visualization",
      "id": "my-viz",
      "overwrite": true
    }]
  }
}

The API returns the following:

{
  "marketing": {
    "success": true,
    "successCount": 1
  },
  "sales": {
    "success": true,
    "successCount": 1
  }
}