Adds get all REST API to data views (#131683)

* Adds get all API to data views

* Move size to query params

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Use ids/titles instead of entire object

* Add docs

* Add integration test

* Fix docs

* Update docs

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Lukas Olson 2022-06-02 10:00:19 -07:00 committed by GitHub
parent b17bbdcb90
commit e921693c50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 208 additions and 2 deletions

View file

@ -11,6 +11,7 @@ WARNING: Use the data views APIs for managing data views instead of lower-level
The following data views APIs are available:
* Data views
** <<data-views-api-get-all, Get all data views API>> to retrieve a list of data views
** <<data-views-api-get, Get data view API>> to retrieve a single data view
** <<data-views-api-create, Create data view API>> to create data view
** <<data-views-api-update, Update data view API>> to partially updated data view
@ -27,6 +28,7 @@ The following data views APIs are available:
** <<data-views-runtime-field-api-update, Update runtime field API>> to partially update an existing runtime field
** <<data-views-runtime-field-api-delete, Delete runtime field API>> to delete a runtime field
include::data-views/get-all.asciidoc[]
include::data-views/get.asciidoc[]
include::data-views/create.asciidoc[]
include::data-views/update.asciidoc[]

View file

@ -0,0 +1,60 @@
[[data-views-api-get-all]]
=== Get all data views API
++++
<titleabbrev>Get all data views</titleabbrev>
++++
experimental[] Retrieve a list of all data views.
[[data-views-api-get-all-request]]
==== Request
`GET <kibana host>:<port>/api/data_views`
`GET <kibana host>:<port>/s/<space_id>/api/data_views`
[[data-views-api-get-all-codes]]
==== Response code
`200`::
Indicates a successful call.
[[data-views-api-get-all-example]]
==== Example
Retrieve the list of data views:
[source,sh]
--------------------------------------------------
$ curl -X GET api/data_views
--------------------------------------------------
// KIBANA
The API returns a list of data views:
[source,sh]
--------------------------------------------------
{
"data_view": [
{
"id": "e9e024f0-d098-11ec-bbe9-c753adcb34bc",
"namespaces": [
"default"
],
"title": "tmp*",
"type": "rollup",
"typeMeta": {}
},
{
"id": "90943e30-9a47-11e8-b64d-95841ca0b247",
"namespaces": [
"default"
],
"title": "kibana_sample_data_logs"
}
]
}
--------------------------------------------------