-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial client-side support for sharing saved-objects phase 1.5 (#69399)
- Loading branch information
Showing
168 changed files
with
6,881 additions
and
1,864 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,8 @@ The request body must include the multipart/form-data type. | |
(Optional, string) Specifies which destination ID the imported object should have (if different from the current ID). | ||
`replaceReferences`::: | ||
(Optional, array) A list of `type`, `from`, and `to` used to change the object references. | ||
`ignoreMissingReferences`::: | ||
(Optional, boolean) When set to `true`, any missing references errors are ignored. When set to `false`, this does nothing. | ||
===== | ||
|
||
[[saved-objects-api-resolve-import-errors-response-body]] | ||
|
@@ -73,6 +75,9 @@ The request body must include the multipart/form-data type. | |
|
||
`errors`:: | ||
(Optional, array) Specifies the objects that failed to resolve. | ||
+ | ||
NOTE: One object may result in multiple errors which require separate steps to resolve (for instance, a `missing_references` error and a | ||
`conflict` error). | ||
|
||
`successResults`:: | ||
(Optional, array) Indicates the objects that were imported successfully, with any metadata if applicable. | ||
|
@@ -122,21 +127,37 @@ The API returns the following: | |
"successResults": [ | ||
{ | ||
"id": "my-pattern", | ||
"type": "index-pattern" | ||
"type": "index-pattern", | ||
"meta": { | ||
"icon": "indexPatternApp", | ||
"title": "my-pattern-*" | ||
} | ||
}, | ||
{ | ||
"id": "my-vis", | ||
"type": "visualization", | ||
"destinationId": "another-vis" | ||
"destinationId": "another-vis", | ||
"meta": { | ||
"icon": "visualizeApp", | ||
"title": "Look at my visualization" | ||
} | ||
}, | ||
{ | ||
"id": "my-canvas", | ||
"type": "canvas-workpad", | ||
"destinationId": "yet-another-canvas" | ||
"destinationId": "yet-another-canvas", | ||
"meta": { | ||
"icon": "canvasApp", | ||
"title": "Look at my canvas" | ||
} | ||
}, | ||
{ | ||
"id": "my-dashboard", | ||
"type": "dashboard" | ||
"type": "dashboard", | ||
"meta": { | ||
"icon": "dashboardApp", | ||
"title": "Look at my dashboard" | ||
} | ||
} | ||
] | ||
} | ||
|
@@ -152,11 +173,12 @@ that were returned in the `successResults` array. In this example, we retried im | |
|
||
This example builds upon the <<saved-objects-api-import-example-4,Import objects API example with missing reference errors>>. | ||
|
||
Resolve a missing reference error for a visualization by replacing the index pattern with another: | ||
Resolve a missing reference error for a visualization by replacing the index pattern with another, and resolve a missing reference error for | ||
a search by ignoring it: | ||
|
||
[source,sh] | ||
-------------------------------------------------- | ||
$ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form [email protected] --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"my-pattern-*","to":"existing-pattern"}]},{"type":"dashboard","id":"my-dashboard"}]' | ||
$ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form [email protected] --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"my-pattern-*","to":"existing-pattern"}]},{"type":"search","id":"my-search","ignoreMissingReferences":true},{"type":"dashboard","id":"my-dashboard"}]' | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
|
@@ -165,6 +187,7 @@ The `file.ndjson` file contains the following: | |
[source,sh] | ||
-------------------------------------------------- | ||
{"type":"visualization","id":"my-vis","attributes":{"title":"Look at my visualization"},"references":[{"name":"ref_0","type":"index-pattern","id":"my-pattern-*"}]} | ||
{"type":"search","id":"my-search","attributes":{"title":"Look at my search"},"references":[{"name":"ref_0","type":"index-pattern","id":"another-pattern-*"}]} | ||
{"type":"dashboard","id":"my-dashboard","attributes":{"title":"Look at my dashboard"},"references":[{"name":"ref_0","type":"visualization","id":"my-vis"}]} | ||
-------------------------------------------------- | ||
|
||
|
@@ -174,21 +197,37 @@ The API returns the following: | |
-------------------------------------------------- | ||
{ | ||
"success": true, | ||
"successCount": 2, | ||
"successCount": 3, | ||
"successResults": [ | ||
{ | ||
"id": "my-pattern", | ||
"type": "index-pattern" | ||
"id": "my-vis", | ||
"type": "visualization", | ||
"meta": { | ||
"icon": "visualizeApp", | ||
"title": "Look at my visualization" | ||
} | ||
}, | ||
{ | ||
"id": "my-search", | ||
"type": "search", | ||
"meta": { | ||
"icon": "searchApp", | ||
"title": "Look at my search" | ||
} | ||
}, | ||
{ | ||
"id": "my-dashboard", | ||
"type": "dashboard" | ||
"type": "dashboard", | ||
"meta": { | ||
"icon": "dashboardApp", | ||
"title": "Look at my dashboard" | ||
} | ||
} | ||
] | ||
} | ||
-------------------------------------------------- | ||
|
||
This result indicates that the import was successful, and both objects were created. | ||
This result indicates that the import was successful, and all three objects were created. | ||
|
||
TIP: If a prior import attempt resulted in resolvable errors, you must include a retry for each object you want to import, including any | ||
that were described in the missing error object's `blocked` array. In this example, we retried importing the dashboard accordingly. | ||
that were returned in the `successResults` array. In this example, we retried importing the dashboard accordingly. |
Oops, something went wrong.