[DOCS][OpenAPI] Add descriptions, examples, tags, responses for space APIs (#195333)

Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
This commit is contained in:
Lisa Cawley 2024-10-18 12:03:06 -07:00 committed by GitHub
parent f789ba61d4
commit 2656e5a4ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 1547 additions and 1653 deletions

View file

@ -1,38 +1,4 @@
[role="xpack"]
[[spaces-api]]
== {kib} spaces APIs
Manage your {kib} spaces.
The following {kib} spaces APIs are available:
* <<spaces-api-post, Create space API>> to create a {kib} space
* <<spaces-api-put, Update space API>> to update an existing {kib} space
* <<spaces-api-get, Get a space API>> to retrieve a specified {kib} space
* <<spaces-api-get-all, Get all {kib} spaces API>> to retrieve all {kib} spaces
* <<spaces-api-delete, Delete space API>> to delete a {kib} space
* <<spaces-api-copy-saved-objects, Copy saved objects to space API>> to copy saved objects between spaces
* <<spaces-api-resolve-copy-saved-objects-conflicts, Resolve copy saved objects to space conflicts API>> to overwrite saved objects returned as errors from the copy saved objects to space API
* <<spaces-api-disable-legacy-url-aliases, Disable legacy URL aliases API>> to disable legacy URL aliases if an error is encountered
* <<spaces-api-update-objects-spaces, Update saved objects spaces API>> to update one or more saved objects to add and/or remove them from specified spaces
* <<spaces-api-get-shareable-references, Get shareable references API>> to collect references and spaces context for saved objects
include::spaces-management/post.asciidoc[]
include::spaces-management/put.asciidoc[]
include::spaces-management/get.asciidoc[]
include::spaces-management/get_all.asciidoc[]
include::spaces-management/delete.asciidoc[]
include::spaces-management/copy_saved_objects.asciidoc[]
include::spaces-management/resolve_copy_saved_objects_conflicts.asciidoc[]
include::spaces-management/disable_legacy_url_aliases.asciidoc[]
include::spaces-management/update_objects_spaces.asciidoc[]
include::spaces-management/get_shareable_references.asciidoc[]
For the latest details, refer to {api-kibana}/group/endpoint-spaces[spaces APIs].

View file

@ -1,491 +0,0 @@
[role="xpack"]
[[spaces-api-copy-saved-objects]]
=== Copy saved objects to space API
++++
<titleabbrev>Copy saved objects to space</titleabbrev>
++++
experimental[] Copy saved objects between spaces.
It also allows you to automatically copy related objects, so when you copy a `dashboard`, this can automatically copy over the
associated visualizations, {data-sources}, and saved searches, as required.
You can request to overwrite any objects that already exist in the target space if they share an ID, or you can use the
<<spaces-api-resolve-copy-saved-objects-conflicts, Resolve copy saved objects conflicts API>> to do this on a per-object basis.
[[spaces-api-copy-saved-objects-request]]
==== {api-request-title}
`POST <kibana host>:<port>/api/spaces/_copy_saved_objects`
`POST <kibana host>:<port>/s/<space_id>/api/spaces/_copy_saved_objects`
[[spaces-api-copy-saved-objects-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.
[role="child_attributes"]
[[spaces-api-copy-saved-objects-request-body]]
==== {api-request-body-title}
`spaces`::
(Required, string array) The IDs of the spaces where you want to copy the specified objects.
`objects`::
(Required, object array) The saved objects to copy.
+
.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 will also be copied into the target
spaces. The default value is `false`.
`createNewCopies`::
(Optional, boolean) Creates new copies of saved objects, regenerates each object ID, and resets the origin. When used, potential conflict
errors are avoided. The default value is `true`.
+
NOTE: This option cannot be used with the `overwrite` and `compatibilityMode` options.
`overwrite`::
(Optional, boolean) When set to `true`, all conflicts are automatically overridden. When a saved object with a matching `type` and `id`
exists in the target space, that version is replaced with the version from the source space. The default value is `false`.
+
NOTE: This option cannot be used with the `createNewCopies` option.
`compatibilityMode`::
(Optional, boolean) Applies various adjustments to the saved objects that are being copied to maintain compatibility between different {kib}
versions. Use this option only if you encounter issues with copied saved objects.
+
NOTE: This option cannot be used with the `createNewCopies` option.
[[spaces-api-copy-saved-objects-response-codes]]
==== Response codes
`200`::
Indicates a successful call.
`404`::
Indicates that the request failed because one or more of the objects specified could not be found. A list of the unresolved objects are included in the 404 response attributes.
[role="child_attributes"]
[[spaces-api-copy-saved-objects-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 `errors` and `successResults` 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`.
+
NOTE: One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a
`conflict` error.
+
.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, `conflict`, `ambiguous_conflict`, `missing_references`, `unsupported_type`, or `unknown`.
Errors marked as `conflict` or `ambiguous_conflict` may be resolved by using the <<spaces-api-resolve-copy-saved-objects-conflicts,
Resolve copy saved objects conflicts API>>.
`destinationId`::::
(Optional, string) The destination ID that was used during the copy attempt. This is only present on `conflict` error types.
`destinations`::::
(Optional, array) A list of possible object destinations with `id`, `title`, and `updatedAt` fields to describe each one. This is
only present on `ambiguous_conflict` error types.
=======
======
`successResults`:::
(Optional, array) Indicates successfully copied objects, with any applicable metadata.
+
NOTE: Objects are created when all resolvable errors are addressed, including conflict and missing references errors. For more information,
refer to the <<spaces-api-copy-saved-objects-example,examples>>.
=====
[[spaces-api-copy-saved-objects-example]]
==== {api-examples-title}
[[spaces-api-copy-saved-objects-example-1]]
===== Successful copy (with `createNewCopies` enabled)
Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization, and that has a reference to a {data-source}:
[source,sh]
----
$ curl -X POST api/spaces/_copy_saved_objects
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"marketing": {
"success": true,
"successCount": 3,
"successResults": [
{
"id": "my-dashboard",
"type": "dashboard",
"destinationId": "1e127098-5b80-417f-b0f1-c60c8395358f",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
},
{
"id": "my-vis",
"type": "visualization",
"destinationId": "a610ed80-1c73-4507-9e13-d3af736c8e04",
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-index-pattern",
"type": "index-pattern",
"destinationId": "bc3c9c70-bf6f-4bec-b4ce-f4189aa9e26b",
"meta": {
"icon": "indexPatternApp",
"title": "my-pattern-*"
}
}
]
}
}
----
The result indicates a successful copy, and all three objects are created. Since these objects were created as new copies, each entry in the
`successResults` array includes a `destinationId` attribute.
[[spaces-api-copy-saved-objects-example-2]]
===== Successful copy (with `createNewCopies` disabled)
Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization, and that has a reference to a {data-source}:
[source,sh]
----
$ curl -X POST api/spaces/_copy_saved_objects
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"marketing": {
"success": true,
"successCount": 3,
"successResults": [
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
},
{
"id": "my-vis",
"type": "visualization",
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-index-pattern",
"type": "index-pattern",
"meta": {
"icon": "indexPatternApp",
"title": "my-pattern-*"
}
}
]
}
}
----
The result indicates a successful copy, and all three objects are created.
[[spaces-api-copy-saved-objects-example-3]]
===== Failed copy (with conflict errors)
Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` and `sales` spaces. In
this example, the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to an index
pattern:
[source,sh]
----
$ curl -X POST api/spaces/_copy_saved_objects
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"spaces": ["marketing", "sales"],
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"marketing": {
"success": true,
"successCount": 4,
"successResults": [
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
},
{
"id": "my-vis",
"type": "visualization",
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-canvas",
"type": "canvas-workpad",
"meta": {
"icon": "canvasApp",
"title": "Look at my canvas"
}
},
{
"id": "my-index-pattern",
"type": "index-pattern",
"meta": {
"icon": "indexPatternApp",
"title": "my-pattern-*"
}
}
]
},
"sales": {
"success": false,
"successCount": 1,
"errors": [
{
"id": "my-pattern",
"type": "index-pattern",
"title": "my-pattern-*",
"error": {
"type": "conflict"
},
"meta": {
"icon": "indexPatternApp",
"title": "my-pattern-*"
}
},
{
"id": "my-visualization",
"type": "my-vis",
"title": "Look at my visualization",
"error": {
"type": "conflict",
"destinationId": "another-vis"
},
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-canvas",
"type": "canvas-workpad",
"title": "Look at my canvas",
"error": {
"type": "ambiguous_conflict",
"destinations": [
{
"id": "another-canvas",
"title": "Look at another canvas",
"updatedAt": "2020-07-08T16:36:32.377Z"
},
{
"id": "yet-another-canvas",
"title": "Look at yet another canvas",
"updatedAt": "2020-07-05T12:29:54.849Z"
}
]
},
"meta": {
"icon": "canvasApp",
"title": "Look at my canvas"
}
}
],
"successResults": [
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
}
]
}
}
----
The result indicates a successful copy for the `marketing` space, and an unsuccessful copy for the `sales` space because the {data-source},
visualization, and *Canvas* workpad each resulted in a conflict error:
* A {data-source} with the same ID already exists, which resulted in a conflict error. To resolve the error, overwrite the existing object,
or skip the object.
* A visualization with a different ID, but the same origin already exists, which resulted in a conflict error. The `destinationId` field
contains the `id` of the other visualization, which caused the conflict. The behavior is added to make sure that new objects that can be
shared between spaces behave in a similar way as legacy non-shareable objects. When a shareable object is copied into a new space, it
retains its origin so that the conflicts are encountered as expected. To resolve, overwrite the specified destination object, or skip the
object.
* Two *Canvas* workpads with different IDs, but the same origin, already exist, which resulted in a conflict error. The `destinations` array
describes the other workpads which caused the conflict. When a shareable object is copied into a new space, then shared to another space
where an object of the same origin exists, the conflict error occurs. To resolve, pick a destination object to overwrite, or skip the
object.
Objects are created when the error is resolved using the <<spaces-api-resolve-copy-saved-objects-conflicts-example-1,Resolve copy conflicts
API>>.
[[spaces-api-copy-saved-objects-example-4]]
===== Failed copy (with missing reference errors)
Copy a dashboard with the `my-dashboard` ID, including all references from the `default` space to the `marketing` space. In this example,
the dashboard has a reference to a visualization and a *Canvas* workpad, and the visualization has a reference to a {data-source}:
[source,sh]
----
$ curl -X POST api/spaces/_copy_saved_objects
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"spaces": ["marketing"],
"includeReferences": true,
"createNewCopies": false
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"marketing": {
"success": false,
"successCount": 2,
"errors": [
{
"id": "my-vis",
"type": "visualization",
"title": "Look at my visualization",
"error": {
"type": "missing_references",
"references": [
{
"type": "index-pattern",
"id": "my-pattern-*"
}
]
},
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
]
"successResults": [
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
},
{
"id": "my-canvas",
"type": "canvas-workpad",
"meta": {
"icon": "canvasApp",
"title": "Look at my canvas"
}
}
],
}
}
----
The result indicates an unsuccessful copy because the visualization resulted in a missing references error.
Objects are created when the errors are resolved using the <<spaces-api-resolve-copy-saved-objects-conflicts-example-2,Resolve copy
conflicts API>>.

View file

@ -1,23 +0,0 @@
[[spaces-api-delete]]
=== Delete space API
++++
<titleabbrev>Delete space</titleabbrev>
++++
experimental[] Delete a {kib} space.
WARNING: When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.
[[spaces-api-delete-request]]
==== Request
`DELETE <kibana host>:<port>/api/spaces/space/<space_name>`
[[spaces-api-delete-errors-codes]]
==== Response codes
`204`::
Indicates a successful call.
`404`::
Indicates that the request failed.

View file

@ -1,59 +0,0 @@
[[spaces-api-disable-legacy-url-aliases]]
=== Disable legacy URL aliases API
++++
<titleabbrev>Disable legacy URL aliases</titleabbrev>
++++
experimental[] Disable a <<legacy-url-aliases,legacy URL alias>> in {kib}.
[[spaces-api-disable-legacy-url-aliases-request]]
==== {api-request-title}
`POST <kibana host>:<port>/api/spaces/_disable_legacy_url_aliases`
[role="child_attributes"]
[[spaces-api-disable-legacy-url-aliases-request-body]]
==== {api-request-body-title}
`aliases`::
(Required, object array) The aliases to disable.
+
.Properties of `aliases`
[%collapsible%open]
=====
`targetSpace`:::
(Required, string) The space where the alias target object exists.
`targetType`:::
(Required, string) The type of the alias target object.
`sourceId`:::
(Required, string) The ID of the alias source object. This is the "legacy" object ID.
=====
[[spaces-api-disable-legacy-url-aliases-response-codes]]
==== {api-response-codes-title}
`204`::
Indicates a successful call.
[[spaces-api-disable-legacy-url-aliases-example]]
==== {api-examples-title}
[source,sh]
--------------------------------------------------
$ curl -X POST api/spaces/_disable_legacy_url_aliases
{
"aliases": [
{
"targetSpace": "bills-space",
"targetType": "dashboard",
"sourceId": "123"
}
]
}
--------------------------------------------------
// KIBANA
This example leaves the alias intact, but the legacy URL for this alias, http://localhost:5601/s/bills-space/app/dashboards#/view/123, will
no longer function. The dashboard still exists, and you can access it with the new URL.

View file

@ -1,37 +0,0 @@
[[spaces-api-get]]
=== Get a space API
++++
<titleabbrev>Get space</titleabbrev>
++++
experimental[] Retrieve a specified {kib} space.
[[spaces-api-get-request]]
==== Request
`GET <kibana host>:<port>/api/spaces/space/marketing`
[[spaces-api-get-response-codes]]
==== Response code
`200`::
Indicates a successful call.
[[spaces-api-get-example]]
==== Example
The API returns the following:
[source,sh]
--------------------------------------------------
{
"id": "marketing",
"name": "Marketing",
"description" : "This is the Marketing Space",
"color": "#aabbcc",
"initials": "MK",
"disabledFeatures": [],
"imageUrl": "",
"solution": "es"
}
--------------------------------------------------

View file

@ -1,138 +0,0 @@
[[spaces-api-get-all]]
=== Get all {kib} spaces API
++++
<titleabbrev>Get all spaces</titleabbrev>
++++
experimental[] Retrieve all {kib} spaces.
[[spaces-api-get-all-request]]
==== Request
`GET <kibana host>:<port>/api/spaces/space`
[[spaces-api-get-all-query-params]]
==== Query parameters
`purpose`::
(Optional, string) Valid options include `any`, `copySavedObjectsIntoSpace`, and `shareSavedObjectsIntoSpace`. This determines what
authorization checks are applied to the API call. If `purpose` is not provided in the URL, the `any` purpose is used.
`include_authorized_purposes`::
(Optional, boolean) When enabled, the API will return any spaces that the user is authorized to access in any capacity, and each space
will contain the purpose(s) for which the user is authorized. This can be useful to determine which spaces a user can read but not take a
specific action in. If the Security plugin is not enabled, this will have no effect, as no authorization checks would take place.
+
NOTE: This option cannot be used in conjunction with `purpose`.
[[spaces-api-get-all-response-codes]]
==== Response code
`200`::
Indicates a successful call.
[[spaces-api-get-all-example]]
==== Examples
[[spaces-api-get-all-example-1]]
===== Default options
Retrieve all spaces without specifying any options:
[source,sh]
--------------------------------------------------
$ curl -X GET api/spaces/space
--------------------------------------------------
The API returns the following:
[source,sh]
--------------------------------------------------
[
{
"id": "default",
"name": "Default",
"description" : "This is the Default Space",
"disabledFeatures": [],
"imageUrl": "",
"_reserved": true
},
{
"id": "marketing",
"name": "Marketing",
"description" : "This is the Marketing Space",
"color": "#aabbcc",
"disabledFeatures": ["apm"],
"initials": "MK",
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU"
},
{
"id": "sales",
"name": "Sales",
"initials": "MK",
"disabledFeatures": ["discover"],
"imageUrl": "",
"solution": "oblt"
}
]
--------------------------------------------------
[[spaces-api-get-all-example-2]]
===== Custom options
The user has read-only access to the Sales space. Retrieve all spaces and specify options:
[source,sh]
--------------------------------------------------
$ curl -X GET api/spaces/space?purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true
--------------------------------------------------
The API returns the following:
[source,sh]
--------------------------------------------------
[
{
"id": "default",
"name": "Default",
"description" : "This is the Default Space",
"disabledFeatures": [],
"imageUrl": "",
"_reserved": true,
"authorizedPurposes": {
"any": true,
"copySavedObjectsIntoSpace": true,
"findSavedObjects": true,
"shareSavedObjectsIntoSpace": true,
}
},
{
"id": "marketing",
"name": "Marketing",
"description" : "This is the Marketing Space",
"color": "#aabbcc",
"disabledFeatures": ["apm"],
"initials": "MK",
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSU",
"authorizedPurposes": {
"any": true,
"copySavedObjectsIntoSpace": true,
"findSavedObjects": true,
"shareSavedObjectsIntoSpace": true,
}
},
{
"id": "sales",
"name": "Sales",
"initials": "MK",
"disabledFeatures": ["discover"],
"imageUrl": "",
"authorizedPurposes": {
"any": true,
"copySavedObjectsIntoSpace": false,
"findSavedObjects": true,
"shareSavedObjectsIntoSpace": false,
}
}
]
--------------------------------------------------

View file

@ -1,81 +0,0 @@
[role="xpack"]
[[spaces-api-get-shareable-references]]
=== Get shareable references API
++++
<titleabbrev>Get shareable references</titleabbrev>
++++
experimental[] Get shareable references.
Collects references and spaces context for saved objects.
[[spaces-api-get-shareable-references-request]]
==== {api-request-title}
`POST <kibana host>:<port>/api/spaces/_get_shareable_references`
[[spaces-api-get-shareable-references-request-body]]
==== {api-request-body-title}
`objects`::
(Required, object array) The saved objects to collect outbound references for.
+
.Properties of `objects`
[%collapsible%open]
=====
`type`:::
(Required, string) The saved object type.
`id`:::
(Required, string) The saved object ID.
=====
[role="child_attributes"]
[[spaces-api-get-shareable-references-response-body]]
==== {api-response-body-title}
`objects`::
(object array) The returned input object or one of its references, with additional context.
+
.Properties of `objects`
[%collapsible%open]
=====
`type`:::
(string) The saved object type.
`id`:::
(string) The saved object ID.
`originId`:::
(string) The origin ID of the referenced object (if it has one).
`inboundReferences`:::
(object array) References to this object.
+
NOTE: This does not contain _all inbound references everywhere_, it only contains inbound references to this object within the scope of this operation.
+
.Properties of `inboundReferences`
[%collapsible%open]
======
`type`::::
(string) The type of the object that has the inbound reference.
`id`::::
(string) The ID of the object that has the inbound reference.
`name`::::
(string) The name of the inbound reference.
======
`spaces`:::
(string array) The space(s) that the referenced saved object exists in.
`spacesWithMatchingAliases`:::
(string array) The space(s) that legacy URL aliases matching this type/id exist in. (if there are any)
`spacesWithMatchingOrigins`:::
(string array) The space(s) that objects matching this origin exist in (including this one). (if there are any)
`isMissing`:::
(boolean) Whether or not this object or reference is missing.
=====

View file

@ -1,64 +0,0 @@
[[spaces-api-post]]
=== Create space API
++++
<titleabbrev>Create space</titleabbrev>
++++
experimental[] Create a {kib} space.
[[spaces-api-post-request]]
==== Request
`POST <kibana host>:<port>/api/spaces/space`
[[spaces-api-post-request-body]]
==== Request body
`id`::
(Required, string) The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, '_', and '-'). You are unable to change the ID with the update operation.
`name`::
(Required, string) The display name for the space.
`description`::
(Optional, string) The description for the space.
`disabledFeatures`::
(Optional, string array) The list of disabled features for the space. To get a list of available feature IDs, use the <<features-api-get, Features API>>.
`initials`::
(Optional, string) The initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters.
`color`::
(Optional, string) The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.
`imageUrl`::
(Optional, string) The data-URL encoded image to display in the space avatar. If specified, `initials` will not be displayed, and the `color` will be visible as the background color for transparent images.
For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.
`solution`::
(Optional, string) The solution defined for the space. Can be one of `security`, `oblt`, `es`, `classic`
[[spaces-api-post-response-codes]]
==== Response codes
`200`::
Indicates a successful call.
[[spaces-api-post-example]]
==== Example
[source,sh]
--------------------------------------------------
$ curl -X POST api/spaces/space
{
"id": "marketing",
"name": "Marketing",
"description" : "This is the Marketing Space",
"color": "#aabbcc",
"initials": "MK",
"disabledFeatures": [],
"imageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ+3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d+fbvfe588x/zpn/+Z9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q+7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb+l3EdM9lluNEnIC9xz+f2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ+CC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV+sgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR+jpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am+qCnsAXgpgSW2Zq9cyKlksbPlTd+te4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu+HqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7+HZfgtpbzBg342TgQ63AkmsymxBW4IjE6A+D7Vzd/fyWxIM/VuCe+HzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A+Bvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX+KMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc+s3/o/MoXizL3JE5O3F3P/uBZPPF4Zr+Wi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8+cQG+Huf0l8NJVYP+nI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D+ChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA+3qXUSZD2CtQlZh9T+1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/+/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y+U1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY+pxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W+vnp1MJc9EgCNd/cy6x+9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35+5KHF0lai/rJo+up87jWEE/qqqwY+qrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q+no3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q+eQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB+BBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP+XqyDBzu+NBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0+N503Zao0uCsWuSIDku8/7EO60b41vN5+Ses9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo+bnuNS4uB4Cuq0ZfvO8X1rM6q/+vnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg=="
}
--------------------------------------------------
// KIBANA

