Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions docs/api/saved-objects/import.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ The following example imports an index pattern and dashboard.

[source,js]
--------------------------------------------------
POST api/saved_objects/_import
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson
--------------------------------------------------

The `file.ndjson` file would contain the following.

[source,js]
--------------------------------------------------
{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}
--EXAMPLE--
--------------------------------------------------
// KIBANA

A successful call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand All @@ -62,17 +61,16 @@ The following example imports an index pattern and dashboard but has a conflict

[source,js]
--------------------------------------------------
POST api/saved_objects/_import
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson
--------------------------------------------------

The `file.ndjson` file would contain the following.

[source,js]
--------------------------------------------------
{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}
--EXAMPLE--
--------------------------------------------------
// KIBANA

The call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand All @@ -99,17 +97,16 @@ The following example imports a visualization and dashboard but the index patter

[source,js]
--------------------------------------------------
POST api/saved_objects/_import
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson
--------------------------------------------------

The `file.ndjson` file would contain the following.

[source,js]
--------------------------------------------------
{"type":"visualization","id":"my-vis","attributes":{"title":"my-vis"},"references":[{"name":"ref_0","type":"index-pattern","id":"my-pattern-*"}]}
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"},"references":[{"name":"ref_0","type":"visualization","id":"my-vis"}]}
--EXAMPLE--
--------------------------------------------------
// KIBANA

The call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand Down
51 changes: 18 additions & 33 deletions docs/api/saved-objects/resolve_import_errors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,15 @@ The following example retries importing a dashboard.

[source,js]
--------------------------------------------------
POST api/saved_objects/_resolve_import_errors
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard"}]'
--------------------------------------------------

{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}
--EXAMPLE
Content-Disposition: form-data; name="retries"
The `file.ndjson` file would contain the following.

[{"type":"dashboard","id":"my-dashboard"}]
--EXAMPLE--
[source,js]
--------------------------------------------------
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}
--------------------------------------------------
// KIBANA

A successful call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand All @@ -63,21 +58,16 @@ The following example resolves errors for a dashboard. This will cause the dashb

[source,js]
--------------------------------------------------
POST api/saved_objects/_resolve_import_errors
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard","overwrite":true}]'
--------------------------------------------------

The `file.ndjson` file would contain the following.

[source,js]
--------------------------------------------------
{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"}}
--EXAMPLE
Content-Disposition: form-data; name="retries"

[{"type":"dashboard","id":"my-dashboard","overwrite":true}]
--EXAMPLE--
--------------------------------------------------
// KIBANA

A successful call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand All @@ -94,20 +84,15 @@ The following example resolves errors for a visualization by replacing the index

[source,js]
--------------------------------------------------
POST api/saved_objects/_resolve_import_errors
Content-Type: multipart/form-data; boundary=EXAMPLE
--EXAMPLE
Content-Disposition: form-data; name="file"; filename="export.ndjson"
Content-Type: application/ndjson
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"missing","to":"existing"}]}]'
--------------------------------------------------

{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"missing"}]}
--EXAMPLE
Content-Disposition: form-data; name="retries"
The `file.ndjson` file would contain the following.

[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"missing","to":"existing"}]}]
--EXAMPLE--
[source,js]
--------------------------------------------------
{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"missing"}]}
--------------------------------------------------
// KIBANA

A successful call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
Expand Down