mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
156 lines
4.7 KiB
Text
156 lines
4.7 KiB
Text
[role="xpack"]
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts]]
|
|
=== Resolve copy saved objects to space conflicts API
|
|
++++
|
|
<titleabbrev>Resolve copy to space conflicts</titleabbrev>
|
|
++++
|
|
|
|
experimental[] Overwrite saved objects that are returned as errors from the <<spaces-api-copy-saved-objects, copy saved objects to space API>>.
|
|
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-request]]
|
|
==== {api-request-title}
|
|
|
|
`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`
|
|
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
Execute the <<spaces-api-copy-saved-objects,copy saved objects to space API>>, which returns the errors for you to resolve.
|
|
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`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 <<spaces-api-copy-saved-objects, copy saved objects to space API>> operation.
|
|
|
|
[role="child_attributes"]
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-request-body]]
|
|
==== {api-request-body-title}
|
|
|
|
`objects`::
|
|
(Required, object array) The saved objects to copy. The `objects` must be the same values used during the failed <<spaces-api-copy-saved-objects, copy saved objects to space API>> operation.
|
|
+
|
|
.Properties of `objects`
|
|
[%collapsible%open]
|
|
=====
|
|
`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 <<spaces-api-copy-saved-objects, 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`
|
|
[%collapsible%open]
|
|
=====
|
|
`<space_id>`:::
|
|
(Required, array) The errors to resolve for the specified `<space_id>`.
|
|
+
|
|
|
|
.Properties of `<space_id>`
|
|
[%collapsible%open]
|
|
======
|
|
`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 <<spaces-api-resolve-copy-saved-objects-conflicts-path-params, `space_id` path parameter>>) overwrites the conflicting object in the destination space. When set to `false`, this does nothing.
|
|
======
|
|
=====
|
|
|
|
[role="child_attributes"]
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-response-body]]
|
|
==== {api-response-body-title}
|
|
|
|
`<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>`
|
|
[%collapsible%open]
|
|
=====
|
|
`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`
|
|
[%collapsible%open]
|
|
======
|
|
`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`
|
|
[%collapsible%open]
|
|
=======
|
|
`type`::::
|
|
(string) The type of error. For example, `unsupported_type`, `missing_references`, or `unknown`.
|
|
=======
|
|
======
|
|
=====
|
|
|
|
[[spaces-api-resolve-copy-saved-objects-conflicts-example]]
|
|
==== {api-examples-title}
|
|
|
|
Overwrite an index pattern in the `marketing` space, and a visualization in the `sales` space:
|
|
|
|
[source,sh]
|
|
----
|
|
$ 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
|
|
}]
|
|
}
|
|
}
|
|
----
|
|
// KIBANA
|
|
|
|
The API returns the following:
|
|
|
|
[source,sh]
|
|
----
|
|
{
|
|
"marketing": {
|
|
"success": true,
|
|
"successCount": 1
|
|
},
|
|
"sales": {
|
|
"success": true,
|
|
"successCount": 1
|
|
}
|
|
}
|
|
----
|