View file

@ -1,64 +0,0 @@
[[spaces-api-put]]
=== Update space API
++++
<titleabbrev>Update space</titleabbrev>
++++
experimental[] Update an existing {kib} space.
[[spaces-api-put-api-request]]
==== Request
`PUT <kibana host>:<port>/api/spaces/space/<space_id>`
[[spaces-api-put-request-body]]
==== Request body
`id`::
(Required, string) The space ID that is part of the {kib} URL when inside the space. You are unable to change the ID with the update operation.
`name`::
(Required, string) The display name for the space.
`description`::
(Optional, string) The description for the space.
`disabledFeatures`::
(Optional, string array) The list of disabled features for the space. To get a list of available feature IDs, use the <<features-api-get, Features API>>.
`initials`::
(Optional, string) Specifies the initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters.
`color`::
(Optional, string) Specifies the hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.
`imageUrl`::
(Optional, string) Specifies the data-url encoded image to display in the space avatar. If specified, `initials` will not be displayed, and the `color` will be visible as the background color for transparent images.
For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.
`solution`::
(Optional, string) The solution defined for the space. Can be one of `security`, `oblt`, `es`, `classic`.
[[spaces-api-put-response-codes]]
==== Response codes
`200`::
Indicates a successful call.
[[sample-api-example]]
==== Example
[source,sh]
--------------------------------------------------
$ curl -X PUT api/spaces/space/marketing
{
"id": "marketing",
"name": "Marketing",
"description" : "This is the Marketing Space",
"color": "#aabbcc",
"initials": "MK",
"disabledFeatures": [],
"imageUrl": ""
}
--------------------------------------------------
// KIBANA

View file

@ -1,317 +0,0 @@
[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`.
`createNewCopies`::
(Optional, boolean) Creates new copies of the saved objects, regenerates each object ID, and resets the origin. When enabled during the
initial copy, also enable when resolving copy errors. The default value is `true`.
`retries`::
(Required, object) The retry operations to attempt, which can specify how to resolve different types of errors. 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 (designated 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.
`destinationId`::::
(Optional, string) Specifies the destination ID that the copied object should have, if different from the current ID.
`ignoreMissingReferences`:::
(Optional, boolean) When set to `true`, any missing references errors are ignored. When set to `false`, 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`.
+
NOTE: One object may result in multiple errors, which requires separate steps to resolve. For instance, a `missing_references` error and a
`conflict` error.
+
.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, `conflict`, `ambiguous_conflict`, `missing_references`, `unsupported_type`, or `unknown`.
`destinationId`::::
(Optional, string) The destination ID that was used during the copy attempt. This is only present on `conflict` errors types.
`destinations`::::
(Optional, array) A list of possible object destinations with `id`, `title`, and `updatedAt` fields to describe each one. This is
only present on `ambiguous_conflict` error types.
=======
======
`successResults`:::
(Optional, array) Indicates successfully copied objects, with any applicable metadata.
+
NOTE: Objects are created when all resolvable errors are addressed, including conflict and missing references errors. For more information,
refer to the <<spaces-api-resolve-copy-saved-objects-conflicts-example,examples>>.
=====
[[spaces-api-resolve-copy-saved-objects-conflicts-example]]
==== {api-examples-title}
[[spaces-api-resolve-copy-saved-objects-conflicts-example-1]]
===== Resolve conflict errors
This example builds upon the <<spaces-api-copy-saved-objects-example-3,Copy objects API example with conflict errors>>.
Resolve conflict errors for a {data-source}, visualization, and *Canvas* workpad by overwriting the existing saved objects:
[source,sh]
----
$ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"includeReferences": true,
"createNewCopies": false,
"retries": {
"sales": [
{
"type": "index-pattern",
"id": "my-pattern",
"overwrite": true
},
{
"type": "visualization",
"id": "my-vis",
"overwrite": true,
"destinationId": "another-vis"
},
{
"type": "canvas",
"id": "my-canvas",
"overwrite": true,
"destinationId": "yet-another-canvas"
},
{
"type": "dashboard",
"id": "my-dashboard"
}
]
}
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"sales": {
"success": true,
"successCount": 4,
"successResults": [
{
"id": "my-pattern",
"type": "index-pattern",
"meta": {
"icon": "indexPatternApp",
"title": "my-pattern-*"
}
},
{
"id": "my-vis",
"type": "visualization",
"destinationId": "another-vis",
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-canvas",
"type": "canvas-workpad",
"destinationId": "yet-another-canvas",
"meta": {
"icon": "canvasApp",
"title": "Look at my canvas"
}
},
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
}
]
}
}
----
The result indicates a successful copy, and all four objects are created.
TIP: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that
were returned in the `successResults` array. In this example, we retried copying the dashboard accordingly.
[[spaces-api-resolve-copy-saved-objects-conflicts-example-2]]
===== Resolve missing reference errors
This example builds upon the <<spaces-api-copy-saved-objects-example-4,Copy objects API example with missing reference errors>>.
Resolve missing reference errors for a visualization by ignoring the error:
[source,sh]
----
$ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
{
"objects": [{
"type": "dashboard",
"id": "my-dashboard"
}],
"includeReferences": true,
"createNewCopies": false,
"retries": {
"marketing": [
{
"type": "visualization",
"id": "my-vis",
"ignoreMissingReferences": true
},
{
"type": "canvas",
"id": "my-canvas"
},
{
"type": "dashboard",
"id": "my-dashboard"
}
]
}
}
----
// KIBANA
The API returns the following:
[source,sh]
----
{
"marketing": {
"success": true,
"successCount": 3,
"successResults": [
{
"id": "my-vis",
"type": "visualization",
"meta": {
"icon": "visualizeApp",
"title": "Look at my visualization"
}
},
{
"id": "my-canvas",
"type": "canvas-workpad",
"meta": {
"icon": "canvasApp",
"title": "Look at my canvas"
}
},
{
"id": "my-dashboard",
"type": "dashboard",
"meta": {
"icon": "dashboardApp",
"title": "Look at my dashboard"
}
}
]
}
}
----
The result indicates a successful copy and all three objects are created.
TIP: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that
were returned in the `successResults` array. In this example, we retried copying the dashboard and canvas accordingly.

View file

@ -1,142 +0,0 @@
[role="xpack"]
[[spaces-api-update-objects-spaces]]
=== Update saved objects spaces API
++++
<titleabbrev>Update saved objects spaces</titleabbrev>
++++
experimental[] Update saved objects spaces.
Updates one or more saved objects to add and/or remove them from specified spaces.
[[spaces-api-update-objects-spaces-request]]
==== {api-request-title}
`POST <kibana host>:<port>/api/spaces/_update_objects_spaces`
[[spaces-api-update-objects-spaces-request-body]]
==== {api-request-body-title}
`objects`::
(Required, object array) The saved objects to update.
+
.Properties of `objects`
[%collapsible%open]
=====
`type`:::
(Required, string) The saved object type.
`id`:::
(Required, string) The saved object ID.
=====
`spacesToAdd`::
(Required, string array) The IDs of the spaces the specified objects should be added to.
`spacesToRemove`::
(Required, string array) The IDs of the spaces the specified objects should be removed from.
[role="child_attributes"]
[[spaces-api-update-objects-spaces-response-body]]
==== {api-response-body-title}
`objects`::
(object array) The saved objects that have been updated.
+
.Properties of `objects`
[%collapsible%open]
=====
`type`:::
(string) The saved object type.
`id`:::
(string) The saved object ID.
`spaces`:::
(string array) The space(s) that the referenced saved object exists in.
`errors`:::
(string) Included if there was an error updating this object's spaces.
=====
[[spaces-api-update-objects-spaces-example]]
==== {api-examples-title}
[[spaces-api-update-objects-spaces-example-1]]
===== Sharing saved objects
To share a saved object to a space programmatically follow these steps:
1. Collect reference graph and spaces context for each saved object that you want to share using <<spaces-api-get-shareable-references, Get shareable references API>>:
+
[source,sh]
----
$ curl -X POST /api/spaces/_get_shareable_references
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247"
}
]
}
----
+
The API returns the following:
+
[source,json]
----
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"spaces": ["default"],
"inboundReferences": [],
"spacesWithMatchingOrigins": ["default"]
}
]
}
----
2. Check each saved object for `spacesWithMatchingOrigins` conflicts.
+
Objects should not be shared to spaces with matching origins or you will create URL conflicts (causing the same URL to point to different saved objects).
3. Check each saved object for `spacesWithMatchingAliases` conflicts.
+
If these match the space(s) that these saved objects will be shared to you should disable legacy URL aliases for them using <<spaces-api-disable-legacy-url-aliases, Disable legacy URL aliases API>>.
+
When sharing to all spaces (`*`) all entries in `spacesWithMatchingAliases` should be checked.
4. Update spaces of each saved object and all its references:
+
[source,sh]
----
$ curl -X POST /api/spaces/_update_objects_spaces
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247"
}
],
"spacesToAdd": ["test"],
"spacesToRemove": []
}
----
+
The API returns the following:
+
[source,json]
----
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"spaces": ["default", "test"]
}
]
}
----

View file

@ -100,7 +100,6 @@ into an older version of {kib}. For example:
[float]
[role="xpack"]
[[managing-saved-objects-copy-to-space]]
=== Copy to other {kib} spaces
@ -117,7 +116,6 @@ the saved object. If you don't want this behavior, use
the <<spaces-api-copy-saved-objects, copy saved objects to space API>> instead.
[float]
[role="xpack"]
[[managing-saved-objects-share-to-space]]
=== Share to other {kib} spaces
@ -135,4 +133,79 @@ those space icons to open the Share UI.
+
The share operation automatically includes child objects that are related to the saved objects.
include::saved-objects/saved-object-ids.asciidoc[]
[[spaces-api-update-objects-spaces-example-1]]
To share a saved object to a space programmatically with the {api-kibana}/group/endpoint-spaces[spaces APIs], follow these steps:
1. Collect reference graph and spaces context for each saved object that you want to share using get shareable references API:
+
[source,sh]
----
$ curl -X POST /api/spaces/_get_shareable_references
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247"
}
]
}
----
+
The API returns the following:
+
[source,json]
----
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"spaces": ["default"],
"inboundReferences": [],
"spacesWithMatchingOrigins": ["default"]
}
]
}
----
2. Check each saved object for `spacesWithMatchingOrigins` conflicts.
+
Objects should not be shared to spaces with matching origins or you will create URL conflicts (causing the same URL to point to different saved objects).
3. Check each saved object for `spacesWithMatchingAliases` conflicts.
+
If these match the spaces that these saved objects will be shared to you should disable legacy URL aliases for them using the disable legacy URL aliases API.
+
When sharing to all spaces (`*`) all entries in `spacesWithMatchingAliases` should be checked.
4. Update spaces of each saved object and all its references:
+
[source,sh]
----
$ curl -X POST /api/spaces/_update_objects_spaces
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247"
}
],
"spacesToAdd": ["test"],
"spacesToRemove": []
}
----
+
The API returns the following:
+
[source,json]
----
{
"objects": [
{
"type": "index-pattern",
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"spaces": ["default", "test"]
}
]
}
----

View file

@ -1147,3 +1147,53 @@ Refer to {api-kibana}/group/endpoint-cases[cases API].
== Sync {ml} saved objects API
Refer to {api-kibana}/group/endpoint-ml[machine learning APIs].
[role="exclude",id="spaces-api-post"]
== Create space API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-put"]
== Update space API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-get"]
== Get a space API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-get-all"]
== Get all {kib} spaces API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-delete"]
== Delete space API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-copy-saved-objects"]
== Copy saved objects to space API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-disable-legacy-url-aliases"]
== Disable legacy URL aliases API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-get-shareable-references"]
== Get shareable references API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-resolve-copy-saved-objects-conflicts"]
== Resolve copy saved objects to space conflicts API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].
[role="exclude",id="spaces-api-update-objects-spaces"]
== Update saved objects spaces API
Refer to {api-kibana}/group/endpoint-spaces[spaces APIs].

View file

@ -197,6 +197,8 @@ include::{kibana-root}/docs/management/rollups/create_and_manage_rollups.asciido
include::{kibana-root}/docs/management/managing-saved-objects.asciidoc[]
include::{kibana-root}/docs/management/saved-objects/saved-object-ids.asciidoc[]
include::security/index.asciidoc[]
include::{kibana-root}/docs/spaces/index.asciidoc[]

View file

