mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
65 lines
1.5 KiB
Text
65 lines
1.5 KiB
Text
[[data-views-api-default-get]]
|
|
=== Get default data view API
|
|
++++
|
|
<titleabbrev>Get default data view</titleabbrev>
|
|
++++
|
|
|
|
experimental[] Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one.
|
|
|
|
[NOTE]
|
|
====
|
|
For the most up-to-date API details, refer to the
|
|
{kib-repo}/tree/{branch}/src/plugins/data_views/docs/openapi[open API specification].
|
|
====
|
|
|
|
[[data-views-api-default-get-request]]
|
|
==== Request
|
|
|
|
`GET <kibana host>:<port>/api/data_views/default`
|
|
|
|
`GET <kibana host>:<port>/s/<space_id>/api/data_views/default`
|
|
|
|
|
|
[[data-views-api-default-get-params]]
|
|
==== Path parameters
|
|
|
|
`space_id`::
|
|
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
|
|
|
|
|
|
[[data-views-api-default-get-codes]]
|
|
==== Response code
|
|
|
|
`200`::
|
|
Indicates a successful call.
|
|
|
|
|
|
[[data-views-api-default-get-example]]
|
|
==== Example
|
|
|
|
Retrieve the default data view id:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
$ curl -X GET api/data_views/default
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
The API returns an ID of a default data view:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
{
|
|
"data_view_id": "..."
|
|
}
|
|
--------------------------------------------------
|
|
|
|
In case there is no default data view, the API returns:
|
|
|
|
[source,sh]
|
|
--------------------------------------------------
|
|
{
|
|
"data_view_id": null
|
|
}
|
|
--------------------------------------------------
|
|
|