mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [DOCS] API intro * Logstash configuration management * Reformatting * Comments from Josh * Commets from Gail * Fixed broken things
113 lines
2.8 KiB
Text
113 lines
2.8 KiB
Text
[[saved-objects-api-export]]
|
|
=== Export objects API
|
|
++++
|
|
<titleabbrev>Export objects</titleabbrev>
|
|
++++
|
|
|
|
experimental[] Retrieve sets of saved objects that you want to import into {kib}.
|
|
|
|
[[saved-objects-api-export-request]]
|
|
==== Request
|
|
|
|
`POST /api/saved_objects/_export`
|
|
|
|
[[saved-objects-api-export-request-request-body]]
|
|
==== Request body
|
|
|
|
`type`::
|
|
(Optional, array|string) The saved object types to include in the export.
|
|
|
|
`objects`::
|
|
(Optional, array) A list of objects to export.
|
|
|
|
`includeReferencesDeep`::
|
|
(Optional, boolean) Includes all of the referenced objects in the exported objects.
|
|
|
|
`excludeExportDetails`::
|
|
(Optional, boolean) Do not add export details entry at the end of the stream.
|
|
|
|
TIP: You must include `type` or `objects` in the request body.
|
|
|
|
[[saved-objects-api-export-request-response-body]]
|
|
==== Response body
|
|
|
|
The format of the response body is newline delimited JSON. Each exported object is exported as a valid JSON record and separated by the newline character '\n'.
|
|
|
|
When `excludeExportDetails=false` (the default) we append an export result details record at the end of the file after all the saved object records. The export result details object has the following format:
|
|
|
|
[source,json]
|
|
--------------------------------------------------
|
|
{
|
|
"exportedCount": 27,
|
|
"missingRefCount": 2,
|
|
"missingReferences": [
|
|
{ "id": "an-id", "type": "visualisation"},
|
|
{ "id": "another-id", "type": "index-pattern"}
|
|
]
|
|
}
|
|
--------------------------------------------------
|
|
|
|
[[export-objects-api-create-request-codes]]
|
|
==== Response code
|
|
|
|
`200`::
|
|
Indicates a successful call.
|
|
|
|
[[ssaved-objects-api-create-example]]
|
|
==== Examples
|
|
|
|
Export all index pattern saved objects:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST api/saved_objects/_export
|
|
{
|
|
"type": "index-pattern"
|
|
}
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
Export all index pattern saved objects and exclude the export summary from the stream:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST api/saved_objects/_export
|
|
{
|
|
"type": "index-pattern",
|
|
"excludeExportDetails": true
|
|
}
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
Export a specific saved object:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST api/saved_objects/_export
|
|
{
|
|
"objects": [
|
|
{
|
|
"type": "dashboard",
|
|
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
|
|
}
|
|
]
|
|
}
|
|
--------------------------------------------------
|
|
// KIBANA
|
|
|
|
Export a specific saved object and it's related objects :
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
POST api/saved_objects/_export
|
|
{
|
|
"objects": [
|
|
{
|
|
"type": "dashboard",
|
|
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
|
|
}
|
|
],
|
|
"includeReferencesDeep": true
|
|
}
|
|
--------------------------------------------------
|
|
// KIBANA
|