@ -41686,7 +41686,7 @@
},
"/api/spaces/_copy_saved_objects": {
"post": {
"description": "Copy saved objects to spaces",
"description": "It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.",
"operationId": "%2Fapi%2Fspaces%2F_copy_saved_objects#0",
"parameters": [
{
@ -41720,14 +41720,17 @@
"properties": {
"compatibilityMode": {
"default": false,
"description": "Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.",
"type": "boolean"
},
"createNewCopies": {
"default": true,
"description": "Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.",
"type": "boolean"
},
"includeReferences": {
"default": false,
"description": "When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.",
"type": "boolean"
},
"objects": {
@ -41735,9 +41738,11 @@
"additionalProperties": false,
"properties": {
"id": {
"description": "The identifier of the saved object to copy.",
"type": "string"
},
"type": {
"description": "The type of the saved object to copy.",
"type": "string"
}
},
@ -41751,10 +41756,12 @@
},
"overwrite": {
"default": false,
"description": "When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.",
"type": "boolean"
},
"spaces": {
"items": {
"description": "The identifiers of the spaces where you want to copy the specified objects.",
"type": "string"
},
"type": "array"
@ -41770,13 +41777,14 @@
}
},
"responses": {},
"summary": "",
"tags": []
"summary": "Copy saved objects between spaces",
"tags": [
"spaces"
]
}
},
"/api/spaces/_disable_legacy_url_aliases": {
"post": {
"description": "Disable legacy URL aliases",
"operationId": "%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0",
"parameters": [
{
@ -41813,12 +41821,15 @@
"additionalProperties": false,
"properties": {
"sourceId": {
"description": "The alias source object identifier. This is the legacy object identifier.",
"type": "string"
},
"targetSpace": {
"description": "The space where the alias target object exists.",
"type": "string"
},
"targetType": {
"description": "The type of alias target object. ",
"type": "string"
}
},
@ -41841,13 +41852,15 @@
}
},
"responses": {},
"summary": "",
"tags": []
"summary": "Disable legacy URL aliases",
"tags": [
"spaces"
]
}
},
"/api/spaces/_get_shareable_references": {
"post": {
"description": "Get shareable references",
"description": "Collect references and space contexts for saved objects.",
"operationId": "%2Fapi%2Fspaces%2F_get_shareable_references#0",
"parameters": [
{
@ -41908,13 +41921,15 @@
}
},
"responses": {},
"summary": "",
"tags": []
"summary": "Get shareable references",
"tags": [
"spaces"
]
}
},
"/api/spaces/_resolve_copy_saved_objects_errors": {
"post": {
"description": "Resolve conflicts copying saved objects",
"description": "Overwrite saved objects that are returned as errors from the copy saved objects to space API.",
"operationId": "%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0",
"parameters": [
{
@ -41983,22 +41998,28 @@
"additionalProperties": false,
"properties": {
"createNewCopy": {
"description": "Creates new copies of the saved objects, regenerates each object ID, and resets the origin.",
"type": "boolean"
},
"destinationId": {
"description": "Specifies the destination identifier that the copied object should have, if different from the current identifier.",
"type": "string"
},
"id": {
"description": "The saved object identifier.",
"type": "string"
},
"ignoreMissingReferences": {
"description": "When set to true, any missing references errors are ignored.",
"type": "boolean"
},
"overwrite": {
"default": false,
"description": "When set to true, the saved object from the source space overwrites the conflicting object in the destination space.",
"type": "boolean"
},
"type": {
"description": "The saved object type.",
"type": "string"
}
},
@ -42023,13 +42044,13 @@
}
},
"responses": {},
"summary": "",
"summary": "Resolve conflicts copying saved objects",
"tags": []
}
},
"/api/spaces/_update_objects_spaces": {
"post": {
"description": "Update saved objects in spaces",
"description": "Update one or more saved objects to add or remove them from some spaces.",
"operationId": "%2Fapi%2Fspaces%2F_update_objects_spaces#0",
"parameters": [
{
@ -42066,9 +42087,11 @@
"additionalProperties": false,
"properties": {
"id": {
"description": "The identifier of the saved object to update.",
"type": "string"
},
"type": {
"description": "The type of the saved object to update.",
"type": "string"
}
},
@ -42082,12 +42105,14 @@
},
"spacesToAdd": {
"items": {
"description": "The identifiers of the spaces the saved objects should be added to or removed from.",
"type": "string"
},
"type": "array"
},
"spacesToRemove": {
"items": {
"description": "The identifiers of the spaces the saved objects should be added to or removed from.",
"type": "string"
},
"type": "array"
@ -42104,13 +42129,14 @@
}
},
"responses": {},
"summary": "",
"tags": []
"summary": "Update saved objects in spaces",
"tags": [
"spaces"
]
}
},
"/api/spaces/space": {
"get": {
"description": "Get all spaces",
"operationId": "%2Fapi%2Fspaces%2Fspace#0",
"parameters": [
{
@ -42126,6 +42152,7 @@
}
},
{
"description": "Specifies which authorization checks are applied to the API call. The default value is `any`.",
"in": "query",
"name": "purpose",
"required": false,
@ -42139,6 +42166,7 @@
}
},
{
"description": "When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.",
"in": "query",
"name": "include_authorized_purposes",
"required": true,
@ -42178,14 +42206,17 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Get all spaces",
"tags": [
"spaces"
]
},
"post": {
"description": "Create a space",
"operationId": "%2Fapi%2Fspaces%2Fspace#1",
"parameters": [
{
@ -42221,29 +42252,36 @@
"type": "boolean"
},
"color": {
"description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.",
"type": "string"
},
"description": {
"description": "A description for the space.",
"type": "string"
},
"disabledFeatures": {
"default": [],
"items": {
"description": "The list of features that are turned off in the space.",
"type": "string"
},
"type": "array"
},
"id": {
"description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.",
"type": "string"
},
"imageUrl": {
"description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.",
"type": "string"
},
"initials": {
"description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.",
"maxLength": 2,
"type": "string"
},
"name": {
"description": "The display name for the space. ",
"minLength": 1,
"type": "string"
},
@ -42266,8 +42304,12 @@
}
}
},
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Create a space",
"tags": [
"spaces"
]
@ -42275,7 +42317,7 @@
},
"/api/spaces/space/{id}": {
"delete": {
"description": "Delete a space",
"description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2",
"parameters": [
{
@ -42301,6 +42343,7 @@
}
},
{
"description": "The space identifier.",
"in": "path",
"name": "id",
"required": true,
@ -42309,14 +42352,20 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"204": {
"description": "Indicates a successful call."
},
"404": {
"description": "Indicates that the request failed."
}
},
"summary": "Delete a space",
"tags": [
"spaces"
]
},
"get": {
"description": "Get a space",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0",
"parameters": [
{
@ -42332,6 +42381,7 @@
}
},
{
"description": "The space identifier.",
"in": "path",
"name": "id",
"required": true,
@ -42340,14 +42390,17 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Get a space",
"tags": [
"spaces"
]
},
"put": {
"description": "Update a space",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1",
"parameters": [
{
@ -42373,6 +42426,7 @@
}
},
{
"description": "The space identifier. You are unable to change the ID with the update operation.",
"in": "path",
"name": "id",
"required": true,
@ -42391,29 +42445,36 @@
"type": "boolean"
},
"color": {
"description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.",
"type": "string"
},
"description": {
"description": "A description for the space.",
"type": "string"
},
"disabledFeatures": {
"default": [],
"items": {
"description": "The list of features that are turned off in the space.",
"type": "string"
},
"type": "array"
},
"id": {
"description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.",
"type": "string"
},
"imageUrl": {
"description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.",
"type": "string"
},
"initials": {
"description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.",
"maxLength": 2,
"type": "string"
},
"name": {
"description": "The display name for the space. ",
"minLength": 1,
"type": "string"
},
@ -42436,8 +42497,12 @@
}
}
},
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Update a space",
"tags": [
"spaces"
]

View file

@ -40995,7 +40995,6 @@
},
"/api/spaces/space": {
"get": {
"description": "Get all spaces",
"operationId": "%2Fapi%2Fspaces%2Fspace#0",
"parameters": [
{
@ -41011,6 +41010,7 @@
}
},
{
"description": "Specifies which authorization checks are applied to the API call. The default value is `any`.",
"in": "query",
"name": "purpose",
"required": false,
@ -41024,6 +41024,7 @@
}
},
{
"description": "When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.",
"in": "query",
"name": "include_authorized_purposes",
"required": true,
@ -41063,14 +41064,17 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Get all spaces",
"tags": [
"spaces"
]
},
"post": {
"description": "Create a space",
"operationId": "%2Fapi%2Fspaces%2Fspace#1",
"parameters": [
{
@ -41106,29 +41110,36 @@
"type": "boolean"
},
"color": {
"description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.",
"type": "string"
},
"description": {
"description": "A description for the space.",
"type": "string"
},
"disabledFeatures": {
"default": [],
"items": {
"description": "The list of features that are turned off in the space.",
"type": "string"
},
"type": "array"
},
"id": {
"description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.",
"type": "string"
},
"imageUrl": {
"description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.",
"type": "string"
},
"initials": {
"description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.",
"maxLength": 2,
"type": "string"
},
"name": {
"description": "The display name for the space. ",
"minLength": 1,
"type": "string"
}
@ -41142,8 +41153,12 @@
}
}
},
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Create a space",
"tags": [
"spaces"
]
@ -41151,7 +41166,7 @@
},
"/api/spaces/space/{id}": {
"delete": {
"description": "Delete a space",
"description": "When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2",
"parameters": [
{
@ -41177,6 +41192,7 @@
}
},
{
"description": "The space identifier.",
"in": "path",
"name": "id",
"required": true,
@ -41185,14 +41201,20 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"204": {
"description": "Indicates a successful call."
},
"404": {
"description": "Indicates that the request failed."
}
},
"summary": "Delete a space",
"tags": [
"spaces"
]
},
"get": {
"description": "Get a space",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0",
"parameters": [
{
@ -41208,6 +41230,7 @@
}
},
{
"description": "The space identifier.",
"in": "path",
"name": "id",
"required": true,
@ -41216,14 +41239,17 @@
}
}
],
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Get a space",
"tags": [
"spaces"
]
},
"put": {
"description": "Update a space",
"operationId": "%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1",
"parameters": [
{
@ -41249,6 +41275,7 @@
}
},
{
"description": "The space identifier. You are unable to change the ID with the update operation.",
"in": "path",
"name": "id",
"required": true,
@ -41267,29 +41294,36 @@
"type": "boolean"
},
"color": {
"description": "The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.",
"type": "string"
},
"description": {
"description": "A description for the space.",
"type": "string"
},
"disabledFeatures": {
"default": [],
"items": {
"description": "The list of features that are turned off in the space.",
"type": "string"
},
"type": "array"
},
"id": {
"description": "The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.",
"type": "string"
},
"imageUrl": {
"description": "The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.",
"type": "string"
},
"initials": {
"description": "One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.",
"maxLength": 2,
"type": "string"
},
"name": {
"description": "The display name for the space. ",
"minLength": 1,
"type": "string"
}
@ -41303,8 +41337,12 @@
}
}
},
"responses": {},
"summary": "",
"responses": {
"200": {
"description": "Indicates a successful call."
}
},
"summary": "Update a space",
"tags": [
"spaces"
]

View file

@ -0,0 +1,11 @@
summary: Copy with createNewCopies
description: >
Copy a dashboard with the my-dashboard ID, including all references from the default space to the marketing space.
In this example, the dashboard has a reference to a visualization and that has a reference to a data view.
value:
objects:
- type: dashboard
id: my-dashboard
spaces:
- marketing
includeReferences: true

View file

@ -0,0 +1,12 @@
summary: Copy without createNewCopies
description: >
Copy a dashboard with the my-dashboard ID, including all references from the default space to the marketing space.
In this example, the dashboard has a reference to a visualization and that has a reference to a data view.
value:
objects:
- type: dashboard
id: my-dashboard
spaces:
- marketing
includeReferences: true
createNewCopies: false

View file

@ -0,0 +1,28 @@
summary: Copy with createNewCopies
description: >
The response for successfully copying a dashboard with the my-dashboard ID, including all references from the default space to the marketing space.
The result indicates a successful copy and all three objects are created.
Since these objects were created as new copies, each entry in the successResults array includes a destinationId attribute.
value:
marketing:
success: true
successCount: 3
successResults:
- id: my-dashboard
type: dashboard
destinationId: "1e127098-5b80-417f-b0f1-c60c8395358f"
meta:
icon: dashboardApp
title: Look at my dashboard
- id: my-vis
type: visualization
destinationId: "a610ed80-1c73-4507-9e13-d3af736c8e04"
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-index-pattern
type: index-pattern
destinationId: "bc3c9c70-bf6f-4bec-b4ce-f4189aa9e26b"
meta:
icon: indexPatternApp
title: my-pattern-*

View file

@ -0,0 +1,24 @@
summary: Copy without createNewCopies
description: >
The response for successfully copying a dashboard with the my-dashboard ID with createNewCopies turned off.
The result indicates a successful copy and all three objects are created.
value:
marketing:
success: true
successCount: 3
successResults:
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard
- id: my-vis
type: visualization
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-index-pattern
type: index-pattern
meta:
icon: indexPatternApp
title: my-pattern-*

View file

@ -0,0 +1,72 @@
summary: Failed copy response with conflict errors
description: >
A response for a failed copy of a dashboard with the my-dashboard ID including all references from the default space to the marketing and sales spaces. In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to an index pattern.
The result indicates a successful copy for the marketing space and an unsuccessful copy for the sales space because the data view, visualization, and Canvas workpad each resulted in a conflict error.
Objects are created when the error is resolved using the resolve copy conflicts API.
value:
marketing:
success: true
successCount: 4
successResults:
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard
- id: my-vis
type: visualization
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-canvas
type: canvas-workpad
meta:
icon: canvasApp
title: Look at my canvas
- id: my-index-pattern
type: index-pattern
meta:
icon: indexPatternApp
title: my-pattern-*
sales:
success: false
successCount: 1,
errors:
- id: my-pattern
type: index-pattern
title: my-pattern-*
error:
type: conflict
meta:
icon: indexPatternApp
title: my-pattern-*
- id: my-visualization
type: my-vis
title: Look at my visualization
error:
type: conflict
destinationId: another-vis
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-canvas
type: canvas-workpad
title: Look at my canvas
error:
type: ambiguous_conflict
destinations:
- id: another-canvas
title: Look at another canvas
updatedAt: "2020-07-08T16:36:32.377Z"
- id: yet-another-canvas
title: Look at yet another canvas
updatedAt: "2020-07-05T12:29:54.849Z"
meta:
icon: canvasApp
title: Look at my canvas
successResults":
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard

View file

@ -0,0 +1,33 @@
summary: Failed copy with missing reference errors
description: >
The response for successfully copying a dashboard with the my-dashboard ID, including all references from the default space to the marketing space.
In this example, the dashboard has a reference to a visualization and a Canvas workpad and the visualization has a reference to a data view.
The result indicates an unsuccessful copy because the visualization resulted in a missing references error.
Objects are created when the errors are resolved using the resolve copy conflicts API.
value:
marketing:
success: false
successCount: 2
errors:
- id: my-vis
type: visualization
title: Look at my visualization
error:
type: missing_references
references:
- type: index-pattern
id: my-pattern-*
meta:
icon: visualizeApp
title: Look at my visualization
successResults:
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard
- id: my-canvas
type: canvas-workpad
meta:
icon: canvasApp
title: Look at my canvas

View file

