Revert "Add Console docs for Comments and Variables (#137225) (#137515)" (#137518)

This reverts commit 601decd582.
This commit is contained in:
CJ Cenizal 2022-08-01 16:47:36 -07:00 committed by GitHub
parent 1eecafffb2
commit ae72e30df3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 64 deletions

View file

@ -45,9 +45,11 @@ Prepend requests to a {kib} API endpoint with `kbn:`
[source,bash]
--------------------------------------------------
GET kbn:/api/index_management/indices
`GET kbn:/api/index_management/indices`
--------------------------------------------------
When you paste the command into *Console*, {kib} automatically converts it
to *Console* syntax. Alternatively, if you want to see *Console* syntax in cURL,
click the action icon (image:dev-tools/console/images/wrench.png[]) and select *Copy as cURL*.
@ -63,69 +65,9 @@ These suggestions show you the parameters for each API and speed up your typing.
To configure your preferences for autocomplete, go to
<<configuring-console, Settings>>.
[float]
[[console-comments]]
==== Comments
You can write comments or temporarily disable parts of a request by using double forward slashes
or pound signs to create single-line comments.
[source,js]
----------------------------------
# This request searches all of your indices.
GET /_search
{
// The query parameter indicates query context.
"query": {
"match_all": {} // Matches all documents.
}
}
----------------------------------
You can also use a forward slash followed by an asterisk to mark the beginning of multi-line
comments. An asterisk followed by a forward slash marks the end.
[source,js]
----------------------------------
GET /_search
{
"query": {
/*"match_all": {
"boost": 1.2
}*/
"match_none": {}
}
}
----------------------------------
[float]
[[console-variables]]
==== Variables
Click *Variables* to create, edit, and delete variables.
[role="screenshot"]
image::dev-tools/console/images/variables.png["Variables", width=60%]
You can refer to these variables in the paths and bodies of your requests.
Each variable can be referenced multiple times.
[source,js]
----------------------------------
GET ${pathVariable}
{
"query": {
"match": {
"${bodyNameVariable}": "${bodyValueVariable}"
}
}
}
----------------------------------
[float]
[[auto-formatting]]
==== Auto-formatting
The auto-formatting
capability can help you format requests. Select one or more requests that you
want to format, click the action icon (image:dev-tools/console/images/wrench.png[]),
@ -134,22 +76,26 @@ and then select *Auto indent*.
For example, you might have a request formatted like this:
[role="screenshot"]
image::dev-tools/console/images/unformatted-request.png["Unformatted request", width=75%]
image::dev-tools/console/images/copy-curl.png["Console close-up", width=75%]
]
*Console* adjusts the JSON body of the request to apply the indents.
[role="screenshot"]
image::dev-tools/console/images/formatted-request.png["Formatted request", width=75%]
image::dev-tools/console/images/request.png["Console close-up", width=75%]
If you select *Auto indent* on a request that is already well formatted,
*Console* collapses the request body to a single line per document.
This is helpful when working with the {es} {ref}/docs-bulk.html[bulk APIs].
[float]
[[console-request]]
=== Submit requests
When you're ready to submit the request to {es}, click the green triangle.
When you're ready to submit the request to {es}, click the
green triangle.
You can select multiple requests and submit them together.
*Console* sends the requests to {es} one by one and shows the output
@ -157,6 +103,7 @@ in the response pane. Submitting multiple requests is helpful
when you're debugging an issue or trying query
combinations in multiple scenarios.
[float]
[[console-view-api]]
=== View API docs

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 143 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 240 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB