kibana/docs/api/index-patterns/get.asciidoc
Anton Dosov edc5251433
[Index Patterns] Runtime fields CRUD REST API (#101164)
Part of index pattern REST API
2021-06-09 09:00:39 -04:00

65 lines
1.5 KiB
Text

[[index-patterns-api-get]]
=== Get index pattern API
++++
<titleabbrev>Get index pattern</titleabbrev>
++++
experimental[] Retrieve a single {kib} index pattern by ID.
[[index-patterns-api-get-request]]
==== Request
`GET <kibana host>:<port>/api/index_patterns/index_pattern/<id>`
`GET <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern/<id>`
[[index-patterns-api-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.
`id`::
(Required, string) The ID of the index pattern you want to retrieve.
[[index-patterns-api-get-codes]]
==== Response code
`200`::
Indicates a successful call.
`404`::
The specified index pattern and ID doesn't exist.
[[index-patterns-api-get-example]]
==== Example
Retrieve the index pattern object with the `my-pattern` ID:
[source,sh]
--------------------------------------------------
$ curl -X GET api/index_patterns/index_pattern/my-pattern
--------------------------------------------------
// KIBANA
The API returns an index pattern object:
[source,sh]
--------------------------------------------------
{
"index_pattern": {
"id": "my-pattern",
"version": "...",
"title": "...",
"type": "...",
"timeFieldName": "...",
"sourceFilters": [],
"fields": {},
"typeMeta": {},
"fieldFormats": {},
"fieldAttrs": {},
"runtimeFieldMap" {},
"allowNoIndex: "..."
}
}
--------------------------------------------------