* 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>
This commit is contained in:
parent
f2c0e69dbc
commit
3fc33a3e8e
|
@ -59,12 +59,12 @@ any data that you send to the API is properly formed.
|
||||||
|
|
||||||
[source,sh]
|
[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": {
|
"attributes": {
|
||||||
"title": "my-pattern-*"
|
"title": "my-pattern-*"
|
||||||
}
|
}
|
||||||
}
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// KIBANA
|
// KIBANA
|
||||||
|
|
||||||
|
|
|
@ -68,10 +68,10 @@ Export all index pattern saved objects:
|
||||||
|
|
||||||
[source,sh]
|
[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"
|
"type": "index-pattern"
|
||||||
}
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// KIBANA
|
// KIBANA
|
||||||
|
|
||||||
|
@ -79,11 +79,11 @@ Export all index pattern saved objects and exclude the export summary from the s
|
||||||
|
|
||||||
[source,sh]
|
[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",
|
"type": "index-pattern",
|
||||||
"excludeExportDetails": true
|
"excludeExportDetails": true
|
||||||
}
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// KIBANA
|
// KIBANA
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Export a specific saved object:
|
||||||
|
|
||||||
[source,sh]
|
[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": [
|
"objects": [
|
||||||
{
|
{
|
||||||
|
@ -99,7 +99,7 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
|
||||||
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
|
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// KIBANA
|
// KIBANA
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ Export a specific saved object and it's related objects :
|
||||||
|
|
||||||
[source,sh]
|
[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": [
|
"objects": [
|
||||||
{
|
{
|
||||||
|
@ -116,6 +116,6 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"includeReferencesDeep": true
|
"includeReferencesDeep": true
|
||||||
}
|
}'
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
// KIBANA
|
// KIBANA
|
||||||
|
|
Loading…
Reference in a new issue