Closed jnschbrt closed 10 months ago
This looks worth fixing. Feel free to submit a PR.
now that the merge request for this issue is already merged into the main. can we expect a new tag or release soon? :)
@VachaShah would you be willing to do a release?
We have a release planned for today for 1.2.0.
We have the release process in progress but figuring out some issues along the way. Build release issue: https://github.com/opensearch-project/opensearch-build/issues/4185
Version 1.2.0 is released: https://github.com/opensearch-project/opensearch-cli/releases/tag/v1.2.0
What is the bug? My goal is to use opensearch-cli to import the
/_dashboards/api/saved_objects/_import
REST API However, the API expects the POST request with content-type: multipart/form-dataSee: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/d7004dc5b0392477fdd54ac66b29d231975a173b/src/core/server/saved_objects/routes/import.ts
The Opensearch CLI only offers the possibility to specify a file with the --data flag. Native CURL commands offer the possibility to specify the file via --data-binary flag.
The CURL POST command generated by the Opensearch CLI cannot automatically set the multipart boundary, so the post command fails as follows:
I use the authenticated curl post command here as follows:
Without providing headers
opensearch-cli curl post --profile local --path "/_dashboards/api/saved_objects/_import" --data @export.ndjson
Error:Providing multipart-form-data header
opensearch-cli curl post --profile local --path "/_dashboards/api/saved_objects/_import" -H "content-type:multipart/form-data;" --data @export.ndjson
Error:Providing multipart-form-data header and any random boundary
opensearch-cli curl post --profile local --path "/_dashboards/api/saved_objects/_import" -H "content-type:multipart/form-data; boundary:something;" --data @export.ndjson
Error:How can one reproduce the bug? Steps to reproduce the behavior:
What is your host/environment?