@ -0,0 +1,9 @@
summary: Create a marketing space
value:
id: marketing
name: Marketing
description : This is the Marketing Space
color: #aabbcc
initials: MK
disabledFeatures: []
imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAABACAYAAABC6cT1AAAGf0lEQVRoQ+3abYydRRUH8N882xYo0IqagEVjokQJKAiKBjXExC9G/aCkGowCIghCkRcrVSSKIu/FEiqgGL6gBIlAYrAqUTH6hZgQFVEMKlQFfItWoQWhZe8z5uzMLdvbfbkLxb13d+fbvfe588x/zpn/+Z9zJpmnI81T3BaAzzfLL1h8weLzZAcWXH2eGHo7zAWLL1h8nuzAjFw9G1N6Kzq8HnuM36MR8iibF3Fv4q+7cv8yDV6K13bYq2furSP8Ag8ncr/vnSnwRViJT2GfCV7yL1yHGxLb+l3EdM9lluNEnIC9xz+f2ZL4Er6Z2DrdXN3fZwp8CU7OfDHxggle8lTLbQ1nJ/7Z7yKmey5zYGZt4h2IzR8/trRc2PDlxJPTzfVcgJ+CC0wMPOa9F6cm7up3EVM9V9386MxliVdM8GwAv6hh/awCz/w7lY25OtF5ruBz4ZLP42NYNrDAFbC3YPWuILnMAfgq3oaRQQYea/stViV+sgssvjKzLvGySeaaNVfP4d7Btokgvxj/bblgpueuF1hmWcyTCmfE3J3M1lTcv0vMswM88zR+jpw4osu6me8kzkpsfLZWzxyRuabO22buxxOJ12FxnXfWgEe83pB5sOE47BsLymzscOoi7nw2JJfZreUjiUsTyzKPZm5NvBDvSuw268AzNzV8H5/Am+qCnsAXgpgSW2Zq9cyKlksbPlTd+te4quWNieMHBfiNDdciYnwsdI/MaOaWhnMTf54J8CqNj8x8JXFIZltYu+HqlmNT8YSBsHgAPw/vxvlVV4du/s0oaxbxg0TbL/jMni0nNcVjQq7+HZfgtpbzBg342TgQ63AkmsymxBW4IjE6A+D7Vzd/fyWxIM/VuCe+HzTgZ2Jpy/kNJ2FJLmLm24mPJ/42A+Bvrxt4SISwlhsaPodH26LZB8rVA3inwwebsrixJCZzX+KMxI/7AV61eVh3DV6Mx3EOvh4kN6jAg8nfUCXm4d1wE66OyxNPTQc+s3/o/MoXizL3JE5O3F3P/uBZPPF4Zr+Wi5uSO48ZPRdyCwn7YB/A35m5KhWNHox4fcNnIs0ddOCRSBxf8+cQG+Huf0l8NJVYP+nI7NXy2ar4QqIGm69JfKPOE2w/mBavCzwM11R2D+ChsUO7hyUfmwx55qDM1xJvqZ7y08TpifuGBfjeURVJnNIVGpkNiXNS0ds7jcySDitDCCWW56LJ10fRo8sNA+3qXUSZD2CtQlZh9T+1rB7h9oliembflnMbzqgSNZKbKGHdPm7OwXb1CvQ1metSETMpszmzvikCJNh/h5E5PHNl4qga/+/cxqrdeWDYgIe7X5L4cGJPJX2940lOX8pD41FnFnc4riluvQKbK0dcHJFi2IBHNTQSlguru4d2/wPOTNzRA3x5y+U1E1uqWDkETOT026XuUJzx6u7ReLhSYenQ7uHua0fKZmwfmcPqsQjxE5WVONcRxn7X89zgn/EKPMRMxOVQXmP18Mx3q3b/Y/0cQE/IhFtHESMsHFlZ1Ml3CH3DZPHImY+pxcKumNmYirtvqMBfhMuU6s3iqOQkTsMPe1tCQwO8Ajs0lxr7W+vnp1MJc9EgCNd/cy6x+9D4veXmprj5wxMw/3C4egW6zzgZOlYZzfwo3F2J7ael0pJamvlPKgWNKFft1AAcKotXoFEbD7kaoSoQPVKB35+5KHF0lai/rJo+up87jWEE/qqqwY+qrL21LWLm95lPJ16ppKw31XC3PXYPJauPEx7B6BHCgrSizRs18qiaRp8tlN3ueCTYPHH9RNaunjI8Z7wLYpT3jZSCYXQ8e9vTsRE/q+no3XMKeObgGtaintbb/AvXj4JDkNw/5hrwYPfIvlZFUbLn7G5q+eQIN09Vnho6cqvnM/Lt99RixH49wO8K0ZL41WTWHoQzvsNVkOheZqKhEGpsp3SzB+BBtZAYve7uOR9tuTaaB6l0XScdYfEQPpkTUyHEGP+XqyDBzu+NBCITUjNWHynkrbWKOuWFn1xKzqsyx0bdvS78odp0+N503Zao0uCsWuSIDku8/7EO60b41vN5+Ses9BKlTdvd8bhp9EBvJjWJAIn/vxwHe6b3tSk6JFPV4nq85oAOrx555v/x/rh3E6Lo+bnuNS4uB4Cuq0ZfvO8X1rM6q/+vnjLVqZq7v83onttc2oYF4HPJmv1gWbB4P7s0l55ZsPhcsmY/WBYs3s8uzaVn5q3F/wf70mRuBCtbjQAAAABJRU5ErkJggg=="

View file

