Skip to content

Commit

Permalink
Add headers to the sample curl (#63548) (#63861)
Browse files Browse the repository at this point in the history
* Add headers to the sample curl

At least in 7.x it doesn't work without the kbn-xsrf and json headers.

* More headers to curl commands

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Radu Gheorghe <radu.gheorghe@sematext.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 17, 2020
1 parent f2c0e69 commit 3fc33a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/api/saved-objects/create.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ any data that you send to the API is properly formed.

[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern"
$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"attributes": {
"title": "my-pattern-*"
}
}
}'
--------------------------------------------------
// KIBANA

Expand Down
16 changes: 8 additions & 8 deletions docs/api/saved-objects/export.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,46 +68,46 @@ Export all index pattern saved objects:

[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern"
}
}'
--------------------------------------------------
// KIBANA

Export all index pattern saved objects and exclude the export summary from the stream:

[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern",
"excludeExportDetails": true
}
}'
--------------------------------------------------
// KIBANA

Export a specific saved object:

[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
"type": "dashboard",
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
}
]
}
}'
--------------------------------------------------
// KIBANA

Export a specific saved object and it's related objects :

[source,sh]
--------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export"
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
Expand All @@ -116,6 +116,6 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
}
],
"includeReferencesDeep": true
}
}'
--------------------------------------------------
// KIBANA

0 comments on commit 3fc33a3

Please sign in to comment.