[DOCS] Fixes to API docs (#71678)

* [DOCS] Fixes to API docs

* Fixes rogue -u
This commit is contained in:
Kaarina Tungseth 2020-07-14 14:59:21 -05:00 committed by GitHub
parent fd1809c3c2
commit 0b675b8908
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 51 additions and 43 deletions

View file

@ -35,7 +35,7 @@ experimental[] Export dashboards and corresponding saved objects.
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X GET "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c" <1> $ curl -X GET api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c <1>
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -42,7 +42,7 @@ Use the complete response body from the <<dashboard-api-export, Export dashboard
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/kibana/dashboards/import?exclude=index-pattern" $ curl -X POST api/kibana/dashboards/import?exclude=index-pattern
{ {
"objects": [ "objects": [
{ {

View file

@ -41,7 +41,7 @@ experimental[] Create a centrally-managed Logstash pipeline, or update an existi
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/logstash/pipeline/hello-world" $ curl -X PUT api/logstash/pipeline/hello-world
{ {
"pipeline": "input { stdin {} } output { stdout {} }", "pipeline": "input { stdin {} } output { stdout {} }",
"settings": { "settings": {

View file

@ -28,6 +28,6 @@ experimental[] Delete a centrally-managed Logstash pipeline.
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X DELETE "localhost:5601/api/logstash/pipeline/hello-world" $ curl -X DELETE api/logstash/pipeline/hello-world
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -63,7 +63,7 @@ Grant access to various features in all spaces:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/security/role/my_kibana_role" $ curl -X PUT api/security/role/my_kibana_role
{ {
"metadata" : { "metadata" : {
"version" : 1 "version" : 1
@ -132,7 +132,7 @@ Grant dashboard-only access to only the Marketing space:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/security/role/my_kibana_role" $ curl -X PUT api/security/role/my_kibana_role
{ {
"metadata" : { "metadata" : {
"version" : 1 "version" : 1
@ -160,7 +160,7 @@ Grant full access to all features in the Default space:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/security/role/my_kibana_role" $ curl -X PUT api/security/role/my_kibana_role
{ {
"metadata" : { "metadata" : {
"version" : 1 "version" : 1
@ -187,7 +187,7 @@ Grant different access to different spaces:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/security/role/my_kibana_role" $ curl -X PUT api/security/role/my_kibana_role
{ {
"metadata" : { "metadata" : {
"version" : 1 "version" : 1
@ -223,7 +223,7 @@ Grant access to {kib} and {es}:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/security/role/my_kibana_role" $ curl -X PUT api/security/role/my_kibana_role
{ {
"metadata" : { "metadata" : {
"version" : 1 "version" : 1

View file

@ -65,7 +65,7 @@ Create an index pattern with the `my-pattern` ID, and a dashboard with the `my-d
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_bulk_create" $ curl -X POST api/saved_objects/_bulk_create
[ [
{ {
"type": "index-pattern", "type": "index-pattern",

View file

@ -52,7 +52,7 @@ Retrieve an index pattern with the `my-pattern` ID, and a dashboard with the `my
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_bulk_get" $ curl -X POST api/saved_objects/_bulk_get
[ [
{ {
"type": "index-pattern", "type": "index-pattern",

View file

@ -57,7 +57,7 @@ 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" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' $ curl -X POST 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-*"

View file

@ -39,6 +39,6 @@ Delete an index pattern object with the `my-pattern` ID:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X DELETE "localhost:5601/api/saved_objects/index-pattern/my-pattern" $ curl -X DELETE api/saved_objects/index-pattern/my-pattern
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -68,7 +68,7 @@ Export all index pattern saved objects:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{ {
"type": "index-pattern" "type": "index-pattern"
}' }'
@ -79,7 +79,7 @@ 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" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{ {
"type": "index-pattern", "type": "index-pattern",
"excludeExportDetails": true "excludeExportDetails": true
@ -91,7 +91,7 @@ Export a specific saved object:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{ {
"objects": [ "objects": [
{ {
@ -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" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' $ curl -X POST api/saved_objects/_export -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{ {
"objects": [ "objects": [
{ {

View file

@ -69,7 +69,7 @@ Find index patterns with titles that start with `my`:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X GET "localhost:5601/api/saved_objects/_find?type=index-pattern&search_fields=title&search=my*" $ curl -X GET api/saved_objects/_find?type=index-pattern&search_fields=title&search=my*
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -97,6 +97,6 @@ query parameter for each value:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X GET "localhost:5601/api/saved_objects/_find?fields=id&fields=title" $ curl -X GET api/saved_objects/_find?fields=id&fields=title
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -39,7 +39,7 @@ Retrieve the index pattern object with the `my-pattern` ID:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X GET "localhost:5601/api/saved_objects/index-pattern/my-pattern" $ curl -X GET api/saved_objects/index-pattern/my-pattern
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -61,7 +61,7 @@ Retrieve a dashboard object in the `testspace` by ID:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X GET "localhost:5601/s/testspace/api/saved_objects/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d" $ curl -X GET s/testspace/api/saved_objects/dashboard/7adfa750-4c81-11e8-b3d7-01146121b73d
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -57,7 +57,7 @@ Import an index pattern and dashboard:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson $ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -83,7 +83,7 @@ Import an index pattern and dashboard that includes a conflict on the index patt
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson $ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -119,7 +119,7 @@ Import a visualization and dashboard with an index pattern for the visualization
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_import" -H "kbn-xsrf: true" --form file=@file.ndjson $ curl -X POST api/saved_objects/_import -H "kbn-xsrf: true" --form file=@file.ndjson
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -63,7 +63,7 @@ Retry a dashboard import:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard"}]' $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard"}]'
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -88,7 +88,7 @@ Resolve errors for a dashboard and overwrite the existing saved object:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard","overwrite":true}]' $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"dashboard","id":"my-dashboard","overwrite":true}]'
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA
@ -114,7 +114,7 @@ Resolve errors for a visualization by replacing the index pattern with another:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/saved_objects/_resolve_import_errors" -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"missing","to":"existing"}]}]' $ curl -X POST api/saved_objects/_resolve_import_errors -H "kbn-xsrf: true" --form file=@file.ndjson --form retries='[{"type":"visualization","id":"my-vis","replaceReferences":[{"type":"index-pattern","from":"missing","to":"existing"}]}]'
-------------------------------------------------- --------------------------------------------------
// KIBANA // KIBANA

View file

@ -49,7 +49,7 @@ Update an existing index pattern object,`my-pattern`, with a different title:
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/saved_objects/index-pattern/my-pattern" $ curl -X PUT api/saved_objects/index-pattern/my-pattern
{ {
"attributes": { "attributes": {
"title": "some-other-pattern-*" "title": "some-other-pattern-*"

View file

@ -96,7 +96,7 @@ Copy a dashboard with the `my-dashboard` ID, including all references from the `
[source,sh] [source,sh]
---- ----
$ curl -X POST "localhost:5601/api/spaces/_copy_saved_objects" $ curl -X POST api/spaces/_copy_saved_objects
{ {
"objects": [{ "objects": [{
"type": "dashboard", "type": "dashboard",
@ -137,7 +137,7 @@ Copy a visualization with the `my-viz` ID from the `marketing` space to the `def
[source,sh] [source,sh]
---- ----
$ curl -X POST "localhost:5601/s/marketing/api/spaces/_copy_saved_objects" $ curl -X POST s/marketing/api/spaces/_copy_saved_objects
{ {
"objects": [{ "objects": [{
"type": "visualization", "type": "visualization",

View file

@ -47,7 +47,7 @@ experimental[] Create a {kib} space.
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/spaces/space" $ curl -X POST api/spaces/space
{ {
"id": "marketing", "id": "marketing",
"name": "Marketing", "name": "Marketing",

View file

@ -47,7 +47,7 @@ experimental[] Update an existing {kib} space.
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X PUT "localhost:5601/api/spaces/space/marketing" $ curl -X PUT api/spaces/space/marketing
{ {
"id": "marketing", "id": "marketing",
"name": "Marketing", "name": "Marketing",

View file

@ -116,7 +116,7 @@ Overwrite an index pattern in the `marketing` space, and a visualization in the
[source,sh] [source,sh]
---- ----
$ curl -X POST "localhost:5601/api/spaces/_resolve_copy_saved_objects_errors" $ curl -X POST api/spaces/_resolve_copy_saved_objects_errors
{ {
"objects": [{ "objects": [{
"type": "dashboard", "type": "dashboard",

View file

@ -32,7 +32,7 @@ are consumed over time.
[source,js] [source,js]
-------------------------------------------------- --------------------------------------------------
POST /api/upgrade_assistant/reindex/batch $ curl -X POST api/upgrade_assistant/reindex/batch
{ {
"indexNames": [ <1> "indexNames": [ <1>
"index1", "index1",
@ -40,7 +40,9 @@ POST /api/upgrade_assistant/reindex/batch
] ]
} }
-------------------------------------------------- --------------------------------------------------
<1> The order in which the indices are provided here determines the order in which the reindex tasks will be executed. // KIBANA
<1> The order of the indices determines the order that the reindex tasks are executed.
Similar to the <<start-resume-reindex, start or resume endpoint>>, the API returns the following: Similar to the <<start-resume-reindex, start or resume endpoint>>, the API returns the following:

View file

@ -64,6 +64,7 @@ The API returns the following:
`3`:: `3`::
Paused Paused
+
NOTE: If the {kib} node that started the reindex is shutdown or restarted, the reindex goes into a paused state after some time. NOTE: If the {kib} node that started the reindex is shutdown or restarted, the reindex goes into a paused state after some time.
To resume the reindex, you must submit a new POST request to the `/api/upgrade_assistant/reindex/<indexName>` endpoint. To resume the reindex, you must submit a new POST request to the `/api/upgrade_assistant/reindex/<indexName>` endpoint.

View file

@ -1,5 +1,5 @@
[[url-shortening-api]] [[url-shortening-api]]
=== Shorten URL API == Shorten URL API
++++ ++++
<titleabbrev>Shorten URL</titleabbrev> <titleabbrev>Shorten URL</titleabbrev>
++++ ++++
@ -9,34 +9,39 @@ Internet Explorer has URL length restrictions, and some wiki and markup parsers
Short URLs are designed to make sharing {kib} URLs easier. Short URLs are designed to make sharing {kib} URLs easier.
[float]
[[url-shortening-api-request]] [[url-shortening-api-request]]
==== Request === Request
`POST <kibana host>:<port>/api/shorten_url` `POST <kibana host>:<port>/api/shorten_url`
[float]
[[url-shortening-api-request-body]] [[url-shortening-api-request-body]]
==== Request body === Request body
`url`:: `url`::
(Required, string) The {kib} URL that you want to shorten, relative to `/app/kibana`. (Required, string) The {kib} URL that you want to shorten, relative to `/app/kibana`.
[float]
[[url-shortening-api-response-body]] [[url-shortening-api-response-body]]
==== Response body === Response body
urlId:: A top-level property that contains the shortened URL token for the provided request body. urlId:: A top-level property that contains the shortened URL token for the provided request body.
[float]
[[url-shortening-api-codes]] [[url-shortening-api-codes]]
==== Response code === Response code
`200`:: `200`::
Indicates a successful call. Indicates a successful call.
[float]
[[url-shortening-api-example]] [[url-shortening-api-example]]
==== Example === Example
[source,sh] [source,sh]
-------------------------------------------------- --------------------------------------------------
$ curl -X POST "localhost:5601/api/shorten_url" $ curl -X POST api/shorten_url
{ {
"url": "/app/kibana#/dashboard?_g=()&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),panels:!((embeddableConfig:(),gridData:(h:15,i:'1',w:24,x:0,y:0),id:'8f4d0c00-4c86-11e8-b3d7-01146121b73d',panelIndex:'1',type:visualization,version:'7.0.0-alpha1')),query:(language:lucene,query:''),timeRestore:!f,title:'New%20Dashboard',viewMode:edit)" "url": "/app/kibana#/dashboard?_g=()&_a=(description:'',filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),panels:!((embeddableConfig:(),gridData:(h:15,i:'1',w:24,x:0,y:0),id:'8f4d0c00-4c86-11e8-b3d7-01146121b73d',panelIndex:'1',type:visualization,version:'7.0.0-alpha1')),query:(language:lucene,query:''),timeRestore:!f,title:'New%20Dashboard',viewMode:edit)"
} }

View file

@ -31,7 +31,7 @@ For example, the following `curl` command exports a dashboard:
[source,sh] [source,sh]
-- --
curl -X POST -u $USER:$PASSWORD "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c" curl -X POST api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c
-- --
// KIBANA // KIBANA