@ -0,0 +1,9 @@
summary: Disable legacy URL aliases
description: >
This request leaves the alias intact but the legacy URL for this alias (http://localhost:5601/s/bills-space/app/dashboards#/view/123) will no longer function.
The dashboard still exists and you can access it with the new URL.
value:
aliases:
- targetSpace: bills-space
targetType: dashboard
sourceId: 123

View file

@ -0,0 +1,10 @@
summary: Get details about a marketing space
value:
id: marketing
name: Marketing
description : This is the Marketing Space
color: #aabbcc
initials: MK
disabledFeatures: []
imageUrl: ""
solution: es

View file

@ -0,0 +1,24 @@
summary: Get all spaces
description: Get all spaces without specifying any options.
value:
- id: default
name: Default
description: This is the Default Space
disabledFeatures: []
imageUrl: ""
_reserved: true
- id: marketing
name: Marketing
description: This is the Marketing Space
color: #aabbcc
disabledFeatures:
- apm
initials: MK
imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSU"
- id: sales
name: Sales
initials: MK
disabledFeatures:
- discover
imageUr": ""
solution: oblt

View file

@ -0,0 +1,41 @@
summary: Get all spaces with custom options
description: >
The user has read-only access to the Sales space.
Get all spaces with the following query parameters:
"purpose=shareSavedObjectsIntoSpace&include_authorized_purposes=true"
value:
- id: default
name: Default
description: This is the Default Space
disabledFeatures: []
imageUrl: ""
_reserved: true
authorizedPurposes:
any: true
copySavedObjectsIntoSpace: true
findSavedObjects: true
shareSavedObjectsIntoSpace: true
- id: marketing
name: Marketing
description: This is the Marketing Space
color: #aabbcc
disabledFeatures:
- apm
initials: MK
imageUrl: "data:image/png;base64,iVBORw0KGgoAAAANSU"
authorizedPurposes:
any: true
copySavedObjectsIntoSpace: true
findSavedObjects: true
shareSavedObjectsIntoSpace: true
- id: sales
name: Sales
initials: MK
disabledFeatures:
- discover
imageUrl: ""
authorizedPurposes:
any: true
copySavedObjectsIntoSpace: false
findSavedObjects: true
shareSavedObjectsIntoSpace: false

View file

@ -0,0 +1,26 @@
summary: Resolve conflict errors
description: >
Resolve conflict errors for a data view, visualization, and Canvas workpad by overwriting the existing saved objects.
NOTE: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that were returned in the successResults array.
In this example, we retried copying the dashboard accordingly.
value:
objects:
- type: dashboard
id: my-dashboard
includeReferences: true
createNewCopies: false
retries:
sales:
- type: index-pattern
id: my-pattern
overwrite: true
- type: visualization
id: my-vis
overwrite: true,
destinationId: another-vis
- type: canvas
id: my-canvas
overwrite: true
destinationId: yet-another-canvas
- type: dashboard
id: my-dashboard

View file

@ -0,0 +1,20 @@
summary: Resolve missing reference errors
description: >
Resolve missing reference errors for a visualization by ignoring the error.
NOTE: If a prior copy attempt resulted in resolvable errors, you must include a retry for each object you want to copy, including any that were returned in the successResults array.
In this example, we retried copying the dashboard and canvas accordingly.
value:
objects:
- type: dashboard
id: my-dashboard
includeReferences: true
createNewCopies: false
retries:
marketing:
- type: visualization
id: my-vis
ignoreMissingReferences: true
- type: canvas
id: my-canvas
- type: dashboard
id: my-dashboard

View file

@ -0,0 +1,31 @@
summary: Resolve conflict errors
description: >
The response for resolving conflict errors for a data view, visualization, and Canvas workpad by overwriting the existing saved objects.
The result indicates a successful copy and all four objects are created.
value:
sales:
success: true
successCount: 4
successResults:
- id: my-pattern
type: index-pattern
meta:
icon: indexPatternApp
title: my-pattern-*
- id: my-vis
type: visualization
destinationId: another-vis
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-canvas
type: canvas-workpad
destinationId: yet-another-canvas
meta:
icon: canvasApp
title: Look at my canvas
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard

View file

@ -0,0 +1,24 @@
summary: Resolve conflict errors
description: >
The response for resolving missing reference errors for a visualization.
The result indicates a successful copy and all three objects are created.
value:
marketing:
success: true
successCount: 3
successResults:
- id: my-vis
type: visualization
meta:
icon: visualizeApp
title: Look at my visualization
- id: my-canvas
type: canvas-workpad
meta:
icon: canvasApp
title: Look at my canvas
- id: my-dashboard
type: dashboard
meta:
icon: dashboardApp
title: Look at my dashboard

View file

@ -0,0 +1,9 @@
summary: Update saved object spaces
description: Update the spaces of each saved object and all its references.
value:
objects:
- type: index-pattern
id: 90943e30-9a47-11e8-b64d-95841ca0b247
spacesToAdd:
- test
spacesToRemove: []

View file

@ -0,0 +1,10 @@
summary: Update saved object spaces
description: >
The response from updating the spaces of saved objects.
value:
objects:
- type: index-pattern
id: 90943e30-9a47-11e8-b64d-95841ca0b247
spaces:
- default
- test

View file

@ -0,0 +1,10 @@
summary: Update a marketing space
description: Update the marketing space to remove the imageUrl.
value:
id: marketing
name: Marketing
description : This is the Marketing Space
color: #aabbcc
initials: MK
disabledFeatures: []
imageUrl: ""

View file

@ -52,11 +52,13 @@ api-docs-overlay: ## Run spectral API docs linter on kibana.serverless.yaml
@npx bump overlay "output/kibana.serverless.yaml" "overlays/kibana.overlays.serverless.yaml" > "output/kibana.serverless.tmp1.yaml"
@npx bump overlay "output/kibana.serverless.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.serverless.tmp2.yaml"
@npx bump overlay "output/kibana.serverless.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.serverless.tmp3.yaml"
@npx bump overlay "output/kibana.serverless.tmp3.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.serverless.tmp4.yaml"
@npx bump overlay "output/kibana.yaml" "overlays/kibana.overlays.yaml" > "output/kibana.tmp1.yaml"
@npx bump overlay "output/kibana.tmp1.yaml" "overlays/alerting.overlays.yaml" > "output/kibana.tmp2.yaml"
@npx bump overlay "output/kibana.tmp2.yaml" "overlays/connectors.overlays.yaml" > "output/kibana.tmp3.yaml"
@npx @redocly/cli bundle output/kibana.serverless.tmp3.yaml --ext yaml -o output/kibana.serverless.new.yaml
@npx @redocly/cli bundle output/kibana.tmp3.yaml --ext yaml -o output/kibana.new.yaml
@npx bump overlay "output/kibana.tmp3.yaml" "overlays/kibana.overlays.shared.yaml" > "output/kibana.tmp4.yaml"
@npx @redocly/cli bundle output/kibana.serverless.tmp4.yaml --ext yaml -o output/kibana.serverless.new.yaml
@npx @redocly/cli bundle output/kibana.tmp4.yaml --ext yaml -o output/kibana.new.yaml
rm output/kibana.tmp*.yaml
rm output/kibana.serverless.tmp*.yaml

View file

@ -36558,7 +36558,6 @@ paths:
- Prompts API
/api/spaces/space:
get:
description: Get all spaces
operationId: '%2Fapi%2Fspaces%2Fspace#0'
parameters:
- description: The version of the API to use
@ -36569,7 +36568,10 @@ paths:
enum:
- '2023-10-31'
type: string
- in: query
- description: >-
Specifies which authorization checks are applied to the API call.
The default value is `any`.
in: query
name: purpose
required: false
schema:
@ -36578,7 +36580,15 @@ paths:
- copySavedObjectsIntoSpace
- shareSavedObjectsIntoSpace
type: string
- in: query
- description: >-
When enabled, the API returns any spaces that the user is authorized
to access in any capacity and each space will contain the purposes
for which the user is authorized. This can be useful to determine
which spaces a user can read but not take a specific action in. If
the security plugin is not enabled, this parameter has no effect,
since no authorization checks take place. This parameter cannot be
used in with the `purpose` parameter.
in: query
name: include_authorized_purposes
required: true
schema:
@ -36597,12 +36607,13 @@ paths:
x-oas-optional: true
- type: boolean
x-oas-optional: true
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get all spaces
tags:
- spaces
post:
description: Create a space
operationId: '%2Fapi%2Fspaces%2Fspace#1'
parameters:
- description: The version of the API to use
@ -36630,34 +36641,61 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Create a space
tags:
- spaces
/api/spaces/space/{id}:
delete:
description: Delete a space
description: >-
When you delete a space, all saved objects that belong to the space are
automatically deleted, which is permanent and cannot be undone.
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2'
parameters:
- description: The version of the API to use
@ -36675,17 +36713,21 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'204':
description: Indicates a successful call.
'404':
description: Indicates that the request failed.
summary: Delete a space
tags:
- spaces
get:
description: Get a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0'
parameters:
- description: The version of the API to use
@ -36696,17 +36738,19 @@ paths:
enum:
- '2023-10-31'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get a space
tags:
- spaces
put:
description: Update a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1'
parameters:
- description: The version of the API to use
@ -36724,7 +36768,10 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: >-
The space identifier. You are unable to change the ID with the
update operation.
in: path
name: id
required: true
schema:
@ -36739,29 +36786,54 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Update a space
tags:
- spaces
/api/status:

View file

@ -36558,7 +36558,6 @@ paths:
- Prompts API
/api/spaces/space:
get:
description: Get all spaces
operationId: '%2Fapi%2Fspaces%2Fspace#0'
parameters:
- description: The version of the API to use
@ -36569,7 +36568,10 @@ paths:
enum:
- '2023-10-31'
type: string
- in: query
- description: >-
Specifies which authorization checks are applied to the API call.
The default value is `any`.
in: query
name: purpose
required: false
schema:
@ -36578,7 +36580,15 @@ paths:
- copySavedObjectsIntoSpace
- shareSavedObjectsIntoSpace
type: string
- in: query
- description: >-
When enabled, the API returns any spaces that the user is authorized
to access in any capacity and each space will contain the purposes
for which the user is authorized. This can be useful to determine
which spaces a user can read but not take a specific action in. If
the security plugin is not enabled, this parameter has no effect,
since no authorization checks take place. This parameter cannot be
used in with the `purpose` parameter.
in: query
name: include_authorized_purposes
required: true
schema:
@ -36597,12 +36607,13 @@ paths:
x-oas-optional: true
- type: boolean
x-oas-optional: true
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get all spaces
tags:
- spaces
post:
description: Create a space
operationId: '%2Fapi%2Fspaces%2Fspace#1'
parameters:
- description: The version of the API to use
@ -36630,34 +36641,61 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Create a space
tags:
- spaces
/api/spaces/space/{id}:
delete:
description: Delete a space
description: >-
When you delete a space, all saved objects that belong to the space are
automatically deleted, which is permanent and cannot be undone.
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2'
parameters:
- description: The version of the API to use
@ -36675,17 +36713,21 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'204':
description: Indicates a successful call.
'404':
description: Indicates that the request failed.
summary: Delete a space
tags:
- spaces
get:
description: Get a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0'
parameters:
- description: The version of the API to use
@ -36696,17 +36738,19 @@ paths:
enum:
- '2023-10-31'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get a space
tags:
- spaces
put:
description: Update a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1'
parameters:
- description: The version of the API to use
@ -36724,7 +36768,10 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: >-
The space identifier. You are unable to change the ID with the
update operation.
in: path
name: id
required: true
schema:
@ -36739,29 +36786,54 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Update a space
tags:
- spaces
/api/status:

View file

@ -41098,7 +41098,13 @@ paths:
- roles
/api/spaces/_copy_saved_objects:
post:
description: Copy saved objects to spaces
description: >-
It also allows you to automatically copy related objects, so when you
copy a dashboard, this can automatically copy over the associated
visualizations, data views, and saved searches, as required. You can
request to overwrite any objects that already exist in the target space
if they share an identifier or you can use the resolve copy saved
objects conflicts API to do this on a per-object basis.
operationId: '%2Fapi%2Fspaces%2F_copy_saved_objects#0'
parameters:
- description: The version of the API to use
@ -41125,12 +41131,26 @@ paths:
properties:
compatibilityMode:
default: false
description: >-
Apply various adjustments to the saved objects that are
being copied to maintain compatibility between different
Kibana versions. Use this option only if you encounter
issues with copied saved objects. This option cannot be used
with the `createNewCopies` option.
type: boolean
createNewCopies:
default: true
description: >-
Create new copies of saved objects, regenerate each object
identifier, and reset the origin. When used, potential
conflict errors are avoided. This option cannot be used
with the `overwrite` and `compatibilityMode` options.
type: boolean
includeReferences:
default: false
description: >-
When set to true, all saved objects related to the specified
saved objects will also be copied into the target spaces.
type: boolean
objects:
items:
@ -41138,8 +41158,10 @@ paths:
type: object
properties:
id:
description: The identifier of the saved object to copy.
type: string
type:
description: The type of the saved object to copy.
type: string
required:
- type
@ -41147,20 +41169,29 @@ paths:
type: array
overwrite:
default: false
description: >-
When set to true, all conflicts are automatically
overridden. When a saved object with a matching type and
identifier exists in the target space, that version is
replaced with the version from the source space. This option
cannot be used with the `createNewCopies` option.
type: boolean
spaces:
items:
description: >-
The identifiers of the spaces where you want to copy the
specified objects.
type: string
type: array
required:
- spaces
- objects
responses: {}
summary: ''
tags: []
summary: Copy saved objects between spaces
tags:
- spaces
/api/spaces/_disable_legacy_url_aliases:
post:
description: Disable legacy URL aliases
operationId: '%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0'
parameters:
- description: The version of the API to use
@ -41191,10 +41222,15 @@ paths:
type: object
properties:
sourceId:
description: >-
The alias source object identifier. This is the legacy
object identifier.
type: string
targetSpace:
description: The space where the alias target object exists.
type: string
targetType:
description: 'The type of alias target object. '
type: string
required:
- targetSpace
@ -41204,11 +41240,12 @@ paths:
required:
- aliases
responses: {}
summary: ''
tags: []
summary: Disable legacy URL aliases
tags:
- spaces
/api/spaces/_get_shareable_references:
post:
description: Get shareable references
description: Collect references and space contexts for saved objects.
operationId: '%2Fapi%2Fspaces%2F_get_shareable_references#0'
parameters:
- description: The version of the API to use
@ -41249,11 +41286,14 @@ paths:
required:
- objects
responses: {}
summary: ''
tags: []
summary: Get shareable references
tags:
- spaces
/api/spaces/_resolve_copy_saved_objects_errors:
post:
description: Resolve conflicts copying saved objects
description: >-
Overwrite saved objects that are returned as errors from the copy saved
objects to space API.
operationId: '%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0'
parameters:
- description: The version of the API to use
@ -41307,17 +41347,33 @@ paths:
type: object
properties:
createNewCopy:
description: >-
Creates new copies of the saved objects, regenerates
each object ID, and resets the origin.
type: boolean
destinationId:
description: >-
Specifies the destination identifier that the copied
object should have, if different from the current
identifier.
type: string
id:
description: The saved object identifier.
type: string
ignoreMissingReferences:
description: >-
When set to true, any missing references errors are
ignored.
type: boolean
overwrite:
default: false
description: >-
When set to true, the saved object from the source
space overwrites the conflicting object in the
destination space.
type: boolean
type:
description: The saved object type.
type: string
required:
- type
@ -41328,11 +41384,11 @@ paths:
- retries
- objects
responses: {}
summary: ''
summary: Resolve conflicts copying saved objects
tags: []
/api/spaces/_update_objects_spaces:
post:
description: Update saved objects in spaces
description: Update one or more saved objects to add or remove them from some spaces.
operationId: '%2Fapi%2Fspaces%2F_update_objects_spaces#0'
parameters:
- description: The version of the API to use
@ -41363,8 +41419,10 @@ paths:
type: object
properties:
id:
description: The identifier of the saved object to update.
type: string
type:
description: The type of the saved object to update.
type: string
required:
- type
@ -41372,10 +41430,16 @@ paths:
type: array
spacesToAdd:
items:
description: >-
The identifiers of the spaces the saved objects should be
added to or removed from.
type: string
type: array
spacesToRemove:
items:
description: >-
The identifiers of the spaces the saved objects should be
added to or removed from.
type: string
type: array
required:
@ -41383,11 +41447,11 @@ paths:
- spacesToAdd
- spacesToRemove
responses: {}
summary: ''
tags: []
summary: Update saved objects in spaces
tags:
- spaces
/api/spaces/space:
get:
description: Get all spaces
operationId: '%2Fapi%2Fspaces%2Fspace#0'
parameters:
- description: The version of the API to use
@ -41398,7 +41462,10 @@ paths:
enum:
- '2023-10-31'
type: string
- in: query
- description: >-
Specifies which authorization checks are applied to the API call.
The default value is `any`.
in: query
name: purpose
required: false
schema:
@ -41407,7 +41474,15 @@ paths:
- copySavedObjectsIntoSpace
- shareSavedObjectsIntoSpace
type: string
- in: query
- description: >-
When enabled, the API returns any spaces that the user is authorized
to access in any capacity and each space will contain the purposes
for which the user is authorized. This can be useful to determine
which spaces a user can read but not take a specific action in. If
the security plugin is not enabled, this parameter has no effect,
since no authorization checks take place. This parameter cannot be
used in with the `purpose` parameter.
in: query
name: include_authorized_purposes
required: true
schema:
@ -41426,12 +41501,13 @@ paths:
x-oas-optional: true
- type: boolean
x-oas-optional: true
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get all spaces
tags:
- spaces
post:
description: Create a space
operationId: '%2Fapi%2Fspaces%2Fspace#1'
parameters:
- description: The version of the API to use
@ -41459,22 +41535,45 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
solution:
@ -41487,13 +41586,17 @@ paths:
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Create a space
tags:
- spaces
/api/spaces/space/{id}:
delete:
description: Delete a space
description: >-
When you delete a space, all saved objects that belong to the space are
automatically deleted, which is permanent and cannot be undone.
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2'
parameters:
- description: The version of the API to use
@ -41511,17 +41614,21 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'204':
description: Indicates a successful call.
'404':
description: Indicates that the request failed.
summary: Delete a space
tags:
- spaces
get:
description: Get a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0'
parameters:
- description: The version of the API to use
@ -41532,17 +41639,19 @@ paths:
enum:
- '2023-10-31'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get a space
tags:
- spaces
put:
description: Update a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1'
parameters:
- description: The version of the API to use
@ -41560,7 +41669,10 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: >-
The space identifier. You are unable to change the ID with the
update operation.
in: path
name: id
required: true
schema:
@ -41575,22 +41687,45 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
solution:
@ -41603,8 +41738,10 @@ paths:
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Update a space
tags:
- spaces
/api/status:

View file

@ -41098,7 +41098,13 @@ paths:
- roles
/api/spaces/_copy_saved_objects:
post:
description: Copy saved objects to spaces
description: >-
It also allows you to automatically copy related objects, so when you
copy a dashboard, this can automatically copy over the associated
visualizations, data views, and saved searches, as required. You can
request to overwrite any objects that already exist in the target space
if they share an identifier or you can use the resolve copy saved
objects conflicts API to do this on a per-object basis.
operationId: '%2Fapi%2Fspaces%2F_copy_saved_objects#0'
parameters:
- description: The version of the API to use
@ -41125,12 +41131,26 @@ paths:
properties:
compatibilityMode:
default: false
description: >-
Apply various adjustments to the saved objects that are
being copied to maintain compatibility between different
Kibana versions. Use this option only if you encounter
issues with copied saved objects. This option cannot be used
with the `createNewCopies` option.
type: boolean
createNewCopies:
default: true
description: >-
Create new copies of saved objects, regenerate each object
identifier, and reset the origin. When used, potential
conflict errors are avoided. This option cannot be used
with the `overwrite` and `compatibilityMode` options.
type: boolean
includeReferences:
default: false
description: >-
When set to true, all saved objects related to the specified
saved objects will also be copied into the target spaces.
type: boolean
objects:
items:
@ -41138,8 +41158,10 @@ paths:
type: object
properties:
id:
description: The identifier of the saved object to copy.
type: string
type:
description: The type of the saved object to copy.
type: string
required:
- type
@ -41147,20 +41169,29 @@ paths:
type: array
overwrite:
default: false
description: >-
When set to true, all conflicts are automatically
overridden. When a saved object with a matching type and
identifier exists in the target space, that version is
replaced with the version from the source space. This option
cannot be used with the `createNewCopies` option.
type: boolean
spaces:
items:
description: >-
The identifiers of the spaces where you want to copy the
specified objects.
type: string
type: array
required:
- spaces
- objects
responses: {}
summary: ''
tags: []
summary: Copy saved objects between spaces
tags:
- spaces
/api/spaces/_disable_legacy_url_aliases:
post:
description: Disable legacy URL aliases
operationId: '%2Fapi%2Fspaces%2F_disable_legacy_url_aliases#0'
parameters:
- description: The version of the API to use
@ -41191,10 +41222,15 @@ paths:
type: object
properties:
sourceId:
description: >-
The alias source object identifier. This is the legacy
object identifier.
type: string
targetSpace:
description: The space where the alias target object exists.
type: string
targetType:
description: 'The type of alias target object. '
type: string
required:
- targetSpace
@ -41204,11 +41240,12 @@ paths:
required:
- aliases
responses: {}
summary: ''
tags: []
summary: Disable legacy URL aliases
tags:
- spaces
/api/spaces/_get_shareable_references:
post:
description: Get shareable references
description: Collect references and space contexts for saved objects.
operationId: '%2Fapi%2Fspaces%2F_get_shareable_references#0'
parameters:
- description: The version of the API to use
@ -41249,11 +41286,14 @@ paths:
required:
- objects
responses: {}
summary: ''
tags: []
summary: Get shareable references
tags:
- spaces
/api/spaces/_resolve_copy_saved_objects_errors:
post:
description: Resolve conflicts copying saved objects
description: >-
Overwrite saved objects that are returned as errors from the copy saved
objects to space API.
operationId: '%2Fapi%2Fspaces%2F_resolve_copy_saved_objects_errors#0'
parameters:
- description: The version of the API to use
@ -41307,17 +41347,33 @@ paths:
type: object
properties:
createNewCopy:
description: >-
Creates new copies of the saved objects, regenerates
each object ID, and resets the origin.
type: boolean
destinationId:
description: >-
Specifies the destination identifier that the copied
object should have, if different from the current
identifier.
type: string
id:
description: The saved object identifier.
type: string
ignoreMissingReferences:
description: >-
When set to true, any missing references errors are
ignored.
type: boolean
overwrite:
default: false
description: >-
When set to true, the saved object from the source
space overwrites the conflicting object in the
destination space.
type: boolean
type:
description: The saved object type.
type: string
required:
- type
@ -41328,11 +41384,11 @@ paths:
- retries
- objects
responses: {}
summary: ''
summary: Resolve conflicts copying saved objects
tags: []
/api/spaces/_update_objects_spaces:
post:
description: Update saved objects in spaces
description: Update one or more saved objects to add or remove them from some spaces.
operationId: '%2Fapi%2Fspaces%2F_update_objects_spaces#0'
parameters:
- description: The version of the API to use
@ -41363,8 +41419,10 @@ paths:
type: object
properties:
id:
description: The identifier of the saved object to update.
type: string
type:
description: The type of the saved object to update.
type: string
required:
- type
@ -41372,10 +41430,16 @@ paths:
type: array
spacesToAdd:
items:
description: >-
The identifiers of the spaces the saved objects should be
added to or removed from.
type: string
type: array
spacesToRemove:
items:
description: >-
The identifiers of the spaces the saved objects should be
added to or removed from.
type: string
type: array
required:
@ -41383,11 +41447,11 @@ paths:
- spacesToAdd
- spacesToRemove
responses: {}
summary: ''
tags: []
summary: Update saved objects in spaces
tags:
- spaces
/api/spaces/space:
get:
description: Get all spaces
operationId: '%2Fapi%2Fspaces%2Fspace#0'
parameters:
- description: The version of the API to use
@ -41398,7 +41462,10 @@ paths:
enum:
- '2023-10-31'
type: string
- in: query
- description: >-
Specifies which authorization checks are applied to the API call.
The default value is `any`.
in: query
name: purpose
required: false
schema:
@ -41407,7 +41474,15 @@ paths:
- copySavedObjectsIntoSpace
- shareSavedObjectsIntoSpace
type: string
- in: query
- description: >-
When enabled, the API returns any spaces that the user is authorized
to access in any capacity and each space will contain the purposes
for which the user is authorized. This can be useful to determine
which spaces a user can read but not take a specific action in. If
the security plugin is not enabled, this parameter has no effect,
since no authorization checks take place. This parameter cannot be
used in with the `purpose` parameter.
in: query
name: include_authorized_purposes
required: true
schema:
@ -41426,12 +41501,13 @@ paths:
x-oas-optional: true
- type: boolean
x-oas-optional: true
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get all spaces
tags:
- spaces
post:
description: Create a space
operationId: '%2Fapi%2Fspaces%2Fspace#1'
parameters:
- description: The version of the API to use
@ -41459,22 +41535,45 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
solution:
@ -41487,13 +41586,17 @@ paths:
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Create a space
tags:
- spaces
/api/spaces/space/{id}:
delete:
description: Delete a space
description: >-
When you delete a space, all saved objects that belong to the space are
automatically deleted, which is permanent and cannot be undone.
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#2'
parameters:
- description: The version of the API to use
@ -41511,17 +41614,21 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'204':
description: Indicates a successful call.
'404':
description: Indicates that the request failed.
summary: Delete a space
tags:
- spaces
get:
description: Get a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#0'
parameters:
- description: The version of the API to use
@ -41532,17 +41639,19 @@ paths:
enum:
- '2023-10-31'
type: string
- in: path
- description: The space identifier.
in: path
name: id
required: true
schema:
type: string
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Get a space
tags:
- spaces
put:
description: Update a space
operationId: '%2Fapi%2Fspaces%2Fspace%2F%7Bid%7D#1'
parameters:
- description: The version of the API to use
@ -41560,7 +41669,10 @@ paths:
schema:
example: 'true'
type: string
- in: path
- description: >-
The space identifier. You are unable to change the ID with the
update operation.
in: path
name: id
required: true
schema:
@ -41575,22 +41687,45 @@ paths:
_reserved:
type: boolean
color:
description: >-
The hexadecimal color code used in the space avatar. By
default, the color is automatically generated from the space
name.
type: string
description:
description: A description for the space.
type: string
disabledFeatures:
default: []
items:
description: The list of features that are turned off in the space.
type: string
type: array
id:
description: >-
The space ID that is part of the Kibana URL when inside the
space. Space IDs are limited to lowercase alphanumeric,
underscore, and hyphen characters (a-z, 0-9, _, and -). You
are cannot change the ID with the update operation.
type: string
imageUrl:
description: >-
The data-URL encoded image to display in the space avatar.
If specified, initials will not be displayed and the color
will be visible as the background color for transparent
images. For best results, your image should be 64x64. Images
will not be optimized by this API call, so care should be
taken when using custom images.
type: string
initials:
description: >-
One or two characters that are shown in the space avatar. By
default, the initials are automatically generated from the
space name.
maxLength: 2
type: string
name:
description: 'The display name for the space. '
minLength: 1
type: string
solution:
@ -41603,8 +41738,10 @@ paths:
required:
- id
- name
responses: {}
summary: ''
responses:
'200':
description: Indicates a successful call.
summary: Update a space
tags:
- spaces
/api/status:

View file

@ -0,0 +1,47 @@
# overlays.yaml
overlay: 1.0.0
info:
title: Overlays that are applicable to both serverless and non-serverless documentas
version: 0.0.1
actions:
# Add some spaces API examples
- target: "$.paths['/api/spaces/space']['post']"
description: "Add example to create space API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
createSpaceRequest:
$ref: "../examples/create_space_request.yaml"
- target: "$.paths['/api/spaces/space/{id}']['put']"
description: "Add example to update space API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
updateSpaceRequest:
$ref: "../examples/update_space_request.yaml"
- target: "$.paths['/api/spaces/space/{id}']['get']"
description: "Add example to get space API"
update:
responses:
200:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
getSpaceResponseExample:
$ref: "../examples/get_space_response.yaml"
- target: "$.paths['/api/spaces/space']['get']"
description: "Add example to get all spaces API"
update:
responses:
200:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
getSpacesResponseExample1:
$ref: "../examples/get_spaces_response1.yaml"
getSpacesResponseExample2:
$ref: "../examples/get_spaces_response2.yaml"

View file

@ -4,7 +4,7 @@ info:
title: Overlays for the Kibana API document
version: 0.0.1
actions:
# Add an introduction to spaces
# Add an introduction to spaces
- target: '$'
description: Add an extra page about spaces
update:
@ -24,7 +24,7 @@ actions:
If you use the Kibana console to send API requests, it automatically adds the appropriate space identifier.
To learn more, check out [Spaces](https://www.elastic.co/guide/en/kibana/master/xpack-spaces.html).
# Add some tag descriptions and displayNames
# Add some tag descriptions and displayNames
- target: '$.tags[?(@.name=="alerting")]'
description: Change tag description and displayName
update:
@ -91,7 +91,77 @@ actions:
x-displayName: "System"
description: >
Get information about the system status, resource usage, and installed plugins.
# Remove extra tags from operations
# Remove extra tags from operations
- target: "$.paths[*][*].tags[1:]"
description: Remove all but first tag from operations
remove: true
remove: true
# Examples that are not applicable to serverless
- target: "$.paths['/api/spaces/_copy_saved_objects']['post']"
description: "Add example to copy saved objects to space API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
copySavedObjectsRequestExample1:
$ref: "../examples/copy_saved_objects_request1.yaml"
copySavedObjectsRequestExample2:
$ref: "../examples/copy_saved_objects_request2.yaml"
responses:
200:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
copySavedObjectsResponseExample1:
$ref: "../examples/copy_saved_objects_response1.yaml"
copySavedObjectsResponseExample2:
$ref: "../examples/copy_saved_objects_response2.yaml"
copySavedObjectsResponseExample3:
$ref: "../examples/copy_saved_objects_response3.yaml"
copySavedObjectsResponseExample4:
$ref: "../examples/copy_saved_objects_response4.yaml"
- target: "$.paths['/api/spaces/_resolve_copy_saved_objects_errors']['post']"
description: "Add example to resolve copy saved objects to space conflicts API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
resolveCopySavedObjectsRequestExample1:
$ref: "../examples/resolve_copy_saved_objects_request1.yaml"
resolveCopySavedObjectsRequestExample2:
$ref: "../examples/resolve_copy_saved_objects_request2.yaml"
responses:
200:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
resolveCopySavedObjectsResponseExample1:
$ref: "../examples/copy_saved_objects_response1.yaml"
resolveCopySavedObjectsResponseExample2:
$ref: "../examples/copy_saved_objects_response2.yaml"
- target: "$.paths['/api/spaces/_disable_legacy_url_aliases']['post']"
description: "Add example to disable legacy URL aliases API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
disableLegacyURLRequestExample1:
$ref: "../examples/disable_legacy_url_request1.yaml"
- target: "$.paths['/api/spaces/_update_objects_spaces']['post']"
description: "Add example to update saved object spaces API"
update:
requestBody:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
updateObjectSpacesRequestExample1:
$ref: "../examples/update_saved_objects_spaces_request1.yaml"
responses:
200:
content:
application/json; Elastic-Api-Version=2023-10-31:
examples:
updateObjectSpacesResponseExample1:
$ref: "../examples/update_saved_objects_spaces_response1.yaml"

View file

@ -18,10 +18,29 @@ const spaceSchema = schema.object({
return `must be lower case, a-z, 0-9, '_', and '-' are allowed`;
}
},
meta: {
description:
'The space ID that is part of the Kibana URL when inside the space. Space IDs are limited to lowercase alphanumeric, underscore, and hyphen characters (a-z, 0-9, _, and -). You are cannot change the ID with the update operation.',
},
}),
name: schema.string({ minLength: 1 }),
description: schema.maybe(schema.string()),
initials: schema.maybe(schema.string({ maxLength: MAX_SPACE_INITIALS })),
name: schema.string({
minLength: 1,
meta: { description: 'The display name for the space. ' },
}),
description: schema.maybe(
schema.string({
meta: { description: 'A description for the space.' },
})
),
initials: schema.maybe(
schema.string({
maxLength: MAX_SPACE_INITIALS,
meta: {
description:
'One or two characters that are shown in the space avatar. By default, the initials are automatically generated from the space name.',
},
})
),
color: schema.maybe(
schema.string({
validate: (value) => {
@ -29,9 +48,20 @@ const spaceSchema = schema.object({
return `must be a 6 digit hex color, starting with a #`;
}
},
meta: {
description:
'The hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.',
},
})
),
disabledFeatures: schema.arrayOf(schema.string(), { defaultValue: [] }),
disabledFeatures: schema.arrayOf(
schema.string({
meta: {
description: 'The list of features that are turned off in the space.',
},
}),
{ defaultValue: [] }
),
_reserved: schema.maybe(schema.boolean()),
imageUrl: schema.maybe(
schema.string({
@ -40,6 +70,10 @@ const spaceSchema = schema.object({
return `must start with 'data:image'`;
}
},
meta: {
description:
'The data-URL encoded image to display in the space avatar. If specified, initials will not be displayed and the color will be visible as the background color for transparent images. For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.',
},
})
),
});

