elastic / docs-content

Elastic Documentation Content
Other
0 stars 17 forks source link

[Feedback]: #56

Open yomduf opened 1 month ago

yomduf commented 1 month ago

Was the documentation helpful?

Yes

What documentation page is affected

There is some error in the page => https://www.elastic.co/docs/api/doc/kibana/v8/operation/operation-importsavedobjectsdefault Image

Description

The curl command should indicate that the destination space of the saved object import can be customized like this

/s/<space name/leave empty for default>/api/saved_objects/

And the curl command have an invalid parameter

  --form file=@file.ndjson

where it should be

-F file=@"$ndjson_file"

ES_FEEDBACK_ID: uFoFdJIBWCMSeP1oFoEF

lcawl commented 1 month ago

With respect to the /s/ variation of the path, it's true that is not included in the automated OpenAPI documents. Rather than requiring that duplication of every path, we added this introductory content: https://www.elastic.co/docs/api/doc/kibana/v8/topic/topic-kibana-spaces

Does that contain the content you're seeking?

lcawl commented 1 month ago

With respect to the example, I tested just now with both the "-F" and "--form" variations with and without quotation marks and they all worked for me. Can you please provide more information about the failing scenario? Thanks!

For example, these all worked for me:

> curl -X POST "https://localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file="@/mytest/export-test.ndjson" -H 'kbn-xsrf: true' --cacert ca.crt -u elastic

{"successCount":0,"success":false,"warnings":[],"errors":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","meta":{"title":"kibana_sample_data_logs","icon":"indexPatternApp"},"error":{"type":"conflict"}},{"type":"visualization","id":"06cf9c40-9ee8-11e7-8711-e7a007dcef99","meta":{"title":"[Logs] Visitors Map","icon":"visualizeApp"},"error":{"type":"conflict"}}]}

> curl -X POST "https://localhost:5601/api/saved_objects/_import?createNewCopies=true" -H "kbn-xsrf: true" --form file=@/mytest/export-test.ndjson --cacert ca.crt -u elastic

{"successCount":2,"success":true,"warnings":[],"successResults":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","meta":{"title":"Kibana Sample Data Logs","icon":"indexPatternApp"},"managed":false,"destinationId":"1216d11f-0095-401f-8103-1dc60cc2fde0"},{"type":"visualization","id":"06cf9c40-9ee8-11e7-8711-e7a007dcef99","meta":{"title":"[Logs] Visitors Map","icon":"visualizeApp"},"managed":false,"destinationId":"d929cc5c-6a71-4663-bab3-ddd9de67a5e7"}]}

> curl -X POST "https://localhost:5601/api/saved_objects/_import?createNewCopies=true" -H "kbn-xsrf: true" -F file=@/mytest/export-test.ndjson -H 'kbn-xsrf: true' --cacert ca.crt -u elastic

{"successCount":2,"success":true,"warnings":[],"successResults":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","meta":{"title":"Kibana Sample Data Logs","icon":"indexPatternApp"},"managed":false,"destinationId":"a0444cfa-66f0-4dc3-9e1e-ed7e09dfb04b"},{"type":"visualization","id":"06cf9c40-9ee8-11e7-8711-e7a007dcef99",