Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/api/spaces-management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ The following {kib} spaces APIs are available:

* <<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
Comment thread
jportner marked this conversation as resolved.
Outdated

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[]
59 changes: 59 additions & 0 deletions docs/api/spaces-management/disable_legacy_url_aliases.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[[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]]
==== Request

`POST <kibana host>:<port>/api/spaces/_disable_legacy_url_aliases`

[[spaces-api-disable-legacy-url-aliases-request-body]]
==== Request body

`aliases`::
(Required, object array) The aliases to disable.
+
.Properties of `aliases`
[%collapsible%open]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about formatting with a box as in this doc .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is making that one show in boxes but this one isn't. Perhaps the sub-properties end in ::: instead of ::? It doesn't make a difference in my IDE previewer, but I'll make the change and see if it changes how it's rendered in the docs website.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't spend too much time on this. The formatting also works find as it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried one more thing and it's fixed now 😄
Needed to add [role="child_attributes"] before the section.

=====
`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]]
==== Response codes

`204`::
Indicates a successful call.

[[spaces-api-disable-legacy-url-aliases-example]]
==== Example

[source,sh]
--------------------------------------------------
$ curl -X POST api/spaces/_disable_legacy_url_aliases
{
"aliases": [
{
"targetSpace": "bills-space",
"targetType": "dashboard",
"sourceId": "123"
}
]
}
--------------------------------------------------
// KIBANA

This will leave the alias intact, but the legacy URL for this alias will no longer function. In this example, you had a legacy URL for
Comment thread
jportner marked this conversation as resolved.
Outdated
`http://localhost:5601/s/bills-space/app/dashboards#/view/123`. That URL would no longer work after making this API call, but the dashboard
itself still exists and can be accessed by its new URL.
5 changes: 4 additions & 1 deletion docs/developer/advanced/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* <<development-basepath>>
* <<upgrading-nodejs>>
* <<sharing-saved-objects>>
* <<legacy-url-aliases>>

include::development-es-snapshots.asciidoc[leveloffset=+1]

Expand All @@ -15,4 +16,6 @@ include::development-basepath.asciidoc[leveloffset=+1]

include::upgrading-nodejs.asciidoc[leveloffset=+1]

include::sharing-saved-objects.asciidoc[leveloffset=+1]
include::sharing-saved-objects.asciidoc[leveloffset=+1]

include::legacy-url-aliases.asciidoc[leveloffset=+1]
45 changes: 45 additions & 0 deletions docs/developer/advanced/legacy-url-aliases.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[[legacy-url-aliases]]
== Legacy URL Aliases

This page describes legacy URL aliases: what they are, where they come from, and how to disable them.

[[legacy-url-aliases-overview]]
=== Overview

Many saved object types are being converted in the 8.0 release of {kib} so they can eventually be shared across <<xpack-spaces,spaces>>.
Before 8.0, you could have two objects with the same type and same ID in two different spaces. Part of this conversion is to make sure all
object IDs of a given type are *globally unique across all spaces*.
Comment thread
jportner marked this conversation as resolved.
Outdated

When a saved object is converted, if its ID is changed, {kib} creates a special entity called a _legacy URL alias_. This allows us to
preserve any deep link URLs that may exist for that object.
Comment thread
jportner marked this conversation as resolved.
Outdated

[[legacy-url-aliases-example]]
=== Example

For example, consider the following scenario:
Comment thread
jportner marked this conversation as resolved.
Outdated

You have {kib} 7.16 installed and you created a new dashboard. This dashboard's ID is "123". Then, you create a new space called "Bill's space", and copy your dashboard to the other space. Now you have two different dashboards that can be accessed at the following URLs:
Comment thread
jportner marked this conversation as resolved.
Outdated

* *Default space*: `http://localhost:5601/app/dashboards#/view/123`
* *Bill's space*: `http://localhost:5601/s/bills-space/app/dashboards#/view/123`

You use these two dashboards frequently, so you use your web browser to add bookmarks for them. After some time, you decide upgrade to {kib}
Comment thread
jportner marked this conversation as resolved.
Outdated
8.0. When these two dashboards go through the conversion process, the one in "Bill's space" will have its ID changed to "456". Now, the URL
Comment thread
jportner marked this conversation as resolved.
Outdated
to access that dashboard is different -- not to worry though, there is a legacy URL alias for that dashboard!
Comment thread
jportner marked this conversation as resolved.
Outdated

If you use your bookmark to access that dashboard using its old URL, {kib} detects that you are using a legacy URL and it finds the new
Comment thread
jportner marked this conversation as resolved.
Outdated
object ID. This means if you navigate to `http://localhost:5601/s/bills-space/app/dashboards#/view/123`, you'll see a helpful toast message
Comment thread
jportner marked this conversation as resolved.
Outdated
indicating that the dashboard has a new URL, and you'll automatically get redirected to
`http://localhost:5601/s/bills-space/app/dashboards#/view/456`.

[[legacy-url-aliases-handling-errors]]
=== Handling errors

Legacy URL aliases are intended to be fully transparent, but there are some very rare situations where this can lead to an error. For
Comment thread
jportner marked this conversation as resolved.
Outdated
example, you may have a dashboard and one of the visualizations may fail to load, directing you to this page. If you encounter an error
Comment thread
jportner marked this conversation as resolved.
Outdated
in this situation, you might want to disable the legacy URL alias completely. This leaves the saved object intact and you will not lose any

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This explains the symptom of the error, but not what caused the error. Do you think it would be helpful to give an example of that causes these types of errors, or would that be TMI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid that an example of the causes would be a bit too much. You can't get into that situation through "normal" usage of Kibana (simply by virtue of upgrading to 8.0, or by sharing objects, or by importing objects) -- we believe the only way to get into this situation is by using third-party integrations.

I did toy with the idea of showing a screenshot of an error that you might see as an example, but that's not been implemented yet. Also interested to hear what the Docs team thinks about this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the text is good as it is, especially since the only way to get into the situation is by using third-party integrations. I don't feel a screenshot is necessary.

Comment thread
jportner marked this conversation as resolved.
Outdated
data by disabling the alias -- you just won't be able to use the old URL to access that saved object anymore.
Comment thread
jportner marked this conversation as resolved.
Outdated

To disable a legacy URL alias, you'll need three pieces of information about it: the `targetSpace`, the `targetType`, and the `sourceId`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to describe exactly what these terms are. They'll likely be foreign concepts to the users who end up on this page.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was a bit torn on that. I do explain them on the linked API page, I thought it may be best if we don't state the same thing on two different pages. I'm interested to see what the Docs team thinks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gchaps based on your comments below, it sounds like you think this is clear enough with your suggested changes?

Comment thread
jportner marked this conversation as resolved.
Outdated
Once you have this information, you can use the <<spaces-api-disable-legacy-url-aliases,`_disable_legacy_url_aliases`>> API to disable the
Comment thread
jportner marked this conversation as resolved.
Outdated
problematic legacy URL alias.