kibana/docs/api/saved-objects/update.asciidoc
Brandon Kobel 769bb657fa
Moving Saved Object APIs from Experimental to Beta (#44140)
* Saved Object APIs, now beta!

* Using Gail's word-choice, thanks Gail!!!
2019-08-28 06:58:12 -07:00

67 lines
2.1 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[[saved-objects-api-update]]
=== Update Object
beta[This functionality is *beta*. It's on track to become a stable, permanent feature of {kib}. Caution should be exercised because it is possible a breaking change to these APIs will occur in a minor version, but well avoid this wherever possible. ]
The update saved object API enables you to update the attributes for an
existing Kibana saved object.
Note: You cannot access this endpoint via the Console in Kibana.
==== Request
`PUT /api/saved_objects/<type>/<id>`
==== Path Parameters
`type` (required)::
(string) Valid options, include: `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`
`id` (required)::
(string) ID of object to update
==== Request Body
`attributes` (required)::
(object) The data to persist
`references` (optional)::
(array) An array of objects with `name`, `id`, and `type` properties that describe the other saved objects this object references. The `name` can be used in the attributes to refer to the other saved object, but never the `id`, which may be updated automatically in the future during migrations or import/export.
==== Examples
The following example updates an existing index pattern object identified as
`my-pattern` with a different index pattern title.
[source,js]
--------------------------------------------------
PUT api/saved_objects/index-pattern/my-pattern
{
"attributes": {
"title": "some-other-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",
"type": "index-pattern",
"version": 2,
"attributes": {
"title": "some-other-pattern-*"
}
}
--------------------------------------------------
==== Known issues
1. *Attributes are not validated at update 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.