mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* Adds documentation for Saved Objects API Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> * [DOCS] Moved Rest APIs in navigation * docs: revise rest api intro * docs: revise create object api details * docs: revise saved object api intro * docs: revise delete saved object api details * docs: remove newline character from api response * docs: get saved object api details * docs: update saved object api details * docs: fix title attribute in saved object api examples * docs: bulk-get saved object api details * docs: find saved object api details * docs: add index-pattern to valid types in api * docs: clarify sending multiple values in api * docs: note that savedObjects.find is not safe for export
73 lines
1.8 KiB
Text
73 lines
1.8 KiB
Text
[[saved-objects-api-create]]
|
|
=== Create Object
|
|
|
|
experimental[This functionality is *experimental* and may be changed or removed completely in a future release.]
|
|
|
|
The create saved object API enables you to persist a Kibana saved object.
|
|
|
|
==== Request
|
|
|
|
`POST /api/saved_objects/<type>` +
|
|
|
|
`POST /api/saved_objects/<type>/<id>`
|
|
|
|
==== Path Parameters
|
|
|
|
`type` (required)::
|
|
(string) Valid options, include: `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`
|
|
|
|
`id` (optional)::
|
|
(string) Enables specifying an ID to use, as opposed to one being randomly generated
|
|
|
|
|
|
==== Query Parameters
|
|
|
|
`overwrite` (optional)::
|
|
(boolean) If true, will overwrite the document with the same ID.
|
|
|
|
|
|
==== Request Body
|
|
|
|
`attributes` (required)::
|
|
(object) The data to persist
|
|
|
|
|
|
==== Examples
|
|
|
|
The following example creates an index pattern object with a pattern of
|
|
`my-pattern-*`.
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST api/saved_objects/index-pattern/my-pattern
|
|
{
|
|
"attributes": {
|
|
"title": "my-pattern-*"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
A successful call returns a response code of `200` and a response body
|
|
containing a JSON structure similar to the following example:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"id": "my-pattern", <1>
|
|
"type": "index-pattern",
|
|
"version": 1,
|
|
"attributes": {
|
|
"title": "my-pattern-*"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
|
|
<1> If `my-pattern` was not specified in the path, a unique ID would have been
|
|
generated.
|
|
|
|
==== Known issues
|
|
|
|
1. *Attributes are not validated at creation time*. This means you can pass
|
|
arbitrary and ill-formed data into this API that can break Kibana. Make sure
|
|
any data you send to this API is properly formed.
|