View file

@ -39,8 +39,10 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
path: '/api/spaces/_copy_saved_objects',
options: {
access: isServerless ? 'internal' : 'public',
tags: ['access:copySavedObjectsToSpaces'],
description: `Copy saved objects to spaces`,
tags: ['access:copySavedObjectsToSpaces', 'oas-tag:spaces'],
summary: `Copy saved objects between spaces`,
description:
'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.',
},
validate: {
body: schema.object(
@ -52,6 +54,10 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
return `lower case, a-z, 0-9, "_", and "-" are allowed`;
}
},
meta: {
description:
'The identifiers of the spaces where you want to copy the specified objects.',
},
}),
{
validate: (spaceIds) => {
@ -63,8 +69,12 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
),
objects: schema.arrayOf(
schema.object({
type: schema.string(),
id: schema.string(),
type: schema.string({
meta: { description: 'The type of the saved object to copy.' },
}),
id: schema.string({
meta: { description: 'The identifier of the saved object to copy.' },
}),
}),
{
validate: (objects) => {
@ -74,17 +84,40 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
},
}
),
includeReferences: schema.boolean({ defaultValue: false }),
overwrite: schema.boolean({ defaultValue: false }),
createNewCopies: schema.boolean({ defaultValue: true }),
compatibilityMode: schema.boolean({ defaultValue: false }),
includeReferences: schema.boolean({
defaultValue: false,
meta: {
description:
'When set to true, all saved objects related to the specified saved objects will also be copied into the target spaces.',
},
}),
overwrite: schema.boolean({
defaultValue: false,
meta: {
description:
'When set to true, all conflicts are automatically overridden. When a saved object with a matching type and identifier exists in the target space, that version is replaced with the version from the source space. This option cannot be used with the `createNewCopies` option.',
},
}),
createNewCopies: schema.boolean({
defaultValue: true,
meta: {
description:
'Create new copies of saved objects, regenerate each object identifier, and reset the origin. When used, potential conflict errors are avoided. This option cannot be used with the `overwrite` and `compatibilityMode` options.',
},
}),
compatibilityMode: schema.boolean({
defaultValue: false,
meta: {
description:
'Apply various adjustments to the saved objects that are being copied to maintain compatibility between different Kibana versions. Use this option only if you encounter issues with copied saved objects. This option cannot be used with the `createNewCopies` option.',
},
}),
},
{
validate: (object) => {
if (object.overwrite && object.createNewCopies) {
return 'cannot use [overwrite] with [createNewCopies]';
}
if (object.compatibilityMode && object.createNewCopies) {
return 'cannot use [compatibilityMode] with [createNewCopies]';
}
@ -158,13 +191,19 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
options: {
access: isServerless ? 'internal' : 'public',
tags: ['access:copySavedObjectsToSpaces'],
description: `Resolve conflicts copying saved objects`,
summary: `Resolve conflicts copying saved objects`,
description:
'Overwrite saved objects that are returned as errors from the copy saved objects to space API.',
},
validate: {
body: schema.object(
{
retries: schema.recordOf(
schema.string({
meta: {
description:
'The retry operations to attempt, which can specify how to resolve different types of errors. Object keys represent the target space identifiers.',
},
validate: (spaceId) => {
if (!SPACE_ID_REGEX.test(spaceId)) {
return `Invalid space id: ${spaceId}`;
@ -173,12 +212,38 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) {
}),
schema.arrayOf(
schema.object({
type: schema.string(),
id: schema.string(),
overwrite: schema.boolean({ defaultValue: false }),
destinationId: schema.maybe(schema.string()),
createNewCopy: schema.maybe(schema.boolean()),
ignoreMissingReferences: schema.maybe(schema.boolean()),
type: schema.string({ meta: { description: 'The saved object type.' } }),
id: schema.string({ meta: { description: 'The saved object identifier.' } }),
overwrite: schema.boolean({
defaultValue: false,
meta: {
description:
'When set to true, the saved object from the source space overwrites the conflicting object in the destination space.',
},
}),
destinationId: schema.maybe(
schema.string({
meta: {
description:
'Specifies the destination identifier that the copied object should have, if different from the current identifier.',
},
})
),
createNewCopy: schema.maybe(
schema.boolean({
meta: {
description:
'Creates new copies of the saved objects, regenerates each object ID, and resets the origin.',
},
})
),
ignoreMissingReferences: schema.maybe(
schema.boolean({
meta: {
description: 'When set to true, any missing references errors are ignored.',
},
})
),
})
)
),

View file

@ -22,7 +22,8 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) {
.delete({
path: '/api/spaces/space/{id}',
access: 'public',
description: `Delete a space`,
summary: `Delete a space`,
description: `When you delete a space, all saved objects that belong to the space are automatically deleted, which is permanent and cannot be undone.`,
options: {
tags: ['oas-tag:spaces'],
},
@ -33,9 +34,19 @@ export function initDeleteSpacesApi(deps: ExternalRouteDeps) {
validate: {
request: {
params: schema.object({
id: schema.string(),
id: schema.string({
meta: { description: 'The space identifier.' },
}),
}),
},
response: {
204: {
description: 'Indicates a successful call.',
},
404: {
description: 'Indicates that the request failed.',
},
},
},
},
createLicensedRouteHandler(async (context, request, response) => {

View file

@ -20,15 +20,25 @@ export function initDisableLegacyUrlAliasesApi(deps: ExternalRouteDeps) {
path: '/api/spaces/_disable_legacy_url_aliases',
options: {
access: isServerless ? 'internal' : 'public',
description: `Disable legacy URL aliases`,
summary: 'Disable legacy URL aliases',
tags: ['oas-tag:spaces'],
},
validate: {
body: schema.object({
aliases: schema.arrayOf(
schema.object({
targetSpace: schema.string(),
targetType: schema.string(),
sourceId: schema.string(),
targetSpace: schema.string({
meta: { description: 'The space where the alias target object exists.' },
}),
targetType: schema.string({
meta: { description: 'The type of alias target object. ' },
}),
sourceId: schema.string({
meta: {
description:
'The alias source object identifier. This is the legacy object identifier.',
},
}),
})
),
}),

View file

@ -20,7 +20,7 @@ export function initGetSpaceApi(deps: ExternalRouteDeps) {
.get({
path: '/api/spaces/space/{id}',
access: 'public',
description: `Get a space`,
summary: `Get a space`,
options: {
tags: ['oas-tag:spaces'],
},
@ -31,9 +31,14 @@ export function initGetSpaceApi(deps: ExternalRouteDeps) {
validate: {
request: {
params: schema.object({
id: schema.string(),
id: schema.string({ meta: { description: 'The space identifier.' } }),
}),
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
createLicensedRouteHandler(async (context, request, response) => {

View file

@ -19,7 +19,7 @@ export function initGetAllSpacesApi(deps: ExternalRouteDeps) {
.get({
path: '/api/spaces/space',
access: 'public',
description: `Get all spaces`,
summary: `Get all spaces`,
options: {
tags: ['oas-tag:spaces'],
},
@ -31,20 +31,39 @@ export function initGetAllSpacesApi(deps: ExternalRouteDeps) {
request: {
query: schema.object({
purpose: schema.maybe(
schema.oneOf([
schema.literal('any'),
schema.literal('copySavedObjectsIntoSpace'),
schema.literal('shareSavedObjectsIntoSpace'),
])
schema.oneOf(
[
schema.literal('any'),
schema.literal('copySavedObjectsIntoSpace'),
schema.literal('shareSavedObjectsIntoSpace'),
],
{
meta: {
description:
'Specifies which authorization checks are applied to the API call. The default value is `any`.',
},
}
)
),
include_authorized_purposes: schema.conditional(
schema.siblingRef('purpose'),
schema.string(),
schema.maybe(schema.literal(false)),
schema.maybe(schema.boolean())
schema.maybe(schema.boolean()),
{
meta: {
description:
'When enabled, the API returns any spaces that the user is authorized to access in any capacity and each space will contain the purposes for which the user is authorized. This can be useful to determine which spaces a user can read but not take a specific action in. If the security plugin is not enabled, this parameter has no effect, since no authorization checks take place. This parameter cannot be used in with the `purpose` parameter.',
},
}
),
}),
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
createLicensedRouteHandler(async (context, request, response) => {

View file

@ -19,7 +19,9 @@ export function initGetShareableReferencesApi(deps: ExternalRouteDeps) {
path: '/api/spaces/_get_shareable_references',
options: {
access: isServerless ? 'internal' : 'public',
description: `Get shareable references`,
summary: `Get shareable references`,
tags: ['oas-tag:spaces'],
description: 'Collect references and space contexts for saved objects.',
},
validate: {
body: schema.object({

View file

@ -22,7 +22,7 @@ export function initPostSpacesApi(deps: ExternalRouteDeps) {
.post({
path: '/api/spaces/space',
access: 'public',
description: `Create a space`,
summary: `Create a space`,
options: {
tags: ['oas-tag:spaces'],
},
@ -34,6 +34,11 @@ export function initPostSpacesApi(deps: ExternalRouteDeps) {
request: {
body: getSpaceSchema(isServerless),
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
createLicensedRouteHandler(async (context, request, response) => {

View file

@ -21,7 +21,7 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) {
.put({
path: '/api/spaces/space/{id}',
access: 'public',
description: `Update a space`,
summary: `Update a space`,
options: {
tags: ['oas-tag:spaces'],
},
@ -32,10 +32,20 @@ export function initPutSpacesApi(deps: ExternalRouteDeps) {
validate: {
request: {
params: schema.object({
id: schema.string(),
id: schema.string({
meta: {
description:
'The space identifier. You are unable to change the ID with the update operation.',
},
}),
}),
body: getSpaceSchema(isServerless),
},
response: {
200: {
description: 'Indicates a successful call.',
},
},
},
},
createLicensedRouteHandler(async (context, request, response) => {

View file

@ -18,6 +18,10 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) {
const spacesSchema = schema.arrayOf(
schema.string({
meta: {
description:
'The identifiers of the spaces the saved objects should be added to or removed from.',
},
validate: (value) => {
if (value !== ALL_SPACES_ID && !SPACE_ID_REGEX.test(value)) {
return `lower case, a-z, 0-9, "_", and "-" are allowed, OR "*"`;
@ -38,11 +42,22 @@ export function initUpdateObjectsSpacesApi(deps: ExternalRouteDeps) {
path: '/api/spaces/_update_objects_spaces',
options: {
access: isServerless ? 'internal' : 'public',
description: `Update saved objects in spaces`,
summary: `Update saved objects in spaces`,
tags: ['oas-tag:spaces'],
description: 'Update one or more saved objects to add or remove them from some spaces.',
},
validate: {
body: schema.object({
objects: schema.arrayOf(schema.object({ type: schema.string(), id: schema.string() })),
objects: schema.arrayOf(
schema.object({
type: schema.string({
meta: { description: 'The type of the saved object to update.' },
}),
id: schema.string({
meta: { description: 'The identifier of the saved object to update.' },
}),
})
),
spacesToAdd: spacesSchema,
spacesToRemove: spacesSchema,
}),