Resolve copy saved objects to space conflicts API
editResolve copy saved objects to space conflicts API
edit[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.
Request
editPOST <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
editExecute the copy saved objects to space API, which returns the errors for you to resolve.
Path parameters
edit-
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. Thespace_id
must be the same value used during the failed copy saved objects to space API operation.
Request body
edit-
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.-
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. TheincludeReferences
must be the same values used during the failed copy saved objects to space API operation. The default value isfalse
. -
retries
-
(Required, object) The retry operations to attempt. Object keys represent the target space IDs.
-
<space_id>
-
(Required, array) The errors to resolve for the specified
<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 thespace_id
path parameter) overwrites the conflicting object in the destination space. When set tofalse
, this does nothing.
-
-
Response body
edit-
<space_id>
-
(object) An object that describes the result of the copy operation for the space. Includes the dynamic keys in the response.
-
success
-
(boolean) The copy operation was successful. When set to
false
, some objects may have been copied. For additional information, refer to thesuccessCount
anderrors
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 tofalse
.-
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.
-
type
: -
(string) The type of error. For example,
unsupported_type
,missing_references
, orunknown
.
-
-
-
Examples
editOverwrite 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 } }