Merge branch 'feature/ingest' into add-data-processors-date
21
.travis.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
language: node_js
|
||||
node_js: 4
|
||||
env:
|
||||
- CXX=g++-4.8
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.8
|
||||
|
||||
install:
|
||||
- npm install
|
||||
- npm run setup_kibana
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- ../kibana
|
||||
|
||||
script: npm test
|
|
@ -15,6 +15,7 @@ adapt to the interval between measurements. Keys are http://en.wikipedia.org/wik
|
|||
`defaultIndex`:: Default is `null`. This property specifies the default index.
|
||||
`metaFields`:: An array of fields outside of `_source`. Kibana merges these fields into the document when displaying the
|
||||
document.
|
||||
`defaultColumns`:: Default is `_source`. Defines the columns that appear by default on the Discover page.
|
||||
`discover:sampleSize`:: The number of rows to show in the Discover table.
|
||||
`doc_table:highlight`:: Highlight results in Discover and Saved Searches Dashboard. Highlighing makes request slow when
|
||||
working on big documents. Set this property to `false` to disable highlighting.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[[kibana-apps]]
|
||||
== Kibana Apps added[4.2]
|
||||
== Kibana Apps
|
||||
|
||||
The Kibana UI serves as a framework that can contain several different applications. You can switch between these
|
||||
applications by clicking the image:images/app-button.png[App Picker] *App picker* button to display the app bar:
|
||||
|
|
|
@ -24,7 +24,7 @@ aggregation returns the percentile rankings for the values in the numeric field
|
|||
from the drop-down, then specify one or more percentile rank values in the *Values* fields. Click the *X* to remove a
|
||||
values field. Click *+Add* to add a values field.
|
||||
|
||||
You can add an aggregation by clicking the *+ Add Aggregation* button.
|
||||
You can add an aggregation by clicking the *+ Add Metrics* button.
|
||||
|
||||
include::x-axis-aggs.asciidoc[]
|
||||
For example, a chart of dates with incident counts can display dates in chronological order, or you can raise the
|
||||
|
|
|
@ -6,12 +6,12 @@ When a refresh interval is set, it is displayed to the left of the Time Filter i
|
|||
|
||||
To set the refresh interval:
|
||||
|
||||
. Click the *Time Filter* image:images/TimeFilter.jpg[Time Filter] in the upper right corner of the menu bar.
|
||||
. Click the *Time Filter* image:images/TimeFilter.jpg[Time Filter].
|
||||
. Click the *Refresh Interval* tab.
|
||||
. Choose a refresh interval from the list.
|
||||
|
||||
To automatically refresh the data, click the image:images/autorefresh.png[] *Auto-refresh* button and select an
|
||||
autorefresh interval:
|
||||
To automatically refresh the data, click the image:images/autorefresh.png[] *Auto-refresh* button when the time picker
|
||||
is open and select an autorefresh interval:
|
||||
|
||||
image::images/autorefresh-intervals.png[]
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@ The `Color` field formatter enables you to specify colors with specific ranges o
|
|||
|
||||
When you select the `Color` field formatter, Kibana displays the *Range*, *Font Color*, *Background Color*, and *Example* fields.
|
||||
|
||||
Click the *Add Color* button to add a range of values to associate with a particular color. You can click in the *Font Color* and *Background Color* fields to display a color picker. You can also enter a specific hex code value in the field. The effect of your current color choices are displayed in the *Example* field.
|
||||
Click the *Add Color* button to add a range of values to associate with a particular color. You can click in the *Font Color* and
|
||||
*Background Color* fields to display a color picker. You can also enter a specific hex code value in the field. The effect of your current
|
||||
color choices are displayed in the *Example* field.
|
||||
|
||||
image::images/colorformatter.png[]
|
||||
image::images/colorformatter.png[]
|
||||
|
||||
//update image
|
||||
|
|
|
@ -5,7 +5,7 @@ A Kibana _dashboard_ displays a set of saved visualizations in groups that you c
|
|||
dashboard to share or reload at a later time.
|
||||
|
||||
.Sample dashboard
|
||||
image:images/NYCTA-Dashboard.jpg[Example dashboard]
|
||||
image:images/tutorial-dashboard.png[Example dashboard]
|
||||
|
||||
[float]
|
||||
[[dashboard-getting-started]]
|
||||
|
@ -22,9 +22,7 @@ The first time you click the *Dashboard* tab, Kibana displays an empty dashboard
|
|||
image:images/NewDashboard.png[New Dashboard screen]
|
||||
|
||||
Build your dashboard by adding visualizations. By default, Kibana dashboards use a light color theme. To use a dark color
|
||||
theme instead, click the *Settings* image:images/SettingsButton.jpg[Gear] button and check the *Use dark theme* box.
|
||||
|
||||
image:images/darktheme.png[Dark Theme Example]
|
||||
theme instead, click the *Options* button and check the *Use dark theme* box.
|
||||
|
||||
NOTE: You can change the default theme in the *Advanced* section of the *Settings* tab.
|
||||
|
||||
|
@ -36,9 +34,9 @@ include::autorefresh.asciidoc[]
|
|||
[[adding-visualizations-to-a-dashboard]]
|
||||
==== Adding Visualizations to a Dashboard
|
||||
|
||||
To add a visualization to the dashboard, click the *Add Visualization* image:images/AddVis.png[Plus] button in the
|
||||
toolbar panel. Select a saved visualization from the list. You can filter the list of visualizations by typing a filter
|
||||
string into the *Visualization Filter* field.
|
||||
To add a visualization to the dashboard, click the *Add* button in the toolbar panel. Select a saved visualization
|
||||
from the list. You can filter the list of visualizations by typing a filter string into the *Visualization Filter*
|
||||
field.
|
||||
|
||||
The visualization you select appears in a _container_ on your dashboard.
|
||||
|
||||
|
@ -60,7 +58,7 @@ when you save a dashboard. To disable this behavior, clear the *Store time with
|
|||
|
||||
Click the *Load Saved Dashboard* button to display a list of existing dashboards. The saved dashboard selector includes
|
||||
a text field to filter by dashboard name and a link to the Object Editor for managing your saved dashboards. You can
|
||||
also access the Object Editor by clicking *Settings > Edit Saved Objects*.
|
||||
also access the Object Editor by clicking *Settings > Objects*.
|
||||
|
||||
[float]
|
||||
[[sharing-dashboards]]
|
||||
|
@ -73,8 +71,6 @@ NOTE: A user must have Kibana access in order to view embedded dashboards.
|
|||
|
||||
To share a dashboard, click the *Share* button image:images/share-dashboard.png[] to display the _Sharing_ panel.
|
||||
|
||||
image:images/sharing-panel.png[]
|
||||
|
||||
Click the *Copy to Clipboard* button image:images/share-link.png[] to copy the native URL or embed HTML to the clipboard.
|
||||
Click the *Generate short URL* button image:images/share-short-link.png[] to create a shortened URL for sharing or
|
||||
embedding.
|
||||
|
|
|
@ -39,9 +39,9 @@ in a name to display on the visualization.
|
|||
*Geohash*:: The {ref}search-aggregations-bucket-geohashgrid-aggregation.html[_geohash_] aggregation displays points
|
||||
based on the geohash coordinates.
|
||||
|
||||
Once you've specified a bucket type aggregation, you can define sub-aggregations to refine the visualization. Click
|
||||
*+ Add Sub Aggregation* to define a sub-aggregation, then choose *Split Rows* or *Split Table*, then select a
|
||||
sub-aggregation from the list of types.
|
||||
Once you've specified a bucket type aggregation, you can define sub-buckets to refine the visualization. Click
|
||||
*+ Add sub-buckets* to define a sub-bucket, then choose *Split Rows* or *Split Table*, then select an
|
||||
aggregation from the list of types.
|
||||
|
||||
You can use the up or down arrows to the right of the aggregation's type to change the aggregation's priority.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ You can also see the number of documents that match the search query and get fie
|
|||
configured for the selected index pattern, the distribution of documents over time is displayed in a histogram at the
|
||||
top of the page.
|
||||
|
||||
image:images/Discover-Start-Annotated.jpg[Discover Page]
|
||||
image::images/Discover-Start-Annotated.jpg[Discover Page]
|
||||
|
||||
[float]
|
||||
[[set-time-filter]]
|
||||
|
@ -43,15 +43,16 @@ sets an interval based on the time range.
|
|||
[[search]]
|
||||
=== Searching Your Data
|
||||
You can search the indices that match the current index pattern by submitting a search from the Discover page.
|
||||
You can enter simple query strings, use the Lucene https://lucene.apache.org/core/2_9_4/queryparsersyntax.html[query
|
||||
syntax], or use the full JSON-based {ref}/query-dsl.html[Elasticsearch Query DSL].
|
||||
You can enter simple query strings, use the
|
||||
Lucene https://lucene.apache.org/core/2_9_4/queryparsersyntax.html[query syntax], or use the full JSON-based
|
||||
{ref}/query-dsl.html[Elasticsearch Query DSL].
|
||||
|
||||
When you submit a search, the histogram, Documents table, and Fields list are updated to reflect
|
||||
the search results. The total number of hits (matching documents) is shown in the upper right corner of the
|
||||
histogram. The Documents table shows the first five hundred hits. By default, the hits are listed in reverse
|
||||
chronological order, with the newest documents shown first. You can reverse the sort order by by clicking on the Time
|
||||
column header. You can also sort the table using the values in any indexed field. For more information, see <<sorting,
|
||||
Sorting the Documents Table>>.
|
||||
column header. You can also sort the table using the values in any indexed field. For more information, see
|
||||
<<sorting,Sorting the Documents Table>>.
|
||||
|
||||
To search your data:
|
||||
|
||||
|
@ -79,9 +80,7 @@ Reference.
|
|||
[float]
|
||||
[[new-search]]
|
||||
==== Starting a New Search
|
||||
To clear the current search and start a new search, click the *New Search* button in the Discover toolbar.
|
||||
|
||||
image:images/Discover-New-Search.jpg[New Search]
|
||||
To clear the current search and start a new search, click the *New* button in the Discover toolbar.
|
||||
|
||||
[float]
|
||||
[[save-search]]
|
||||
|
@ -91,19 +90,18 @@ Saving a search saves both the search query string and the currently selected in
|
|||
|
||||
To save the current search:
|
||||
|
||||
. Click the *Save Search* button image:images/SaveButton.jpg[Save Search button] in the Discover toolbar.
|
||||
. Click the *Save* button in the Discover toolbar.
|
||||
. Enter a name for the search and click *Save*.
|
||||
|
||||
[float]
|
||||
[[load-search]]
|
||||
==== Loading a Saved Search
|
||||
==== Opening a Saved Search
|
||||
To load a saved search:
|
||||
|
||||
. Click the *Load Search* button image:images/LoadButton.jpg[Load Search
|
||||
button] in the Discover toolbar.
|
||||
. Select the search you want to load.
|
||||
. Click the *Open* button in the Discover toolbar.
|
||||
. Select the search you want to open.
|
||||
|
||||
If the saved search is associated with a different index pattern than is currently selected, loading the saved search
|
||||
If the saved search is associated with a different index pattern than is currently selected, opening the saved search
|
||||
also changes the selected index pattern.
|
||||
|
||||
[float]
|
||||
|
@ -184,13 +182,11 @@ image:images/add-column-button.png[Add Column] *Toggle column in table* button.
|
|||
[float]
|
||||
[[sorting]]
|
||||
==== Sorting the Document List
|
||||
You can sort the documents in the Documents table by the values in any indexed field. If a time field is configured for
|
||||
the selected index pattern, by default the documents are sorted in reverse chronological order.
|
||||
You can sort the documents in the Documents table by the values in any indexed field. Documents in index patterns that
|
||||
are configured with time fields are sorted in reverse chronological order by default.
|
||||
|
||||
To change the sort order:
|
||||
|
||||
* Click the name of the field you want to sort by. The fields you can use for sorting have a sort button to the right
|
||||
of the field name. Clicking the field name a second time reverses the sort order.
|
||||
To change the sort order, click the name of the field you want to sort by. The fields you can use for sorting have a
|
||||
sort button to the right of the field name. Clicking the field name a second time reverses the sort order.
|
||||
|
||||
[float]
|
||||
[[adding-columns]]
|
||||
|
@ -228,10 +224,8 @@ button image:images/RemoveFieldButton.jpg[Remove Field Button].
|
|||
From the field list, you can see how many documents in the Documents table contain a particular field, what the top 5
|
||||
values are, and what percentage of documents contain each value.
|
||||
|
||||
To view field data statistics:
|
||||
|
||||
* Click the name of a field in the Fields list. The field can be anywhere in the Fields list--Selected Fields, Popular
|
||||
Fields, or the list of other fields.
|
||||
To view field data statistics, click the name of a field in the Fields list. The field can be anywhere in the Fields
|
||||
list.
|
||||
|
||||
image:images/Discover-FieldStats.jpg[Field Statistics]
|
||||
|
||||
|
|
15
docs/duration-formatter.asciidoc
Normal file
|
@ -0,0 +1,15 @@
|
|||
The `Duration` field formatter can display the numeric value of a field in the following increments:
|
||||
|
||||
* Picoseconds
|
||||
* Nanoseconds
|
||||
* Microseconds
|
||||
* Milliseconds
|
||||
* Seconds
|
||||
* Minutes
|
||||
* Hours
|
||||
* Days
|
||||
* Weeks
|
||||
* Months
|
||||
* Years
|
||||
|
||||
You can specify these increments with up to 20 decimal places for both input and output formats.
|
|
@ -1,6 +1,6 @@
|
|||
=== Working with Filters
|
||||
|
||||
When you create a filter anywhere in Kibana, the filter conditions display in a green oval under the search text
|
||||
When you create a filter anywhere in Kibana, the filter conditions display in an oval under the search text
|
||||
entry box:
|
||||
|
||||
image::images/filter-sample.png[]
|
||||
|
@ -10,7 +10,7 @@ Hovering on the filter oval displays the following icons:
|
|||
image::images/filter-allbuttons.png[]
|
||||
|
||||
Enable Filter image:images/filter-enable.png[]:: Click this icon to disable the filter without removing it. You can
|
||||
enable the filter again later by clicking the icon again. Disabled filters display a striped shaded color, green for
|
||||
enable the filter again later by clicking the icon again. Disabled filters display a striped shaded color, grey for
|
||||
inclusion filters and red for exclusion filters.
|
||||
Pin Filter image:images/filter-pin.png[]:: Click this icon to _pin_ a filter. Pinned filters persist across Kibana tabs.
|
||||
You can pin filters from the _Visualize_ tab, click on the _Discover_ or _Dashboard_ tabs, and those filters remain in
|
||||
|
@ -18,7 +18,7 @@ place.
|
|||
NOTE: If you have a pinned filter and you're not seeing any query results, that your current tab's index pattern is one
|
||||
that the filter applies to.
|
||||
Toggle Filter image:images/filter-toggle.png[]:: Click this icon to _toggle_ a filter. By default, filters are inclusion
|
||||
filters, and display in green. Only elements that match the filter are displayed. To change this to an exclusion
|
||||
filters, and display in grey. Only elements that match the filter are displayed. To change this to an exclusion
|
||||
filters, displaying only elements that _don't_ match, toggle the filter. Exclusion filters display in red.
|
||||
Remove Filter image:images/filter-delete.png[]:: Click this icon to remove a filter entirely.
|
||||
Custom Filter image:images/filter-custom.png[]:: Click this icon to display a text field where you can customize the JSON
|
||||
|
|
|
@ -14,10 +14,10 @@ The material in this section assumes you have a working Kibana install connected
|
|||
|
||||
Video tutorials are also available:
|
||||
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-1[High-level Kibana 4 introduction, pie charts]
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-1[High-level Kibana introduction, pie charts]
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-2[Data discovery, bar charts, and line charts]
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-3[Tile maps]
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-4[Embedding Kibana 4 visualizations]
|
||||
* https://www.elastic.co/blog/kibana-4-video-tutorials-part-4[Embedding Kibana visualizations]
|
||||
|
||||
[float]
|
||||
[[tutorial-load-dataset]]
|
||||
|
@ -76,9 +76,9 @@ The schema for the logs data set has dozens of different fields, but the notable
|
|||
"@timestamp": "date"
|
||||
}
|
||||
|
||||
Before we load the Shakespeare data set, we need to set up a {ref}/mapping.html[_mapping_] for the fields. Mapping
|
||||
divides the documents in the index into logical groups and specifies a field's characteristics, such as the field's
|
||||
searchability or whether or not it's _tokenized_, or broken up into separate words.
|
||||
Before we load the Shakespeare and logs data sets, we need to set up {ref}mapping.html[_mappings_] for the fields.
|
||||
Mapping divides the documents in the index into logical groups and specifies a field's characteristics, such as the
|
||||
field's searchability or whether or not it's _tokenized_, or broken up into separate words.
|
||||
|
||||
Use the following command to set up a mapping for the Shakespeare data set:
|
||||
|
||||
|
@ -196,10 +196,10 @@ yellow open logstash-2015.05.20 5 1 4750 0 16.4mb
|
|||
=== Defining Your Index Patterns
|
||||
|
||||
Each set of data loaded to Elasticsearch has an <<settings-create-pattern,index pattern>>. In the previous section, the
|
||||
Shakespeare data set has an index named `shakespeare`, and the accounts
|
||||
data set has an index named `bank`. An _index pattern_ is a string with optional wildcards that can match multiple
|
||||
indices. For example, in the common logging use case, a typical index name contains the date in MM-DD-YYYY
|
||||
format, and an index pattern for May would look something like `logstash-2015.05*`.
|
||||
Shakespeare data set has an index named `shakespeare`, and the accounts data set has an index named `bank`. An _index
|
||||
pattern_ is a string with optional wildcards that can match multiple indices. For example, in the common logging use
|
||||
case, a typical index name contains the date in MM-DD-YYYY format, and an index pattern for May would look something
|
||||
like `logstash-2015.05*`.
|
||||
|
||||
For this tutorial, any pattern that matches the name of an index we've loaded will work. Open a browser and
|
||||
navigate to `localhost:5601`. Click the *Settings* tab, then the *Indices* tab. Click *Add New* to define a new index
|
||||
|
@ -219,7 +219,7 @@ contain data.
|
|||
[[tutorial-discovering]]
|
||||
=== Discovering Your Data
|
||||
|
||||
Click the *Discover* tab to display Kibana's data discovery functions:
|
||||
Click the *Discover* image:images/discover-compass.png[Compass icon] tab to display Kibana's data discovery functions:
|
||||
|
||||
image::images/tutorial-discover.png[]
|
||||
|
||||
|
@ -257,7 +257,7 @@ image::images/tutorial-discover-3.png[]
|
|||
The visualization tools available on the *Visualize* tab enable you to display aspects of your data sets in several
|
||||
different ways.
|
||||
|
||||
Click on the *Visualize* tab to start:
|
||||
Click on the *Visualize* image:images/visualize-icon.png[Bar chart icon] tab to start:
|
||||
|
||||
image::images/tutorial-visualize.png[]
|
||||
|
||||
|
@ -284,7 +284,7 @@ total number of ranges to six. Enter the following ranges:
|
|||
15000 30999
|
||||
31000 50000
|
||||
|
||||
Click the green *Apply changes* button image:images/apply-changes-button.png[] to display the chart:
|
||||
Click the *Apply changes* button image:images/apply-changes-button.png[] to display the chart:
|
||||
|
||||
image::images/tutorial-visualize-pie-2.png[]
|
||||
|
||||
|
@ -294,7 +294,7 @@ holder's age.
|
|||
|
||||
Click *Add sub-buckets* at the bottom, then select *Split Slices*. Choose the *Terms* aggregation and the *age* field from
|
||||
the drop-downs.
|
||||
Click the green *Apply changes* button image:images/apply-changes-button.png[] to add an external ring with the new
|
||||
Click the *Apply changes* button image:images/apply-changes-button.png[] to add an external ring with the new
|
||||
results.
|
||||
|
||||
image::images/tutorial-visualize-pie-3.png[]
|
||||
|
@ -310,10 +310,10 @@ image::images/tutorial-visualize-bar-1.png[]
|
|||
For the Y-axis metrics aggregation, select *Unique Count*, with *speaker* as the field. For Shakespeare plays, it might
|
||||
be useful to know which plays have the lowest number of distinct speaking parts, if your theater company is short on
|
||||
actors. For the X-Axis buckets, select the *Terms* aggregation with the *play_name* field. For the *Order*, select
|
||||
*Ascending*, leaving the *Size* at 5.
|
||||
*Ascending*, leaving the *Size* at 5. Write a description for the axes in the *Custom Label* fields.
|
||||
|
||||
Leave the other elements at their default values and click the green *Apply changes* button image:images/apply-changes-button.png[]. Your chart should now look
|
||||
like this:
|
||||
Leave the other elements at their default values and click the *Apply changes* button
|
||||
image:images/apply-changes-button.png[]. Your chart should now look like this:
|
||||
|
||||
image::images/tutorial-visualize-bar-2.png[]
|
||||
|
||||
|
@ -327,15 +327,18 @@ as well as change many other options for your visualizations, by clicking the *O
|
|||
Now that you have a list of the smallest casts for Shakespeare plays, you might also be curious to see which of these
|
||||
plays makes the greatest demands on an individual actor by showing the maximum number of speeches for a given part. Add
|
||||
a Y-axis aggregation with the *Add metrics* button, then choose the *Max* aggregation for the *speech_number* field. In
|
||||
the *Options* tab, change the *Bar Mode* drop-down to *grouped*, then click the green *Apply changes* button
|
||||
image:images/apply-changes-button.png[]. Your
|
||||
chart should now look like this:
|
||||
the *Options* tab, change the *Bar Mode* drop-down to *grouped*, then click the *Apply changes* button
|
||||
image:images/apply-changes-button.png[]. Your chart should now look like this:
|
||||
|
||||
image::images/tutorial-visualize-bar-3.png[]
|
||||
|
||||
As you can see, _Love's Labours Lost_ has an unusually high maximum speech number, compared to the other plays, and
|
||||
might therefore make more demands on an actor's memory.
|
||||
|
||||
Note how the *Number of speaking parts* Y-axis starts at zero, but the bars don't begin to differentiate until 18. To
|
||||
make the differences stand out, starting the Y-axis at a value closer to the minimum, check the
|
||||
*Scale Y-Axis to data bounds* box in the *Options* tab.
|
||||
|
||||
Save this chart with the name _Bar Example_.
|
||||
|
||||
Next, we're going to make a tile map chart to visualize some geographic data. Click on *New Visualization*, then
|
||||
|
@ -350,8 +353,8 @@ at the bottom. You'll see a map of the world, since we haven't defined any bucke
|
|||
|
||||
image::images/tutorial-visualize-map-1.png[]
|
||||
|
||||
Select *Geo Coordinates* as the bucket, then click the green *Apply changes* button image:images/apply-changes-button.png[]. Your chart should now look like
|
||||
this:
|
||||
Select *Geo Coordinates* as the bucket, then click the *Apply changes* button image:images/apply-changes-button.png[].
|
||||
Your chart should now look like this:
|
||||
|
||||
image::images/tutorial-visualize-map-2.png[]
|
||||
|
||||
|
@ -378,7 +381,7 @@ Write the following text in the field:
|
|||
The Markdown widget uses **markdown** syntax.
|
||||
> Blockquotes in Markdown use the > character.
|
||||
|
||||
Click the green *Apply changes* button image:images/apply-changes-button.png[] to display the rendered Markdown in the
|
||||
Click the *Apply changes* button image:images/apply-changes-button.png[] to display the rendered Markdown in the
|
||||
preview pane:
|
||||
|
||||
image::images/tutorial-visualize-md-2.png[]
|
||||
|
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 664 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 191 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 803 B |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 442 B |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
BIN
docs/images/discover-compass.png
Normal file
After Width: | Height: | Size: 721 B |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 222 KiB |
Before Width: | Height: | Size: 855 KiB After Width: | Height: | Size: 843 KiB |
Before Width: | Height: | Size: 208 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 634 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 238 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 498 KiB After Width: | Height: | Size: 368 KiB |
Before Width: | Height: | Size: 511 KiB After Width: | Height: | Size: 281 KiB |
Before Width: | Height: | Size: 619 KiB After Width: | Height: | Size: 2 MiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 188 KiB |
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 169 KiB |
BIN
docs/images/visualize-icon.png
Normal file
After Width: | Height: | Size: 285 B |
|
@ -3,10 +3,11 @@
|
|||
|
||||
:ref: http://www.elastic.co/guide/en/elasticsearch/reference/current/
|
||||
:shield: https://www.elastic.co/guide/en/shield/current
|
||||
:scyld: X-Pack Security
|
||||
:k4issue: https://github.com/elastic/kibana/issues/
|
||||
:k4pull: https://github.com/elastic/kibana/pull/
|
||||
:version: 5.0 alpha
|
||||
:esversion: 2.3
|
||||
:version: master
|
||||
:esversion: master
|
||||
|
||||
include::introduction.asciidoc[]
|
||||
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
[[introduction]]
|
||||
== Introduction
|
||||
|
||||
Kibana is an open source analytics and visualization platform designed to work
|
||||
with Elasticsearch. You use Kibana to search, view, and interact with data
|
||||
stored in Elasticsearch indices. You can easily perform advanced data analysis
|
||||
Kibana is an open source analytics and visualization platform designed to work with Elasticsearch. You use Kibana to
|
||||
search, view, and interact with data stored in Elasticsearch indices. You can easily perform advanced data analysis
|
||||
and visualize your data in a variety of charts, tables, and maps.
|
||||
|
||||
Kibana makes it easy to understand large volumes of data. Its simple,
|
||||
browser-based interface enables you to quickly create and share dynamic
|
||||
dashboards that display changes to Elasticsearch queries in real time.
|
||||
Kibana makes it easy to understand large volumes of data. Its simple, browser-based interface enables you to quickly
|
||||
create and share dynamic dashboards that display changes to Elasticsearch queries in real time.
|
||||
|
||||
Setting up Kibana is a snap. You can install Kibana and start exploring your
|
||||
Elasticsearch indices in minutes -- no code, no additional infrastructure required.
|
||||
Setting up Kibana is a snap. You can install Kibana and start exploring your Elasticsearch indices in minutes -- no
|
||||
code, no additional infrastructure required.
|
||||
|
||||
NOTE: This guide describes how to use Kibana {version}. For information about what's new
|
||||
in Kibana {version}, see the <<releasenotes, release notes>>.
|
||||
For more information about creating and sharing visualizations and dashboards, see the <<visualize, Visualize>>
|
||||
and <<dashboard, Dashboard>> topics. A complete <<getting-started,tutorial>> covering several aspects of Kibana's
|
||||
functionality is also available.
|
||||
|
||||
NOTE: This guide describes how to use Kibana {version}. For information about what's new in Kibana {version}, see
|
||||
the <<releasenotes, release notes>>.
|
||||
|
||||
////
|
||||
[float]
|
||||
|
@ -52,7 +54,3 @@ that displays several visualizations of the TFL data:
|
|||
|
||||
image:images/TFL-Dashboard.jpg[Dashboard]
|
||||
////
|
||||
|
||||
For more information about creating and sharing visualizations and dashboards, see the <<visualize, Visualize>>
|
||||
and <<dashboard, Dashboard>> topics. A complete <<getting-started,tutorial>> covering several aspects of Kibana's
|
||||
functionality is also available.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[[setup-repositories]]
|
||||
=== Kibana Repositories
|
||||
|
||||
Binary packages for Kibana are available for Unix distributions that support the `apt` and `yum` tools.We also have
|
||||
Binary packages for Kibana are available for Unix distributions that support the `apt` and `yum` tools. We also have
|
||||
repositories available for APT and YUM based distributions.
|
||||
|
||||
NOTE: Since the packages are created as part of the Kibana build, source packages are not available.
|
||||
|
@ -24,23 +24,24 @@ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add
|
|||
+
|
||||
. Add the repository definition to your `/etc/apt/sources.list.d/kibana.list` file:
|
||||
+
|
||||
[source, sh]
|
||||
["source","sh",subs="attributes"]
|
||||
--------------------------------------------------
|
||||
echo "deb http://packages.elastic.co/kibana/{branch}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana.list
|
||||
echo "deb http://packages.elastic.co/kibana/{version}/debian stable main" | sudo tee -a /etc/apt/sources.list.d/kibana.list
|
||||
--------------------------------------------------
|
||||
+
|
||||
[WARNING]
|
||||
==================================================
|
||||
Use the `echo` method described above to add the Kibana repository. Do not use `add-apt-repository`, as that command
|
||||
Use the `echo` method described above to add the Kibana repository. Do not use `add-apt-repository`, as that command
|
||||
adds a `deb-src` entry with no corresponding source package.
|
||||
When the `deb-src` entry, is present, the commands in this procedure generate an error similar to the following:
|
||||
|
||||
When the `deb-src` entry is present, the commands in this procedure generate an error similar to the following:
|
||||
|
||||
Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)
|
||||
|
||||
Delete the `deb-src` entry from the `/etc/apt/sources.list.d/kibana.list` file to clear the error.
|
||||
==================================================
|
||||
+
|
||||
. Run `apt-get update` and the repository is ready for use. Install Kibana with the following command:
|
||||
. Run `apt-get update` to ready the repository. Install Kibana with the following command:
|
||||
+
|
||||
[source,sh]
|
||||
--------------------------------------------------
|
||||
|
@ -79,11 +80,11 @@ rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch
|
|||
+
|
||||
. Create a file named `kibana.repo` in the `/etc/yum.repos.d/` directory with the following contents:
|
||||
+
|
||||
[source,sh]
|
||||
["source","sh",subs="attributes"]
|
||||
--------------------------------------------------
|
||||
[kibana-{branch}]
|
||||
name=Kibana repository for {branch}.x packages
|
||||
baseurl=http://packages.elastic.co/kibana/{branch}/centos
|
||||
[kibana-{version}]
|
||||
name=Kibana repository for {version}.x packages
|
||||
baseurl=http://packages.elastic.co/kibana/{version}/centos
|
||||
gpgcheck=1
|
||||
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
|
||||
enabled=1
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
[horizontal]
|
||||
`server.port:`:: *Default: 5601* Kibana is served by a back end server. This setting specifies the port to use.
|
||||
`server.host:`:: *Default: "0.0.0.0"* This setting specifies the IP address of the back end server.
|
||||
`server.basePath:`:: Enables you to specify a path to mount Kibana at if you are running behind a proxy. This setting cannot
|
||||
end in a slash (`/`).
|
||||
`server.basePath:`:: Enables you to specify a path to mount Kibana at if you are running behind a proxy. This setting
|
||||
cannot end in a slash (`/`).
|
||||
`server.maxPayloadBytes:`:: *Default: 1048576* The maximum payload size in bytes for incoming server requests.
|
||||
`server.name:`:: *Default: "your-hostname"* A human-readable display name that identifies this Kibana instance.
|
||||
`elasticsearch.url:`:: *Default: "http://localhost:9200"* The URL of the Elasticsearch instance to use for all your
|
||||
queries.
|
||||
`elasticsearch.preserveHost:`:: *Default: true* When this setting’s value is true Kibana uses the hostname specified in
|
||||
|
@ -39,4 +40,5 @@ retrying.
|
|||
error messages.
|
||||
`logging.verbose`:: *Default: false* Set the value of this setting to `true` to log all events, including system usage
|
||||
information and all requests.
|
||||
`ops.interval`:: *Default: 10000* Set the interval in milliseconds to sample system and process performance metrics. Minimum is 100ms. Defaults to 10 seconds.
|
||||
`ops.interval`:: *Default: 10000* Set the interval in milliseconds to sample system and process performance metrics.
|
||||
The minimum value is 100.
|
||||
|
|
|
@ -50,7 +50,7 @@ values.
|
|||
*Scale Y-Axis to Data Bounds*:: The default Y-axis bounds are zero and the maximum value returned in the data. Check
|
||||
this box to change both upper and lower bounds to match the values returned in the data.
|
||||
|
||||
After changing options, click the green *Apply changes* button to update your visualization, or the grey *Discard
|
||||
After changing options, click the *Apply changes* button to update your visualization, or the grey *Discard
|
||||
changes* button to keep your visualization in its current state.
|
||||
|
||||
[float]
|
||||
|
|
|
@ -50,8 +50,8 @@ in a name to display on the visualization.
|
|||
{ref}search-aggregations-bucket-significantterms-aggregation.html[_significant terms_] aggregation. The value of the
|
||||
*Size* parameter defines the number of entries this aggregation returns.
|
||||
|
||||
After defining an initial bucket aggregation, you can define sub-aggregations to refine the visualization. Click *+ Add
|
||||
Sub Aggregation* to define a sub-aggregation, then choose *Split Slices* to select a sub-aggregation from the list of
|
||||
After defining an initial bucket aggregation, you can define sub-buckets to refine the visualization. Click *+ Add
|
||||
sub-buckets* to define a sub-aggregation, then choose *Split Slices* to select a sub-bucket from the list of
|
||||
types.
|
||||
|
||||
When multiple aggregations are defined on a chart's axis, you can use the up or down arrows to the right of the
|
||||
|
@ -84,7 +84,7 @@ Select the *Options* tab to change the following aspects of the table:
|
|||
*Show Tooltip*:: Check this box to enable the display of tooltips.
|
||||
*Show Legend*:: Check this box to enable the display of a legend next to the chart.
|
||||
|
||||
After changing options, click the green *Apply changes* button to update your visualization, or the grey *Discard
|
||||
After changing options, click the *Apply changes* button to update your visualization, or the grey *Discard
|
||||
changes* button to keep your visualization in its current state.
|
||||
|
||||
[float]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[[kibana-plugins]]
|
||||
== Kibana Plugins added[4.2]
|
||||
== Kibana Plugins
|
||||
|
||||
Add-on functionality for Kibana is implemented with plug-in modules. You can use the `bin/kibana plugin`
|
||||
Add-on functionality for Kibana is implemented with plug-in modules. You can use the `bin/kibana-plugin`
|
||||
command to manage these modules. You can also install a plugin manually by moving the plugin file to the
|
||||
`installedPlugins` directory and unpacking the plugin files into a new directory.
|
||||
|
||||
|
@ -13,27 +13,22 @@ A list of existing Kibana plugins is available on https://github.com/elastic/kib
|
|||
Use the following command to install a plugin:
|
||||
|
||||
[source,shell]
|
||||
bin/kibana plugin --install <org>/<package>/<version>
|
||||
bin/kibana-plugin install <package name or URL>
|
||||
|
||||
You can also use `-i` instead of `--install`, as in the following example:
|
||||
|
||||
[source,shell]
|
||||
bin/kibana plugin -i elasticsearch/marvel/latest
|
||||
|
||||
Because the organization given is `elasticsearch`, the plugin management tool automatically downloads the
|
||||
plugin from `download.elastic.co`.
|
||||
When you specify a plugin name without a URL, the plugin tool attempts to download the plugin from `download.elastic.co`.
|
||||
|
||||
[float]
|
||||
=== Installing Plugins from an Arbitrary URL
|
||||
==== Installing Plugins from an Arbitrary URL
|
||||
|
||||
You can specify a URL to a plugin with the `-u` or `--url` options after the `-i` or `--install` option, as in the
|
||||
following example:
|
||||
You can specify a URL to a specific plugin, as in the following example:
|
||||
|
||||
[source,shell]
|
||||
bin/kibana plugin -i sample-plugin -u https://some.sample.url/directory
|
||||
Installing sample-plugin
|
||||
Attempting to extract from https://some.sample.url/directory
|
||||
Downloading <some number> bytes....................
|
||||
$ bin/kibana-plugin install https://download.elastic.co/kibana/x-pack/x-pack-5.0.0-snapshot.zip
|
||||
Attempting to transfer from https://download.elastic.co/kibana/x-pack//x-pack-5.0.0-snapshot.zip
|
||||
Transferring <some number> bytes....................
|
||||
Transfer complete
|
||||
Retrieving metadata from plugin archive
|
||||
Extracting plugin archive
|
||||
Extraction complete
|
||||
Optimizing and caching browser bundles...
|
||||
Plugin installation complete
|
||||
|
@ -43,13 +38,17 @@ You can specify URLs that use the HTTP, HTTPS, or `file` protocols.
|
|||
[float]
|
||||
=== Installing Plugins to an Arbitrary Directory
|
||||
|
||||
Use the `-d` or `--plugin-dir` option to specify a directory for plugins, as in the following example:
|
||||
Use the `-d` or `--plugin-dir` option after the `install` command to specify a directory for plugins, as in the following
|
||||
example:
|
||||
|
||||
[source,shell]
|
||||
bin/kibana plugin -i elasticsearch/sample-plugin/latest -d <path/to/directory>
|
||||
$ bin/kibana-plugin install file:///some/local/path/x-pack.zip -d path/to/directory
|
||||
Installing sample-plugin
|
||||
Attempting to extract from https://download.elastic.co/elasticsearch/sample-plugin/sample-plugin-latest.tar.gz
|
||||
Downloading <some number> bytes....................
|
||||
Attempting to transfer from file:///some/local/path/x-pack.zip
|
||||
Transferring <some number> bytes....................
|
||||
Transfer complete
|
||||
Retrieving metadata from plugin archive
|
||||
Extracting plugin archive
|
||||
Extraction complete
|
||||
Optimizing and caching browser bundles...
|
||||
Plugin installation complete
|
||||
|
@ -59,18 +58,17 @@ NOTE: This command creates the specified directory if it does not already exist.
|
|||
[float]
|
||||
=== Removing Plugins
|
||||
|
||||
Use the `--remove` or `-r` option to remove a plugin, including any configuration information, as in the following
|
||||
example:
|
||||
Use the `remove` command to remove a plugin, including any configuration information, as in the following example:
|
||||
|
||||
[source,shell]
|
||||
bin/kibana plugin --remove marvel
|
||||
$ bin/kibana-plugin remove timelion
|
||||
|
||||
You can also remove a plugin manually by deleting the plugin's subdirectory under the `installedPlugins` directory.
|
||||
You can also remove a plugin manually by deleting the plugin's subdirectory under the `installedPlugins/` directory.
|
||||
|
||||
[float]
|
||||
=== Listing Installed Plugins
|
||||
|
||||
Use `--list` or `-l` option to list the currently installed plugins.
|
||||
Use the `list` command to list the currently installed plugins.
|
||||
|
||||
[float]
|
||||
=== Updating Plugins
|
||||
|
@ -81,27 +79,28 @@ To update a plugin, remove the current version and reinstall the plugin.
|
|||
=== Configuring the Plugin Manager
|
||||
|
||||
By default, the plugin manager provides you with feedback on the status of the activity you've asked the plugin manager
|
||||
to perform. You can control the level of feedback with the `--quiet` and `--silent` options. Use the `--quiet` option to
|
||||
suppress all non-error output. Use the `--silent` option to suppress all output.
|
||||
to perform. You can control the level of feedback for the `install` and `remove` commands with the `--quiet` and
|
||||
`--silent` options. Use the `--quiet` option to suppress all non-error output. Use the `--silent` option to suppress all
|
||||
output.
|
||||
|
||||
By default, plugin manager requests do not time out. Use the `--timeout` option, followed by a time, to change this
|
||||
behavior, as in the following examples:
|
||||
By default, plugin manager installation requests do not time out. Use the `--timeout` option, followed by a time, to
|
||||
change this behavior, as in the following examples:
|
||||
|
||||
[source,shell]
|
||||
.Waits for 30 seconds before failing
|
||||
bin/kibana plugin --install username/sample-plugin --timeout 30s
|
||||
bin/kibana-plugin install --timeout 30s sample-plugin
|
||||
|
||||
[source,shell]
|
||||
.Waits for 1 minute before failing
|
||||
bin/kibana plugin --install username/sample-plugin --timeout 1m
|
||||
bin/kibana-plugin install --timeout 1m sample-plugin
|
||||
|
||||
[float]
|
||||
==== Plugins and Custom Kibana Configurations
|
||||
|
||||
Use the `-c` or `--config` options to specify the path to the configuration file used to start Kibana. By default, Kibana
|
||||
uses the configuration file `config/kibana.yml`. When you change your installed plugins, the `bin/kibana plugin` command
|
||||
restarts the Kibana server. When you are using a customized configuration file, you must specify the
|
||||
path to that configuration file each time you use the `bin/kibana plugin` command.
|
||||
Use the `-c` or `--config` options with the `install` and `remove` commands to specify the path to the configuration file
|
||||
used to start Kibana. By default, Kibana uses the configuration file `config/kibana.yml`. When you change your installed
|
||||
plugins, the `bin/kibana-plugin` command restarts the Kibana server. When you are using a customized configuration file,
|
||||
you must specify the path to that configuration file each time you use the `bin/kibana-plugin` command.
|
||||
|
||||
[float]
|
||||
=== Plugin Manager Exit Codes
|
||||
|
@ -117,9 +116,14 @@ path to that configuration file each time you use the `bin/kibana plugin` comman
|
|||
== Switching Plugin Functionality
|
||||
|
||||
The Kibana UI serves as a framework that can contain several different plugins. You can switch between these
|
||||
plugins by clicking the image:images/app-button.png[Plugin Chooser] *Plugin chooser* button to display icons for the
|
||||
installed plugins:
|
||||
plugins by clicking the icons for your desired plugins in the left-hand navigation bar.
|
||||
|
||||
image::images/app-picker.png[]
|
||||
[float]
|
||||
=== Disabling Plugins
|
||||
|
||||
Click a plugin's icon to switch to that plugin's functionality.
|
||||
Use the following command to disable a plugin:
|
||||
|
||||
[source,shell]
|
||||
./bin/kibana --<plugin ID>.enabled=false
|
||||
|
||||
You can find a plugin's plugin ID as the value of the `name` property in the plugin's `package.json` file.
|
|
@ -1,6 +1,6 @@
|
|||
[[production]]
|
||||
== Using Kibana in a Production Environment
|
||||
* <<configuring-kibana-shield, Configuring Kibana to Work with Shield>>
|
||||
* <<configuring-kibana-shield, Configuring Kibana to Work with {scyld}>>
|
||||
* <<enabling-ssl, Enabling SSL>>
|
||||
* <<controlling-access, Controlling Access>>
|
||||
* <<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>
|
||||
|
@ -19,31 +19,29 @@ and an Elasticsearch client node on the same machine. For more information, see
|
|||
|
||||
[float]
|
||||
[[configuring-kibana-shield]]
|
||||
=== Configuring Kibana to Work with Shield
|
||||
If you are using Shield to authenticate Elasticsearch users, you need to provide
|
||||
=== Configuring Kibana to Work with {scyld}
|
||||
If you are using {scyld} to authenticate Elasticsearch users, you need to provide
|
||||
the Kibana server with credentials so it can access the `.kibana` index and monitor
|
||||
the cluster.
|
||||
|
||||
To configure credentials for the Kibana server:
|
||||
|
||||
. Assign the `kibana4_server` role to a user in Shield. For more information, see
|
||||
{shield}/kibana.html#kibana4-server-role[Configuring a Role for the Kibana 4 Server]
|
||||
in the Shield documentation.
|
||||
. Assign the `kibana4_server` role to a user in {scyld}. For more information, see
|
||||
{shield}/kibana.html#kibana4-server-role[Configuring a Role for the Kibana Server]
|
||||
in the {scyld} documentation.
|
||||
|
||||
. Set the `kibana_elasticsearch_username` and
|
||||
`kibana_elasticsearch_password` properties in `kibana.yml` to specify the credentials
|
||||
of the user you assigned the `kibana4_server`
|
||||
role:
|
||||
of the user you assigned the `kibana4_server` role:
|
||||
+
|
||||
[source,text]
|
||||
----
|
||||
kibana_elasticsearch_username: kibana4-user
|
||||
kibana_elasticsearch_password: kibana4-password
|
||||
kibana_elasticsearch_username: kibana-user
|
||||
kibana_elasticsearch_password: kibana-password
|
||||
----
|
||||
|
||||
Kibana 4 users also need access to the `.kibana` index so they can save and load searches, visualizations, and dashboards.
|
||||
For more information, see {shield}/kibana.html[Using Kibana with Shield] in
|
||||
the Shield documentation.
|
||||
Users on release 4.0 and later of Kibana also need access to the `.kibana` index so they can save and load searches, visualizations, and
|
||||
dashboards. For more information, see {shield}/kibana.html[Using Kibana with {scyld}].
|
||||
|
||||
TIP: See <<kibana-dynamic-mapping, Kibana and Elasticsearch Dynamic Mapping>> for important information on Kibana and
|
||||
the dynamic mapping feature in Elasticsearch.
|
||||
|
@ -64,7 +62,7 @@ server.ssl.key: /path/to/your/server.key
|
|||
server.ssl.cert: /path/to/your/server.crt
|
||||
----
|
||||
|
||||
If you are using Shield or a proxy that provides an HTTPS endpoint for Elasticsearch,
|
||||
If you are using {scyld} or a proxy that provides an HTTPS endpoint for Elasticsearch,
|
||||
you can configure Kibana to access Elasticsearch via HTTPS so communications between
|
||||
the Kibana server and Elasticsearch are encrypted.
|
||||
|
||||
|
@ -89,15 +87,14 @@ ca: /path/to/your/ca/cacert.pem
|
|||
[float]
|
||||
[[controlling-access]]
|
||||
=== Controlling access
|
||||
You can use http://www.elastic.co/overview/shield/[Elasticsearch Shield]
|
||||
(Shield) to control what Elasticsearch data users can access through Kibana.
|
||||
Shield provides index-level access control. If a user isn't authorized to run
|
||||
You can use http://www.elastic.co/overview/shield/[{scyld}] to control what Elasticsearch data users can access through Kibana.
|
||||
{scyld} provides index-level access control. If a user isn't authorized to run
|
||||
the query that populates a Kibana visualization, the user just sees an empty
|
||||
visualization.
|
||||
|
||||
To configure access to Kibana using Shield, you create Shield roles
|
||||
To configure access to Kibana using {scyld}, you create roles
|
||||
for Kibana using the `kibana4` default role as a starting point. For more
|
||||
information, see {shield}/kibana.html#using-kibana4-with-shield[Using Kibana 4 with Shield].
|
||||
information, see {shield}/kibana.html#using-kibana4-with-shield[Using Kibana with {scyld}].
|
||||
|
||||
[float]
|
||||
[[load-balancing]]
|
||||
|
|
|
@ -3,21 +3,29 @@
|
|||
|
||||
The {version} release of Kibana requires Elasticsearch {esversion} or later.
|
||||
|
||||
[float]
|
||||
[[breaking]]
|
||||
== Breaking Changes
|
||||
|
||||
// * {k4issue}5591[Issue 5591]: The command-line plugin tool no longer supports Github.
|
||||
|
||||
[float]
|
||||
[[enhancements]]
|
||||
== Enhancements
|
||||
|
||||
// * {k4issue}5109[Issue 5109]: Adds custom JSON and filter alias naming for filters.
|
||||
// * {k4issue}1726[Issue 1726]: Adds a color field formatter for value ranges in numeric fields.
|
||||
// * {k4issue}4342[Issue 4342]: Increased performance for wildcard indices.
|
||||
// * {k4issue}1600[Issue 1600]: Support for global time zones.
|
||||
// * {k4pull}5275[Pull Request 5275]: Highlighting values in Discover can now be disabled.
|
||||
// * {k4issue}5212[Issue 5212]: Adds support for multiple certificate authorities.
|
||||
// * {k4issue}2716[Issue 2716]: The open/closed position of the spy panel now persists across UI state changes.
|
||||
// * {k4issue}6387[Issue 6387]: A new look for Kibana: new logo and UI, improved layout and navigation.
|
||||
|
||||
[float]
|
||||
[[bugfixes]]
|
||||
== Bug Fixes
|
||||
|
||||
// * {k4issue}5165[Issue 5165]: Resolves a display error in embedded views.
|
||||
// * {k4issue}5021[Issue 5021]: Improves visualization dimming for dashboards with auto-refresh.
|
||||
// * {k4issue}5914[Issue 5914]: Adds ability to aggregate on unindexed fields.
|
||||
|
||||
[float]
|
||||
[[plugins-apis]]
|
||||
== Plugins, APIs, and Development Infrastructure
|
||||
|
||||
NOTE: The items in this section are not a complete list of the internal changes relating to development in Kibana. Plugin
|
||||
framework and APIs are not formally documented and not guaranteed to be backward compatible from release to release.
|
||||
|
||||
// * {k4issue}5198[Issue 5198]: Injects buttons from the plugin to the navigation bar.
|
||||
|
|
|
@ -183,11 +183,13 @@ include::string-formatter.asciidoc[]
|
|||
|
||||
==== Numeric Field Formatters
|
||||
|
||||
Numeric fields support the `Url`, `String`, `Bytes`, `Number`, `Percentage`, and `Color` formatters.
|
||||
Numeric fields support the `Url`, `Bytes`, `Duration`, `Number`, `Percentage`, `String`, and `Color` formatters.
|
||||
|
||||
include::url-formatter.asciidoc[]
|
||||
|
||||
include::string-formatter.asciidoc[]
|
||||
|
||||
include::url-formatter.asciidoc[]
|
||||
include::duration-formatter.asciidoc[]
|
||||
|
||||
include::color-formatter.asciidoc[]
|
||||
|
||||
|
@ -278,6 +280,7 @@ you'll need to update your `kibana.yml` file. You can also enable SSL and set a
|
|||
|
||||
include::kibana-yml.asciidoc[]
|
||||
|
||||
////
|
||||
deprecated[4.2, The names of several Kibana server properties changed in the 4.2 release of Kibana. The previous names remain as functional aliases, but are now deprecated and will be removed in a future release of Kibana]
|
||||
|
||||
[horizontal]
|
||||
|
@ -407,6 +410,7 @@ you are using a self-signed certificate so the certificate can be verified. Disa
|
|||
`logging.dest` added[4.2]:: The location where you want to store the Kibana's log output. If not specified, log output is written to standard output and not stored. Specifying a log file suppresses log writes to standard output.
|
||||
+
|
||||
*alias*: `log_file` deprecated[4.2]
|
||||
////
|
||||
|
||||
[[managing-saved-objects]]
|
||||
=== Managing Saved Searches, Visualizations, and Dashboards
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
You can set up Kibana and start exploring your Elasticsearch indices in minutes.
|
||||
All you need is:
|
||||
|
||||
* Elasticsearch master
|
||||
* Elasticsearch {esversion}
|
||||
* A modern web browser - http://www.elastic.co/subscriptions/matrix#matrix_browsers[Supported Browsers].
|
||||
* Information about your Elasticsearch installation:
|
||||
** URL of the Elasticsearch instance you want to connect to.
|
||||
** Which Elasticsearch indices you want to search.
|
||||
|
||||
NOTE: If your Elasticsearch installation is protected by http://www.elastic.co/overview/shield/[Shield] see
|
||||
{shield}/kibana.html#using-kibana4-with-shield[Shield with Kibana 4] for additional setup instructions.
|
||||
NOTE: If your Elasticsearch installation is protected by http://www.elastic.co/overview/shield/[{scyld}], see
|
||||
{shield}/kibana.html#using-kibana4-with-shield[{scyld} with Kibana] for additional setup instructions.
|
||||
|
||||
[float]
|
||||
[[install]]
|
||||
|
@ -18,15 +18,16 @@ NOTE: If your Elasticsearch installation is protected by http://www.elastic.co/o
|
|||
|
||||
To get Kibana up and running:
|
||||
|
||||
. Download the https://www.elastic.co/downloads/kibana[Kibana 4 binary package] for your platform.
|
||||
. Download the https://www.elastic.co/downloads/kibana[Kibana {version} binary package] for your platform.
|
||||
. Extract the `.zip` or `tar.gz` archive file.
|
||||
. After installing, run Kibana from the install directory: `bin/kibana` (Linux/MacOSX) or `bin\kibana.bat` (Windows).
|
||||
|
||||
// On Unix, you can instead run the package manager suited for your distribution.
|
||||
//
|
||||
// [float]
|
||||
// include::kibana-repositories.asciidoc[]
|
||||
//
|
||||
After installing, run Kibana from the install directory: `bin/kibana` (Linux/MacOSX) or `bin\kibana.bat` (Windows).
|
||||
On Unix, you can instead run the package manager suited for your distribution.
|
||||
|
||||
////
|
||||
[float]
|
||||
include::kibana-repositories.asciidoc[]
|
||||
////
|
||||
|
||||
That's it! Kibana is now running on port 5601.
|
||||
|
||||
|
@ -82,14 +83,14 @@ simply be the name of a single index.
|
|||
reads the index mapping to list all of the fields that contain a timestamp. If your index doesn't have time-based data,
|
||||
disable the *Index contains time-based events* option.
|
||||
+
|
||||
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Support for this functionality
|
||||
will be removed entirely in the next major Kibana release. Elasticsearch 2.1 includes sophisticated date parsing APIs that
|
||||
Kibana uses to determine date information, removing the need to specify dates in the index pattern name.
|
||||
WARNING: Using event times to create index names is *deprecated* in this release of Kibana. Starting in the 2.1
|
||||
release, Elasticsearch includes sophisticated date parsing APIs that Kibana uses to determine date information,
|
||||
removing the need to specify dates in the index pattern name.
|
||||
+
|
||||
. Click *Create* to add the index pattern. This first pattern is automatically configured as the default.
|
||||
When you have more than one index pattern, you can designate which one to use as the default from *Settings > Indices*.
|
||||
|
||||
Voila! Kibana is now connected to your Elasticsearch data. Kibana displays a read-only list of fields configured for
|
||||
All done! Kibana is now connected to your Elasticsearch data. Kibana displays a read-only list of fields configured for
|
||||
the matching index.
|
||||
|
||||
[float]
|
||||
|
@ -101,5 +102,5 @@ You're ready to dive in to your data:
|
|||
* Chart and map your data from the <<visualize, Visualize>> page.
|
||||
* Create and view custom dashboards from the <<dashboard, Dashboard>> page.
|
||||
|
||||
For a brief tutorial that explores these core Kibana concepts, take a look at the <<getting-started, Getting
|
||||
For a tutorial that explores these core Kibana concepts, take a look at the <<getting-started, Getting
|
||||
Started>> page.
|
||||
|
|
|
@ -2,9 +2,10 @@ The `String` field formatter can apply the following transformations to the fiel
|
|||
|
||||
* Convert to lowercase
|
||||
* Convert to uppercase
|
||||
* Convert to title case
|
||||
* Apply the short dots transformation, which replaces the content before a `.` character with the first character of
|
||||
that content, as in the following example:
|
||||
|
||||
[horizontal]
|
||||
*Original*:: *Becomes*
|
||||
`com.organizations.project.ClassName`:: `c.o.p.ClassName`
|
||||
`com.organizations.project.ClassName`:: `c.o.p.ClassName`
|
||||
|
|
|
@ -50,7 +50,7 @@ intervals in the histogram.
|
|||
*Range*:: With a {ref}search-aggregations-bucket-range-aggregation.html[_range_] aggregation, you can specify ranges
|
||||
of values for a numeric field. Click *Add Range* to add a set of range endpoints. Click the red *(x)* symbol to remove
|
||||
a range.
|
||||
After changing options, click the green *Apply changes* button to update your visualization, or the grey *Discard
|
||||
After changing options, click the *Apply changes* button to update your visualization, or the grey *Discard
|
||||
changes* button to keep your visualization in its current state.
|
||||
*Date Range*:: A {ref}search-aggregations-bucket-daterange-aggregation.html[_date range_] aggregation reports values
|
||||
that are within a range of dates that you specify. You can specify the ranges for the dates using
|
||||
|
@ -123,7 +123,7 @@ in the lower right corner.
|
|||
* *WMS styles*: A comma-separated list of the styles to use in this visualization. Each map server provides its own styling
|
||||
options.
|
||||
|
||||
After changing options, click the green *Apply changes* button to update your visualization, or the grey *Discard
|
||||
After changing options, click the *Apply changes* button to update your visualization, or the grey *Discard
|
||||
changes* button to keep your visualization in its current state.
|
||||
|
||||
[float]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[[visualize]]
|
||||
== Visualize
|
||||
|
||||
You can use the _Visualize_ page to design data visualizations. You can save these visualizations, use
|
||||
them individually, or combine visualizations into a _dashboard_. A visualization can be based on one of the following
|
||||
You can use the _Visualize_ page to design data visualizations. You can save these visualizations, use them
|
||||
individually, or combine visualizations into a _dashboard_. A visualization can be based on one of the following
|
||||
data source types:
|
||||
|
||||
* A new interactive search
|
||||
|
@ -15,9 +15,9 @@ Visualizations are based on the {ref}search-aggregations.html[aggregation] featu
|
|||
[[createvis]]
|
||||
=== Creating a New Visualization
|
||||
|
||||
To start the New Visualization wizard, click on the *Visualize* tab at the top left of the page. If you are already
|
||||
creating a visualization, you can click the *New Visualization* button image:images/K4NewDocument.png[New Document
|
||||
button] in the toolbar to the right of the search bar. The wizard guides you through the following steps:
|
||||
Click on the *Visualize* image:images/visualize-icon.png[chart icon] tab in the left-hand navigation bar. If you are
|
||||
already creating a visualization, you can click the *New* button in the toolbar. To set up your visualization, follow
|
||||
these steps:
|
||||
|
||||
[float]
|
||||
[[newvis01]]
|
||||
|
@ -38,8 +38,8 @@ dashboard.
|
|||
<<vertical-bar-chart,Vertical bar chart>>:: Use vertical bar charts as a general-purpose chart.
|
||||
|
||||
You can also load a saved visualization that you created earlier. The saved visualization selector includes a text
|
||||
field to filter by visualization name and a link to the Object Editor, accessible through *Settings > Edit Saved
|
||||
Objects*, to manage your saved visualizations.
|
||||
field to filter by visualization name and a link to the Object Editor, accessible through *Settings > Objects*, to
|
||||
manage your saved visualizations.
|
||||
|
||||
If your new visualization is a Markdown widget, selecting that type takes you to a text entry field where you enter the
|
||||
text to display in the widget. For all other types of visualization, selecting the type takes you to data source
|
||||
|
@ -128,7 +128,7 @@ inside each bucket, which in this example is a one-hour interval.
|
|||
|
||||
NOTE: Remember, each subsequent bucket slices the data from the previous bucket.
|
||||
|
||||
To render the visualization on the _preview canvas_, click the green *Apply Changes* button at the top right of the
|
||||
To render the visualization on the _preview canvas_, click the *Apply Changes* button at the top right of the
|
||||
Aggregation Builder.
|
||||
|
||||
You can learn more about aggregation and how altering the order of aggregations affects your visualizations
|
||||
|
@ -143,7 +143,7 @@ include::filter-pinning.asciidoc[]
|
|||
===== Preview Canvas
|
||||
|
||||
The preview canvas displays a preview of the visualization you've defined in the aggregation builder. To refresh the
|
||||
visualization preview, clicking the *Refresh* button image:images/K4Refresh.png[Refresh button] on the toolbar.
|
||||
visualization preview, clicking the *Apply Changes* image:images/apply-changes-button.png[] button on the toolbar.
|
||||
|
||||
include::area.asciidoc[]
|
||||
|
||||
|
|
|
@ -21,6 +21,6 @@ aggregation returns the percentile rankings for the values in the numeric field
|
|||
from the drop-down, then specify one or more percentile rank values in the *Values* fields. Click the *X* to remove a
|
||||
values field. Click *+Add* to add a values field.
|
||||
|
||||
You can add an aggregation by clicking the *+ Add Aggregation* button.
|
||||
You can add an aggregation by clicking the *+ Add Metrics* button.
|
||||
|
||||
Enter a string in the *Custom Label* field to change the display label.
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
"mkdirp": "0.5.1",
|
||||
"moment": "2.10.6",
|
||||
"moment-timezone": "0.4.1",
|
||||
"node-uuid": "1.4.7",
|
||||
"raw-loader": "0.5.1",
|
||||
"request": "2.61.0",
|
||||
"rimraf": "2.4.3",
|
||||
|
@ -144,7 +145,7 @@
|
|||
"wreck": "6.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@elastic/eslint-config-kibana": "0.0.2",
|
||||
"@elastic/eslint-config-kibana": "0.0.3",
|
||||
"Nonsense": "0.1.2",
|
||||
"angular-mocks": "1.4.7",
|
||||
"auto-release-sinon": "1.0.3",
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Server } from 'hapi';
|
|||
import { notFound } from 'boom';
|
||||
import { merge, sample } from 'lodash';
|
||||
import { format as formatUrl } from 'url';
|
||||
import { fromNode } from 'bluebird';
|
||||
import { map, fromNode } from 'bluebird';
|
||||
import { Agent as HttpsAgent } from 'https';
|
||||
import { readFileSync } from 'fs';
|
||||
|
||||
|
@ -40,7 +40,7 @@ export default class BasePathProxy {
|
|||
}
|
||||
|
||||
setupRoutes() {
|
||||
const { server, basePath, targetPort } = this;
|
||||
const { clusterManager, server, basePath, targetPort } = this;
|
||||
|
||||
server.route({
|
||||
method: 'GET',
|
||||
|
@ -53,6 +53,28 @@ export default class BasePathProxy {
|
|||
server.route({
|
||||
method: '*',
|
||||
path: `${basePath}/{kbnPath*}`,
|
||||
config: {
|
||||
pre: [
|
||||
(req, reply) => {
|
||||
map(clusterManager.workers, worker => {
|
||||
if (worker.type === 'server' && !worker.listening && !worker.crashed) {
|
||||
return fromNode(cb => {
|
||||
const done = () => {
|
||||
worker.removeListener('listening', done);
|
||||
worker.removeListener('crashed', done);
|
||||
cb();
|
||||
};
|
||||
|
||||
worker.on('listening', done);
|
||||
worker.on('crashed', done);
|
||||
});
|
||||
}
|
||||
})
|
||||
.return(undefined)
|
||||
.nodeify(reply);
|
||||
}
|
||||
],
|
||||
},
|
||||
handler: {
|
||||
proxy: {
|
||||
passThrough: true,
|
||||
|
|
|
@ -28,8 +28,12 @@ module.exports = class Worker extends EventEmitter {
|
|||
this.title = opts.title || opts.type;
|
||||
this.watch = (opts.watch !== false);
|
||||
this.startCount = 0;
|
||||
this.online = false;
|
||||
this.listening = false;
|
||||
|
||||
// status flags
|
||||
this.online = false; // the fork can accept messages
|
||||
this.listening = false; // the fork is listening for connections
|
||||
this.crashed = false; // the fork crashed
|
||||
|
||||
this.changes = [];
|
||||
|
||||
this.forkBinder = null; // defined when the fork is
|
||||
|
@ -56,8 +60,10 @@ module.exports = class Worker extends EventEmitter {
|
|||
this.online = false;
|
||||
this.listening = false;
|
||||
this.emit('fork:exit');
|
||||
this.crashed = code > 0;
|
||||
|
||||
if (code) {
|
||||
if (this.crashed) {
|
||||
this.emit('crashed');
|
||||
this.log.bad(`${this.title} crashed`, 'with status code', code);
|
||||
if (!this.watch) process.exit(code);
|
||||
} else {
|
||||
|
@ -85,7 +91,7 @@ module.exports = class Worker extends EventEmitter {
|
|||
this.processBinder.destroy();
|
||||
|
||||
// wait until the cluster reports this fork has exitted, then resolve
|
||||
await new Promise(cb => this.once('fork:exit', cb));
|
||||
await new Promise(resolve => this.once('fork:exit', resolve));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,6 +115,7 @@ module.exports = class Worker extends EventEmitter {
|
|||
onOnline() {
|
||||
this.online = true;
|
||||
this.emit('fork:online');
|
||||
this.crashed = false;
|
||||
}
|
||||
|
||||
onDisconnect() {
|
||||
|
@ -143,7 +150,7 @@ module.exports = class Worker extends EventEmitter {
|
|||
this.forkBinder = new BinderFor(this.fork);
|
||||
|
||||
// when the fork sends a message, comes online, or looses it's connection, then react
|
||||
this.forkBinder.on('message', (msg) => this.parseIncomingMessage(msg));
|
||||
this.forkBinder.on('message', msg => this.parseIncomingMessage(msg));
|
||||
this.forkBinder.on('online', () => this.onOnline());
|
||||
this.forkBinder.on('disconnect', () => this.onDisconnect());
|
||||
|
||||
|
|
|
@ -134,8 +134,11 @@ module.exports = function (program) {
|
|||
catch (err) {
|
||||
const { server } = kbnServer;
|
||||
|
||||
if (server) server.log(['fatal'], err);
|
||||
console.error('FATAL', err);
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
logFatal(`Port ${err.port} is already in use. Another instance of Kibana may be running!`, server);
|
||||
} else {
|
||||
logFatal(err, server);
|
||||
}
|
||||
|
||||
kbnServer.close();
|
||||
process.exit(1); // eslint-disable-line no-process-exit
|
||||
|
@ -144,3 +147,10 @@ module.exports = function (program) {
|
|||
return kbnServer;
|
||||
});
|
||||
};
|
||||
|
||||
function logFatal(message, server) {
|
||||
if (server) {
|
||||
server.log(['fatal'], message);
|
||||
}
|
||||
console.error('FATAL', message);
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ describe('kibana cli', function () {
|
|||
|
||||
const expected = [
|
||||
command,
|
||||
`https://download.elastic.co/packs/${command}/${command}-1234.zip`
|
||||
`https://download.elastic.co/kibana/${command}/${command}-1234.zip`
|
||||
];
|
||||
|
||||
expect(settings.urls).to.eql(expected);
|
||||
|
|
|
@ -40,8 +40,8 @@ export default function pluginInstall(program) {
|
|||
)
|
||||
.description('install a plugin',
|
||||
`Common examples:
|
||||
install xpack
|
||||
install file:///Path/to/my/xpack.zip
|
||||
install https://path.to/my/xpack.zip`)
|
||||
install x-pack
|
||||
install file:///Path/to/my/x-pack.zip
|
||||
install https://path.to/my/x-pack.zip`)
|
||||
.action(processCommand);
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ import { arch, platform } from 'os';
|
|||
function generateUrls({ version, plugin }) {
|
||||
return [
|
||||
plugin,
|
||||
`https://download.elastic.co/packs/${plugin}/${plugin}-${version}.zip`
|
||||
`https://download.elastic.co/kibana/${plugin}/${plugin}-${version}.zip`
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,6 @@ export default function pluginRemove(program) {
|
|||
)
|
||||
.description('remove a plugin',
|
||||
`common examples:
|
||||
remove xpack`)
|
||||
remove x-pack`)
|
||||
.action(processCommand);
|
||||
};
|
||||
|
|
|
@ -137,7 +137,8 @@ class BaseOptimizer {
|
|||
resolve: {
|
||||
extensions: ['.js', '.json', '.jsx', '.less', ''],
|
||||
postfixes: [''],
|
||||
modulesDirectories: ['webpackShims', 'node_modules', fromRoot('webpackShims'), fromRoot('node_modules')],
|
||||
modulesDirectories: ['webpackShims', 'node_modules'],
|
||||
fallback: [fromRoot('webpackShims'), fromRoot('node_modules')],
|
||||
loaderPostfixes: ['-loader', ''],
|
||||
root: fromRoot('.'),
|
||||
alias: this.env.aliases,
|
||||
|
|
34
src/plugins/console/.eslintrc
Normal file
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
|
||||
root: true
|
||||
extends: '@elastic/kibana'
|
||||
|
||||
rules:
|
||||
block-scoped-var: [0]
|
||||
camelcase: [0]
|
||||
curly: [0]
|
||||
dot-location: [0]
|
||||
dot-notation: [0]
|
||||
eqeqeq: [0]
|
||||
guard-for-in: [0]
|
||||
indent: [0]
|
||||
max-len: [0]
|
||||
new-cap: [0]
|
||||
no-caller: [0]
|
||||
no-empty: [0]
|
||||
no-extend-native: [0]
|
||||
no-loop-func: [0]
|
||||
no-multi-str: [0]
|
||||
no-nested-ternary: [0]
|
||||
no-proto: [0]
|
||||
no-sequences: [0]
|
||||
no-undef: [0]
|
||||
no-use-before-define: [0]
|
||||
one-var: [0]
|
||||
quotes: [0]
|
||||
space-before-blocks: [0]
|
||||
space-in-parens: [0]
|
||||
space-infix-ops: [0]
|
||||
semi: [0]
|
||||
strict: [0]
|
||||
wrap-iife: [0]
|
4
src/plugins/console/README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
Console
|
||||
=====
|
||||
|
||||
A JSON aware developer's interface to Elasticsearch. Comes with handy machinery such as syntax highlighting, API suggestions, formatting and code folding.
|
45
src/plugins/console/api_server/api.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
const _ = require("lodash");
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
function Api(name) {
|
||||
this.globalRules = {};
|
||||
this.endpoints = {};
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
(function (cls) {
|
||||
cls.addGlobalAutocompleteRules = function (parentNode, rules) {
|
||||
this.globalRules[parentNode] = rules;
|
||||
};
|
||||
|
||||
cls.addEndpointDescription = function (endpoint, description) {
|
||||
if (this.endpoints[endpoint]) {
|
||||
throw new Error("endpoint [" + endpoint + "] is already registered");
|
||||
}
|
||||
|
||||
var copiedDescription = {};
|
||||
_.extend(copiedDescription, description || {});
|
||||
_.defaults(copiedDescription, {
|
||||
id: endpoint,
|
||||
patterns: [endpoint],
|
||||
methods: ['GET']
|
||||
});
|
||||
this.endpoints[endpoint] = copiedDescription;
|
||||
};
|
||||
|
||||
cls.asJson = function () {
|
||||
return {
|
||||
"name": this.name,
|
||||
"globals": this.globalRules,
|
||||
"endpoints": this.endpoints
|
||||
}
|
||||
};
|
||||
|
||||
}(Api.prototype));
|
||||
|
||||
module.exports = Api;
|
56
src/plugins/console/api_server/es_1_0.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
let _ = require("lodash");
|
||||
let Api = require('./api');
|
||||
|
||||
let parts = [
|
||||
require('./es_1_0/aliases'),
|
||||
require('./es_1_0/aggregations'),
|
||||
require('./es_1_0/cat'),
|
||||
require('./es_1_0/cluster'),
|
||||
require('./es_1_0/count'),
|
||||
require('./es_1_0/document'),
|
||||
require('./es_1_0/facets'),
|
||||
require('./es_1_0/filter'),
|
||||
require('./es_1_0/nodes'),
|
||||
require('./es_1_0/globals'),
|
||||
require('./es_1_0/indices'),
|
||||
require('./es_1_0/mappings'),
|
||||
require('./es_1_0/percolator'),
|
||||
require('./es_1_0/query'),
|
||||
require('./es_1_0/snapshot_restore'),
|
||||
require('./es_1_0/search'),
|
||||
require('./es_1_0/settings'),
|
||||
require('./es_1_0/templates'),
|
||||
require('./es_1_0/warmers')
|
||||
];
|
||||
|
||||
function ES_1_0() {
|
||||
Api.call(this, "es_1_0");
|
||||
_.each(parts, function (apiSection) {
|
||||
apiSection(this);
|
||||
}, this);
|
||||
}
|
||||
|
||||
ES_1_0.prototype = _.create(Api.prototype, {'constructor': ES_1_0});
|
||||
|
||||
(function (cls) {
|
||||
cls.addEndpointDescription = function (endpoint, description) {
|
||||
if (description) {
|
||||
var url_params_def = {};
|
||||
_.each(description.patterns || [], function (p) {
|
||||
if (p.indexOf("{indices}") >= 0) {
|
||||
url_params_def["ignore_unavailable"] = "__flag__";
|
||||
url_params_def["allow_no_indices"] = "__flag__";
|
||||
url_params_def["expand_wildcards"] = ["open", "closed"];
|
||||
}
|
||||
});
|
||||
|
||||
if (url_params_def) {
|
||||
description.url_params = description.url_params || {};
|
||||
_.defaults(description.url_params, url_params_def);
|
||||
}
|
||||
}
|
||||
Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);
|
||||
};
|
||||
})(ES_1_0.prototype);
|
||||
|
||||
module.exports = new ES_1_0();
|
323
src/plugins/console/api_server/es_1_0/aggregations.js
Normal file
|
@ -0,0 +1,323 @@
|
|||
var simple_metric = {
|
||||
__template: {field: ""},
|
||||
field: "{field}",
|
||||
script: "",
|
||||
params: {},
|
||||
lang: "groovy"
|
||||
}, field_metric = {
|
||||
__template: {field: ""},
|
||||
field: "{field}"
|
||||
};
|
||||
var rules = {
|
||||
"*": {
|
||||
"aggs": {
|
||||
__template: {
|
||||
"NAME": {
|
||||
"AGG_TYPE": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"min": simple_metric,
|
||||
"max": simple_metric,
|
||||
"avg": simple_metric,
|
||||
"stats": simple_metric,
|
||||
"extended_stats": simple_metric,
|
||||
"value_count": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"field": "{field}",
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy"
|
||||
},
|
||||
"global": {},
|
||||
"filter": {},
|
||||
"missing": field_metric,
|
||||
"nested": {
|
||||
__template: {
|
||||
"path": ""
|
||||
},
|
||||
"path": ""
|
||||
},
|
||||
"reverse_nested": {
|
||||
__template: {
|
||||
"path": ""
|
||||
},
|
||||
"path": ""
|
||||
},
|
||||
"terms": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"size": 10
|
||||
},
|
||||
"field": "{field}",
|
||||
"size": 10,
|
||||
"shard_size": 10,
|
||||
"order": {
|
||||
__template: {
|
||||
"_term": "asc"
|
||||
},
|
||||
"_term": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"min_doc_count": 10,
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy",
|
||||
// TODO: these also support regex - extend!
|
||||
"include": "*",
|
||||
"exclude": "*",
|
||||
"execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash", "global_ordinals_low_cardinality"]},
|
||||
"show_term_doc_count_error": {__one_of: [true, false]},
|
||||
"collect_mode": {__one_of: ["depth_first", "breadth_first"]}
|
||||
},
|
||||
"significant_terms": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"field": "{field}",
|
||||
"size": 10,
|
||||
"shard_size": 10,
|
||||
"shard_min_doc_count": 10,
|
||||
"min_doc_count": 10,
|
||||
"include": {__one_of: ["*", {pattern: "", flags: ""}]},
|
||||
"exclude": {__one_of: ["*", {pattern: "", flags: ""}]},
|
||||
"execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash"]},
|
||||
"background_filter": {
|
||||
__scope_link: "GLOBAL.filter"
|
||||
},
|
||||
"mutual_information": {
|
||||
"include_negatives": {__one_of: [true, false]}
|
||||
},
|
||||
"chi_square": {
|
||||
"include_negatives": {__one_of: [true, false]},
|
||||
"background_is_superset": {__one_of: [true, false]}
|
||||
},
|
||||
"gnd": {
|
||||
"background_is_superset": {__one_of: [true, false]}
|
||||
}
|
||||
},
|
||||
"range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": 50, "to": 100},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"ranges": [
|
||||
{"to": 50, "from": 100, "key": ""}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy"
|
||||
},
|
||||
"date_range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": "now-10d/d", "to": "now"},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"format": "MM-yyy",
|
||||
"ranges": [
|
||||
{"to": "", "from": "", "key": ""}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy"
|
||||
},
|
||||
"ip_range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": "10.0.0.5", "to": "10.0.0.10"},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"format": "MM-yyy",
|
||||
"ranges": [
|
||||
{"to": "", "from": "", "key": "", "mask": "10.0.0.127/25"}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy"
|
||||
},
|
||||
"histogram": {
|
||||
__template: {
|
||||
"field": "price",
|
||||
"interval": 50
|
||||
},
|
||||
"field": "{field}",
|
||||
"interval": 50,
|
||||
"min_doc_count": 0,
|
||||
"order": {
|
||||
__template: {
|
||||
"_key": "asc"
|
||||
},
|
||||
"_key": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"keyed": {__one_of: [true, false]}
|
||||
|
||||
},
|
||||
"date_histogram": {
|
||||
__template: {
|
||||
"field": "date",
|
||||
"interval": "month"
|
||||
},
|
||||
"field": "{field}",
|
||||
"interval": {__one_of: ["year", "quarter", "week", "day", "hour", "minute", "second"]},
|
||||
"min_doc_count": 0,
|
||||
"order": {
|
||||
__template: {
|
||||
"_key": "asc"
|
||||
},
|
||||
"_key": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"pre_zone": "-01:00",
|
||||
"post_zone": "-01:00",
|
||||
"pre_zone_adjust_large_interval": {__one_of: [true, false]},
|
||||
"factor": 1000,
|
||||
"pre_offset": "1d",
|
||||
"post_offset": "1d",
|
||||
"format": "yyyy-MM-dd",
|
||||
"time_zone": "00:00"
|
||||
},
|
||||
"geo_distance": {
|
||||
__template: {
|
||||
"field": "location",
|
||||
"origin": {"lat": 52.3760, "lon": 4.894},
|
||||
"ranges": [
|
||||
{"from": 100, "to": 300},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"origin": {"lat": 0.0, "lon": 0.0},
|
||||
"unit": {__one_of: ["mi", "km", "in", "yd", "m", "cm", "mm"]},
|
||||
"ranges": [
|
||||
{"from": 50, "to": 100}
|
||||
],
|
||||
"distance_type": {__one_of: ["arc", "sloppy_arc", "plane"]}
|
||||
|
||||
},
|
||||
"geohash_grid": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"precision": 3
|
||||
},
|
||||
"field": "{field}",
|
||||
"precision": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},
|
||||
"size": 10,
|
||||
"shard_size": 10
|
||||
},
|
||||
"percentiles": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"percents": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]
|
||||
},
|
||||
"field": "{field}",
|
||||
"percents": {
|
||||
__template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],
|
||||
// mark type as list
|
||||
__any_of: []
|
||||
},
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy",
|
||||
"compression": 100
|
||||
},
|
||||
"cardinality": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"precision_threshold": 100,
|
||||
"rehash": true,
|
||||
"script": "_value",
|
||||
"script_id": "",
|
||||
"params": {},
|
||||
"lang": "groovy"
|
||||
},
|
||||
"scripted_metric": {
|
||||
__template: {
|
||||
"init_script": "",
|
||||
"map_script": "",
|
||||
"combine_script": "",
|
||||
"reduce_script": ""
|
||||
},
|
||||
"init_script": "",
|
||||
"map_script": "",
|
||||
"combine_script": "",
|
||||
"reduce_script": "",
|
||||
"lang": "groovy",
|
||||
"params": {},
|
||||
"reduce_params": {},
|
||||
"init_script_file": "",
|
||||
"init_script_id": "",
|
||||
"map_script_file": "",
|
||||
"map_script_id": "",
|
||||
"combine_script_file": "",
|
||||
"combine_script_id": "",
|
||||
"reduce_script_file": "",
|
||||
"reduce_script_id": ""
|
||||
},
|
||||
"geo_bounds": {
|
||||
__template: {
|
||||
field: ""
|
||||
},
|
||||
field: "{field}",
|
||||
wrap_longitude: {__one_of: [true, false]}
|
||||
},
|
||||
"top_hits": {
|
||||
__template: {
|
||||
size: 10
|
||||
},
|
||||
from: 0,
|
||||
size: 10,
|
||||
sort: {
|
||||
__template: [],
|
||||
__scope_link: "_search.sort"
|
||||
},
|
||||
highlight: {},
|
||||
explain: {__one_of: [true, false]},
|
||||
_source: {
|
||||
__template: "",
|
||||
__scope_link: "_search._source"
|
||||
},
|
||||
script_fields: {
|
||||
__scope_link: "_search.script_fields"
|
||||
},
|
||||
fielddata_fields: ["{field}"],
|
||||
version: {__one_of: [true, false]}
|
||||
},
|
||||
"percentile_ranks": {
|
||||
__template: {
|
||||
field: "",
|
||||
values: [10, 15]
|
||||
},
|
||||
field: "{field}",
|
||||
values: []
|
||||
}
|
||||
}
|
||||
};
|
||||
module.exports = function (api) {
|
||||
|
||||
api.addGlobalAutocompleteRules('aggregations', rules);
|
||||
api.addGlobalAutocompleteRules('aggs', rules);
|
||||
};
|
71
src/plugins/console/api_server/es_1_0/aliases.js
Normal file
|
@ -0,0 +1,71 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_post_aliases', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_aliases",
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
'actions': {
|
||||
__template: [
|
||||
{'add': {'index': 'test1', 'alias': 'alias1'}}
|
||||
],
|
||||
__any_of: [
|
||||
{
|
||||
add: {
|
||||
index: '{index}',
|
||||
alias: '',
|
||||
filter: {},
|
||||
routing: '1',
|
||||
search_routing: '1,2',
|
||||
index_routing: '1'
|
||||
},
|
||||
remove: {
|
||||
index: '',
|
||||
alias: ''
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_get_aliases', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_aliases",
|
||||
]
|
||||
});
|
||||
|
||||
var aliasRules = {
|
||||
filter: {},
|
||||
routing: '1',
|
||||
search_routing: '1,2',
|
||||
index_routing: '1'
|
||||
};
|
||||
|
||||
api.addEndpointDescription('_post_alias', {
|
||||
methods: ["POST", "PUT"],
|
||||
patterns: [
|
||||
"{indices}/_alias/{name}"
|
||||
],
|
||||
data_autocomplete_rules: aliasRules
|
||||
});
|
||||
api.addEndpointDescription('_delete_alias', {
|
||||
methods: ["DELETE"],
|
||||
patterns: [
|
||||
"{indices}/_alias/{name}"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_get_alias', {
|
||||
methods: ["GET"],
|
||||
patterns: [
|
||||
"_alias",
|
||||
"{indices}/_alias",
|
||||
"{indices}/_alias/{name}",
|
||||
"_alias/{name}"
|
||||
]
|
||||
});
|
||||
|
||||
api.addGlobalAutocompleteRules('aliases', {
|
||||
'*': aliasRules
|
||||
});
|
||||
};
|
41
src/plugins/console/api_server/es_1_0/cat.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
let _ = require("lodash");
|
||||
|
||||
function addSimpleCat(endpoint, api, params, patterns) {
|
||||
var url_params = {"help": "__flag__", "v": "__flag__", "bytes": ["b"]};
|
||||
_.each(params || [], function (p) {
|
||||
if (_.isString(p)) {
|
||||
url_params[p] = "__flag__";
|
||||
}
|
||||
else {
|
||||
var k = Object.keys(p)[0];
|
||||
url_params[k] = p[k];
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription(endpoint, {
|
||||
match: endpoint,
|
||||
url_params: url_params,
|
||||
patterns: patterns || [endpoint]
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = function (api) {
|
||||
addSimpleCat('_cat/aliases', api);
|
||||
addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);
|
||||
addSimpleCat('_cat/count', api);
|
||||
addSimpleCat('_cat/health', api, [
|
||||
{"ts": ["false", "true"]}
|
||||
]);
|
||||
addSimpleCat('_cat/indices', api, [
|
||||
{h: []},
|
||||
"pri",
|
||||
],
|
||||
['_cat/indices', '_cat/indices/{indices}']);
|
||||
addSimpleCat('_cat/master', api);
|
||||
addSimpleCat('_cat/nodes', api);
|
||||
addSimpleCat('_cat/pending_tasks', api);
|
||||
addSimpleCat('_cat/recovery', api);
|
||||
addSimpleCat('_cat/thread_pool', api);
|
||||
addSimpleCat('_cat/shards', api);
|
||||
addSimpleCat('_cat/plugins', api);
|
||||
addSimpleCat('_cat/segments', api);
|
||||
};
|
142
src/plugins/console/api_server/es_1_0/cluster.js
Normal file
|
@ -0,0 +1,142 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_cluster/nodes/stats');
|
||||
api.addEndpointDescription('_cluster/state', {
|
||||
patterns: [
|
||||
"_cluster/state",
|
||||
"_cluster/state/{metrics}",
|
||||
"_cluster/state/{metrics}/{indices}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": ["version", "master_node", "nodes", "routing_table", "metadata", "blocks"]
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_cluster/health', {
|
||||
url_params: {
|
||||
"local": "__flag__",
|
||||
"level": ["indices", "shards"],
|
||||
"master_timeout": "30s",
|
||||
"timeout": "30s",
|
||||
"wait_for_status": ["yellow", "green"],
|
||||
"wait_for_relocating_shards": 0,
|
||||
"wait_for_active_shards": 0,
|
||||
"wait_for_nodes": 0
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_cluster/pending_tasks');
|
||||
api.addEndpointDescription('get_cluster/settings', {
|
||||
patterns: [
|
||||
'_cluster/settings'
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('put_cluster/settings', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
'_cluster/settings'
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
persistent: {
|
||||
cluster: {
|
||||
routing: {
|
||||
'allocation.enable': {__one_of: ["all", "primaries", "new_primaries", "none"]},
|
||||
'allocation.disk.threshold_enabled': {__one_of: [false, true]},
|
||||
'allocation.disk.watermark.low': '85%',
|
||||
'allocation.disk.watermark.high': '90%',
|
||||
'allocation.disk.include_relocations': {__one_of: [true, false]},
|
||||
'allocation.disk.reroute_interval': '60s',
|
||||
'allocation.exclude': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.include': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.require': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.awareness.attributes': [],
|
||||
'allocation.awareness.force': {
|
||||
'*': {
|
||||
'values': []
|
||||
}
|
||||
},
|
||||
'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']},
|
||||
'allocation.cluster_concurrent_rebalance': 2,
|
||||
'allocation.node_initial_primaries_recoveries': 4,
|
||||
'allocation.node_concurrent_recoveries': 2,
|
||||
'allocation.same_shard.host': {__one_of: [false, true]}
|
||||
}
|
||||
},
|
||||
indices: {
|
||||
breaker: {
|
||||
"total.limit": "70%",
|
||||
"fielddata.limit": "60%",
|
||||
"fielddata.overhead": 1.03,
|
||||
"request.limit": "40%",
|
||||
"request.overhead": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
transient: {
|
||||
__scope_link: '.persistent'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_cluster/reroute', {
|
||||
methods: ['POST'],
|
||||
url_params: {
|
||||
explain: "__flag__",
|
||||
dry_run: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
commands: [
|
||||
{
|
||||
move: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
from_node: "",
|
||||
to_node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
from_node: "{node}",
|
||||
to_node: "{node}"
|
||||
},
|
||||
cancel: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
node: "{node}",
|
||||
allow_primary: {__one_of: [true, false]}
|
||||
},
|
||||
allocate: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
node: "{node}",
|
||||
allow_primary: {__one_of: [true, false]}
|
||||
}
|
||||
}
|
||||
],
|
||||
dry_run: {__one_of: [true, false]}
|
||||
}
|
||||
});
|
||||
};
|
22
src/plugins/console/api_server/es_1_0/count.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_count', {
|
||||
methods: ['GET', 'POST'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/{types}/_count",
|
||||
"{indices}/_count",
|
||||
"_count"
|
||||
],
|
||||
url_params: {
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
routing: "",
|
||||
min_score: 1.0,
|
||||
terminate_after: 10,
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
},
|
||||
}
|
||||
})
|
||||
};
|
221
src/plugins/console/api_server/es_1_0/document.js
Normal file
|
@ -0,0 +1,221 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_get_doc', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"_source": "",
|
||||
"_source_exclude": "",
|
||||
"_source_include": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_get_doc_source', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_source"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"_source_exclude": "",
|
||||
"_source_include": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_delete_doc', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('index_doc', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"op_type": ["create"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"replication": ["sync", "async"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('create_doc', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_create"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"replication": ["sync", "async"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('index_doc_no_id', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"{index}/{type}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"replication": ["sync", "async"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_update', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_update"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["force", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"replication": ["sync", "async"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m",
|
||||
"retry_on_conflict": 3,
|
||||
"fields": ""
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
"script": "",
|
||||
"script_id": "",
|
||||
"lang": "groovy",
|
||||
"params": {},
|
||||
"doc": {},
|
||||
"upsert": {},
|
||||
"scripted_upsert": {__one_of: [true, false]}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_put_script', {
|
||||
methods: ['POST', 'PUT'],
|
||||
patterns: [
|
||||
"_scripts/{lang}/{id}",
|
||||
"_scripts/{lang}/{id}/_create"
|
||||
],
|
||||
url_components: {
|
||||
"lang": [
|
||||
"groovy",
|
||||
"expressions"
|
||||
]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
"script": ""
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_termvectors', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/_termvectors"
|
||||
],
|
||||
priority: 10, // collides with get doc by id
|
||||
url_params: {
|
||||
"fields": "",
|
||||
"offsets": "__flag__",
|
||||
"payloads": "__flag__",
|
||||
"positions": "__flag__",
|
||||
"term_statistics": "__flag__",
|
||||
"field_statistics": "__flag__",
|
||||
"routing": "",
|
||||
"version": 1,
|
||||
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
"parent": "",
|
||||
"preference": ""
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
fields: [
|
||||
"{field}"
|
||||
],
|
||||
offsets: {__one_of: [false, true]},
|
||||
payloads: {__one_of: [false, true]},
|
||||
positions: {__one_of: [false, true]},
|
||||
term_statistics: {__one_of: [true, false]},
|
||||
field_statistics: {__one_of: [false, true]},
|
||||
per_field_analyzer: {
|
||||
__template: {"FIELD": ""},
|
||||
"{field}": ""
|
||||
},
|
||||
routing: "",
|
||||
version: 1,
|
||||
version_type: ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
doc: {}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_termvectors_id', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_termvectors"
|
||||
],
|
||||
url_params: {
|
||||
"fields": "",
|
||||
"offsets": "__flag__",
|
||||
"payloads": "__flag__",
|
||||
"positions": "__flag__",
|
||||
"term_statistics": "__flag__",
|
||||
"field_statistics": "__flag__",
|
||||
"routing": "",
|
||||
"version": 1,
|
||||
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
"parent": "",
|
||||
"preference": ""
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
fields: [
|
||||
"{field}"
|
||||
],
|
||||
"offsets": {__one_of: [false, true]},
|
||||
"payloads": {__one_of: [false, true]},
|
||||
"positions": {__one_of: [false, true]},
|
||||
"term_statistics": {__one_of: [true, false]},
|
||||
"field_statistics": {__one_of: [false, true]},
|
||||
"dfs": {__one_of: [true, false]},
|
||||
"per_field_analyzer": {
|
||||
__template: {"FIELD": ""},
|
||||
"{field}": ""
|
||||
},
|
||||
"routing": "",
|
||||
"version": 1,
|
||||
"version_type": ["external", "external_gt", "external_gte", "force", "internal"]
|
||||
}
|
||||
});
|
||||
|
||||
};
|
114
src/plugins/console/api_server/es_1_0/facets.js
Normal file
|
@ -0,0 +1,114 @@
|
|||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('facets', {
|
||||
'*': {
|
||||
terms: {
|
||||
__template: {
|
||||
field: 'FIELD',
|
||||
size: 10
|
||||
},
|
||||
field: '{field}',
|
||||
fields: ['{field}'],
|
||||
size: 10,
|
||||
script: '',
|
||||
script_field: '',
|
||||
order: {
|
||||
__one_of: ['count', 'term', 'reverse_count', 'reverse_term']
|
||||
},
|
||||
all_terms: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
exclude: ['TERM'],
|
||||
regex: '',
|
||||
regex_flags: ''
|
||||
},
|
||||
range: {
|
||||
__template: {
|
||||
field: 'FIELD',
|
||||
ranges: [
|
||||
{
|
||||
'to': 50
|
||||
},
|
||||
{
|
||||
'from': 20,
|
||||
'to': 70
|
||||
},
|
||||
{
|
||||
'from': 70,
|
||||
'to': 120
|
||||
},
|
||||
{
|
||||
'from': 150
|
||||
}
|
||||
]
|
||||
},
|
||||
field: '{field}',
|
||||
ranges: [
|
||||
{
|
||||
to: 10,
|
||||
from: 20
|
||||
}
|
||||
]
|
||||
},
|
||||
histogram: {
|
||||
__template: {
|
||||
field: 'FIELD',
|
||||
interval: 100
|
||||
},
|
||||
field: '{field}',
|
||||
interval: 100,
|
||||
time_interval: '1.5h',
|
||||
key_field: '{field}',
|
||||
value_field: '{field}',
|
||||
key_script: '',
|
||||
value_script: '',
|
||||
params: {}
|
||||
},
|
||||
date_histogram: {
|
||||
__template: {
|
||||
field: 'FIELD',
|
||||
'interval': 'day'
|
||||
},
|
||||
field: '{field}',
|
||||
interval: {
|
||||
__one_of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', '1h', '1d', '1w']
|
||||
},
|
||||
post_zone: -1,
|
||||
pre_zone: -1,
|
||||
factor: 1000,
|
||||
pre_offset: '1d',
|
||||
post_offset: '1d',
|
||||
key_field: '{field}',
|
||||
value_field: '{field}',
|
||||
value_script: ''
|
||||
},
|
||||
filter: {},
|
||||
query: {},
|
||||
facet_filter: {
|
||||
__scope_link: 'GLOBAL.filter'
|
||||
},
|
||||
statistical: {
|
||||
__template: {
|
||||
field: 'FIELD'
|
||||
},
|
||||
field: '{field}',
|
||||
fields: ['{field}'],
|
||||
script: ''
|
||||
},
|
||||
terms_stats: {
|
||||
__template: {
|
||||
key_field: 'FIELD',
|
||||
value_field: 'FIELD'
|
||||
},
|
||||
key_field: '{field}',
|
||||
value_field: '{field}',
|
||||
value_script: '',
|
||||
size: 10,
|
||||
order: {
|
||||
__one_of: ['count', 'term', 'reverse_term', 'reverse_count', 'total', 'reverse_total',
|
||||
'min', 'reverse_min', 'max', 'reverse_max', 'mean', 'reverse_mean'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
405
src/plugins/console/api_server/es_1_0/filter.js
Normal file
|
@ -0,0 +1,405 @@
|
|||
var filters = {};
|
||||
|
||||
filters.and = {
|
||||
__template: {
|
||||
filters: [
|
||||
{}
|
||||
]
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.bool = {
|
||||
must: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
must_not: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
should: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.exists = {
|
||||
__template: {
|
||||
'field': 'FIELD_NAME'
|
||||
},
|
||||
'field': '{field}'
|
||||
};
|
||||
|
||||
|
||||
filters.ids = {
|
||||
__template: {
|
||||
'values': ['ID']
|
||||
},
|
||||
'type': '{type}',
|
||||
'values': ['']
|
||||
};
|
||||
|
||||
|
||||
filters.limit = {
|
||||
__template: {
|
||||
value: 100
|
||||
},
|
||||
value: 100
|
||||
};
|
||||
|
||||
|
||||
filters.type = {
|
||||
__template: {
|
||||
value: 'TYPE'
|
||||
},
|
||||
value: '{type}'
|
||||
};
|
||||
|
||||
|
||||
filters.geo_bounding_box = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'top_left': {
|
||||
'lat': 40.73,
|
||||
'lon': -74.1
|
||||
},
|
||||
'bottom_right': {
|
||||
'lat': 40.717,
|
||||
'lon': -73.99
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'{field}': {
|
||||
top_left: {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
bottom_right: {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
type: {
|
||||
__one_of: ['memory', 'indexed']
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_distance = {
|
||||
__template: {
|
||||
distance: 100,
|
||||
distance_unit: 'km',
|
||||
'FIELD': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
distance: 100,
|
||||
distance_unit: {
|
||||
__one_of: ['km', 'miles']
|
||||
},
|
||||
distance_type: {
|
||||
__one_of: ['arc', 'plane']
|
||||
},
|
||||
optimize_bbox: {
|
||||
__one_of: ['memory', 'indexed', 'none']
|
||||
},
|
||||
'{field}': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_distance_range = {
|
||||
__template: {
|
||||
from: 100,
|
||||
to: 200,
|
||||
distance_unit: 'km',
|
||||
'FIELD': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
from: 100,
|
||||
to: 200,
|
||||
|
||||
distance_unit: {
|
||||
__one_of: ['km', 'miles']
|
||||
},
|
||||
distance_type: {
|
||||
__one_of: ['arc', 'plane']
|
||||
},
|
||||
include_lower: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
include_upper: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
|
||||
'{field}': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_polygon = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'points': [
|
||||
{
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
{
|
||||
lat: 40.83,
|
||||
lon: -75.1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
points: [
|
||||
{
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
]
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_shape = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
shape: {
|
||||
type: 'envelope',
|
||||
coordinates: [
|
||||
[-45, 45],
|
||||
[45, -45]
|
||||
]
|
||||
},
|
||||
'relation': 'within'
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
shape: {
|
||||
type: '',
|
||||
coordinates: []
|
||||
},
|
||||
indexed_shape: {
|
||||
id: '',
|
||||
index: '{index}',
|
||||
type: '{type}',
|
||||
shape_field_name: 'shape'
|
||||
},
|
||||
relation: {
|
||||
__one_of: ['within', 'intersects', 'disjoint']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.has_child = {
|
||||
__template: {
|
||||
type: 'TYPE',
|
||||
filter: {}
|
||||
},
|
||||
type: '{type}',
|
||||
query: {},
|
||||
filter: {},
|
||||
_scope: '',
|
||||
min_children: 1,
|
||||
max_children: 10
|
||||
};
|
||||
|
||||
|
||||
filters.has_parent = {
|
||||
__template: {
|
||||
parent_type: 'TYPE',
|
||||
filter: {}
|
||||
},
|
||||
parent_type: '{type}',
|
||||
query: {},
|
||||
filter: {},
|
||||
_scope: ''
|
||||
};
|
||||
|
||||
|
||||
filters.m = filters.missing = {
|
||||
__template: {
|
||||
field: 'FIELD'
|
||||
},
|
||||
existence: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
null_value: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
field: '{field}'
|
||||
};
|
||||
|
||||
|
||||
filters.not = {
|
||||
__template: {
|
||||
filter: {}
|
||||
},
|
||||
filter: {},
|
||||
_cache: {
|
||||
__one_of: [true, false]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.range = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
}
|
||||
},
|
||||
"{field}": {
|
||||
gte: 1,
|
||||
gt: 1,
|
||||
lte: 20,
|
||||
lt: 20,
|
||||
time_zone: "+1:00",
|
||||
execution: {__one_of: ["index", "fielddata"]}
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
_cache_key: ""
|
||||
};
|
||||
|
||||
|
||||
filters.or = {
|
||||
__template: {
|
||||
filters: [
|
||||
{}
|
||||
]
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.prefix = {
|
||||
__template: {
|
||||
'FIELD': 'VALUE'
|
||||
},
|
||||
'{field}': '',
|
||||
_cache: {
|
||||
__one_of: [true, false]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.query = {
|
||||
// global query
|
||||
};
|
||||
|
||||
|
||||
filters.fquery = {
|
||||
__template: {
|
||||
query: {},
|
||||
_cache: true
|
||||
},
|
||||
query: {
|
||||
//global query
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [true, false]
|
||||
}
|
||||
};
|
||||
|
||||
filters.script = {
|
||||
__template: {
|
||||
script: 'SCRIPT',
|
||||
params: {}
|
||||
},
|
||||
script: '',
|
||||
params: {},
|
||||
_cache: {
|
||||
__one_of: [true, false]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.term = {
|
||||
__template: {
|
||||
'FIELD': 'VALUE'
|
||||
},
|
||||
'{field}': '',
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.terms = {
|
||||
__template: {
|
||||
'FIELD': ['VALUE1', 'VALUE2']
|
||||
},
|
||||
field: ['{field}'],
|
||||
execution: {
|
||||
__one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']
|
||||
},
|
||||
_cache: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.nested = {
|
||||
__template: {
|
||||
path: 'path_to_nested_doc',
|
||||
query: {}
|
||||
},
|
||||
query: {},
|
||||
path: '',
|
||||
_cache: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
_name: ''
|
||||
};
|
||||
|
||||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('filter', filters);
|
||||
};
|
21
src/plugins/console/api_server/es_1_0/globals.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('highlight', {
|
||||
pre_tags: {},
|
||||
post_tags: {},
|
||||
tags_schema: {},
|
||||
fields: {
|
||||
'{field}': {
|
||||
fragment_size: 20,
|
||||
number_of_fragments: 3
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// only used with scope links as there is no common name for scripts
|
||||
api.addGlobalAutocompleteRules('SCRIPT_ENV', {
|
||||
__template: {'script': ''},
|
||||
script: '',
|
||||
lang: '',
|
||||
params: {}
|
||||
});
|
||||
};
|
208
src/plugins/console/api_server/es_1_0/indices.js
Normal file
|
@ -0,0 +1,208 @@
|
|||
module.exports = function (api) {
|
||||
|
||||
api.addEndpointDescription('_refresh', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_refresh",
|
||||
"{indices}/_refresh"
|
||||
],
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_flush', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_flush",
|
||||
"{indices}/_flush"
|
||||
],
|
||||
url_params: {
|
||||
wait_if_ongoing: [true, false],
|
||||
force: [true, false]
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_flush_synced', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_flush/synced",
|
||||
"{indices}/_flush/synced"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_stats', {
|
||||
patterns: [
|
||||
"_stats",
|
||||
"_stats/{metrics}",
|
||||
"{indices}/_stats",
|
||||
"{indices}/_stats/{metrics}",
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"docs",
|
||||
"store",
|
||||
"indexing",
|
||||
"search",
|
||||
"get",
|
||||
"merge",
|
||||
"refresh",
|
||||
"flush",
|
||||
"warmer",
|
||||
"filter_cache",
|
||||
"id_cache",
|
||||
"percolate",
|
||||
"segments",
|
||||
"fielddata",
|
||||
"completion",
|
||||
"translog",
|
||||
"query_cache",
|
||||
"commit",
|
||||
"_all"
|
||||
]
|
||||
},
|
||||
url_params: {
|
||||
"fields": [],
|
||||
"types": [],
|
||||
"completion_fields": [],
|
||||
"fielddata_fields": [],
|
||||
"level": ["cluster", "indices", "shards"]
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_segments', {
|
||||
patterns: [
|
||||
"{indices}/_segments",
|
||||
"_segments"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_recovery', {
|
||||
patterns: [
|
||||
"{indices}/_recovery",
|
||||
"_recovery"
|
||||
],
|
||||
url_params: {
|
||||
detailed: "__flag__",
|
||||
active_only: "__flag__",
|
||||
human: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_analyze', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/_analyze",
|
||||
"_analyze"
|
||||
],
|
||||
url_params: {
|
||||
"analyzer": "",
|
||||
"char_filters": [],
|
||||
"field": "",
|
||||
"filters": [],
|
||||
"text": "",
|
||||
"tokenizer": ""
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_validate_query', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/_validate/query",
|
||||
"_validate/query"
|
||||
],
|
||||
url_params: {
|
||||
explain: "__flag__",
|
||||
rewrite: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('__create_index__', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{index}"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
mappings: {
|
||||
__scope_link: '_put_mapping'
|
||||
},
|
||||
settings: {
|
||||
__scope_link: '_put_settings'
|
||||
},
|
||||
aliases: {
|
||||
__template: {
|
||||
"NAME": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('__delete_indices__', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"{indices}"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_get_index_settings', {
|
||||
methods: ['GET',],
|
||||
patterns: [
|
||||
"{indices}/_settings",
|
||||
],
|
||||
url_params: {
|
||||
flat_settings: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_get_index', {
|
||||
methods: ['GET',],
|
||||
patterns: [
|
||||
"{indices}",
|
||||
"{indices}/{feature}"
|
||||
],
|
||||
url_components: {
|
||||
"feature": [
|
||||
"_mappings",
|
||||
"_warmers",
|
||||
"_aliases"
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_cache/clear', {
|
||||
patterns: [
|
||||
"_cache/clear",
|
||||
"{indices}/_cache/clear"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_status', {
|
||||
patterns: [
|
||||
"_status",
|
||||
"{indices}/_status"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_upgrade', {
|
||||
methods: ["POST"],
|
||||
patterns: [
|
||||
"_upgrade",
|
||||
"{indices}/_upgrade"
|
||||
],
|
||||
url_params: {
|
||||
wait_for_completion: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_upgrade_status', {
|
||||
methods: ["GET"],
|
||||
patterns: [
|
||||
"_upgrade",
|
||||
"{indices}/_upgrade"
|
||||
]
|
||||
});
|
||||
|
||||
};
|
265
src/plugins/console/api_server/es_1_0/mappings.js
Normal file
|
@ -0,0 +1,265 @@
|
|||
var INDEX_SETTING = {
|
||||
__one_of: ['analyzed', 'not_analyzed', 'no']
|
||||
}, BOOLEAN = {
|
||||
__one_of: [true, false]
|
||||
};
|
||||
|
||||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_get_mapping', {
|
||||
methods: ['GET'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping",
|
||||
"{indices}/_mapping/{types}",
|
||||
"{indices}/{types}/_mapping",
|
||||
"_mapping"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_get_field_mapping', {
|
||||
methods: ['GET'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping/field/{fields}",
|
||||
"{indices}/_mapping/{type}/field/{fields}"
|
||||
],
|
||||
url_params: {
|
||||
"include_defaults": "__flag__"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_delete_mapping', {
|
||||
methods: ['DELETE'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping",
|
||||
"{indices}/_mapping/{types}",
|
||||
"{indices}/{types}/_mapping",
|
||||
"_mapping"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_put_type_mapping', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/{type}/_mapping",
|
||||
"{indices}/_mapping/{type}"
|
||||
],
|
||||
priority: 10, // collides with put doc by id
|
||||
data_autocomplete_rules: {
|
||||
__template: {
|
||||
properties: {
|
||||
'FIELD': {}
|
||||
}
|
||||
},
|
||||
'_id': {
|
||||
'index': INDEX_SETTING,
|
||||
'store': BOOLEAN,
|
||||
'path': ""
|
||||
},
|
||||
'_type': {
|
||||
'index': INDEX_SETTING,
|
||||
'store': BOOLEAN
|
||||
},
|
||||
'_source': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_all': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_analyzer': {
|
||||
'path': ""
|
||||
},
|
||||
'_field_names': {
|
||||
'index': INDEX_SETTING
|
||||
},
|
||||
'_routing': {
|
||||
'required': BOOLEAN,
|
||||
'path': ""
|
||||
},
|
||||
'_index': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_size': {
|
||||
'enabled': BOOLEAN,
|
||||
'store': BOOLEAN
|
||||
},
|
||||
'_parent': {
|
||||
__template: {
|
||||
'type': ''
|
||||
},
|
||||
'type': '{type}'
|
||||
},
|
||||
'_timestamp': {
|
||||
'enabled': BOOLEAN,
|
||||
'path': '',
|
||||
'format': 'YYYY-MM-dd',
|
||||
'default': ""
|
||||
},
|
||||
'index_analyzer': 'standard',
|
||||
'search_analyzer': 'standard',
|
||||
'analyzer': 'standard',
|
||||
'dynamic_date_formats': ['yyyy-MM-dd'],
|
||||
'date_detection': BOOLEAN,
|
||||
'numeric_detection': BOOLEAN,
|
||||
'transform': {
|
||||
__template: {
|
||||
script: ""
|
||||
},
|
||||
__one_of: [
|
||||
{
|
||||
script: "",
|
||||
params: {},
|
||||
lang: "groovy"
|
||||
},
|
||||
[
|
||||
{
|
||||
script: "",
|
||||
params: {},
|
||||
lang: "groovy"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
},
|
||||
'properties': {
|
||||
'*': {
|
||||
type: {
|
||||
__one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',
|
||||
'binary', 'object', 'nested', "geo_point", "geo_shape"
|
||||
]
|
||||
},
|
||||
|
||||
// strings
|
||||
index_name: '',
|
||||
store: BOOLEAN,
|
||||
index: INDEX_SETTING,
|
||||
term_vector: {
|
||||
__one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']
|
||||
},
|
||||
boost: 1.0,
|
||||
null_value: '',
|
||||
omit_norms: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
index_options: {
|
||||
__one_of: ['docs', 'freqs', 'positions']
|
||||
},
|
||||
analyzer: 'standard',
|
||||
index_analyzer: 'standard',
|
||||
search_analyzer: 'standard',
|
||||
include_in_all: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
ignore_above: 10,
|
||||
position_offset_gap: 0,
|
||||
|
||||
// numeric
|
||||
precision_step: 4,
|
||||
ignore_malformed: BOOLEAN,
|
||||
|
||||
// geo_point
|
||||
lat_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
geohash: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
geohash_precision: '1m',
|
||||
geohash_prefix: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate_lat: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize_lat: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
|
||||
// geo_shape
|
||||
tree: {
|
||||
__one_of: ['geohash', 'quadtree']
|
||||
},
|
||||
precision: '5km',
|
||||
tree_levels: 12,
|
||||
distance_error_pct: 0.025,
|
||||
orientation: 'ccw',
|
||||
|
||||
// dates
|
||||
format: {
|
||||
__one_of: ['basic_date', 'basic_date_time', 'basic_date_time_no_millis',
|
||||
'basic_ordinal_date', 'basic_ordinal_date_time', 'basic_ordinal_date_time_no_millis',
|
||||
'basic_time', 'basic_time_no_millis', 'basic_t_time', 'basic_t_time_no_millis',
|
||||
'basic_week_date', 'basic_week_date_time', 'basic_week_date_time_no_millis',
|
||||
'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',
|
||||
'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',
|
||||
'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',
|
||||
'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',
|
||||
't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',
|
||||
'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day'
|
||||
]
|
||||
},
|
||||
|
||||
fielddata: {
|
||||
filter: {
|
||||
regex: '',
|
||||
frequency: {
|
||||
min: 0.001,
|
||||
max: 0.1,
|
||||
min_segment_size: 500
|
||||
}
|
||||
}
|
||||
},
|
||||
postings_format: {
|
||||
__one_of: ['direct', 'memory', 'pulsing', 'bloom_default', 'bloom_pulsing', 'default']
|
||||
},
|
||||
similarity: {
|
||||
__one_of: ['default', 'BM25']
|
||||
},
|
||||
|
||||
// objects
|
||||
properties: {
|
||||
__scope_link: '_put_mapping.{type}.properties'
|
||||
},
|
||||
|
||||
// multi_field
|
||||
path: {
|
||||
__one_of: ['just_name', 'full']
|
||||
},
|
||||
fields: {
|
||||
'*': {
|
||||
__scope_link: '_put_mapping.type.properties.field'
|
||||
}
|
||||
},
|
||||
copy_to: {__one_of: ['{field}', ['{field}']]},
|
||||
|
||||
// nested
|
||||
include_in_parent: BOOLEAN,
|
||||
include_in_root: BOOLEAN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
api.addEndpointDescription('_put_mapping', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{indices}/_mapping"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
'{type}': {
|
||||
__scope_link: '_put_type_mapping'
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
77
src/plugins/console/api_server/es_1_0/nodes.js
Normal file
|
@ -0,0 +1,77 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_nodes/hot_threads', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_nodes/hot_threads",
|
||||
"_nodes/{nodes}/hot_threads"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_nodes/info', {
|
||||
patterns: [
|
||||
"_nodes",
|
||||
"_nodes/{metrics}",
|
||||
"_nodes/{nodes}",
|
||||
"_nodes/{nodes}/{metrics}",
|
||||
"_nodes/{nodes}/info/{metrics}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"settings",
|
||||
"os",
|
||||
"process",
|
||||
"jvm",
|
||||
"thread_pool",
|
||||
"network",
|
||||
"transport",
|
||||
"http",
|
||||
"plugins",
|
||||
"_all"
|
||||
]
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_nodes/stats', {
|
||||
patterns: [
|
||||
"_nodes/stats",
|
||||
"_nodes/stats/{metrics}",
|
||||
"_nodes/stats/{metrics}/{index_metric}",
|
||||
"_nodes/{nodes}/stats",
|
||||
"_nodes/{nodes}/stats/{metrics}",
|
||||
"_nodes/{nodes}/stats/{metrics}/{index_metric}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"os",
|
||||
"jvm",
|
||||
"thread_pool",
|
||||
"network",
|
||||
"fs",
|
||||
"transport",
|
||||
"http",
|
||||
"indices",
|
||||
"process",
|
||||
"breaker",
|
||||
"_all"
|
||||
],
|
||||
"index_metric": [
|
||||
"store",
|
||||
"indexing",
|
||||
"get",
|
||||
"search",
|
||||
"merge",
|
||||
"flush",
|
||||
"refresh",
|
||||
"filter_cache",
|
||||
"id_cache",
|
||||
"fielddata",
|
||||
"docs",
|
||||
"warmer",
|
||||
"percolate",
|
||||
"completion",
|
||||
"segments",
|
||||
"translog",
|
||||
"query_cache",
|
||||
"_all"
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|
91
src/plugins/console/api_server/es_1_0/percolator.js
Normal file
|
@ -0,0 +1,91 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_put_percolator', {
|
||||
priority: 10, // to override doc
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{index}/.percolator/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"op_type": ["create"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"replication": ["sync", "async"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_percolate', {
|
||||
methods: ['GET', 'POST'],
|
||||
priority: 10, // to override doc
|
||||
patterns: [
|
||||
"{indices}/{type}/_percolate"
|
||||
],
|
||||
url_params: {
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
routing: "",
|
||||
ignore_unavailable: ["true", "false"],
|
||||
percolate_format: ["ids"]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
doc: {},
|
||||
query: {},
|
||||
filter: {},
|
||||
size: 10,
|
||||
track_scores: {__one_of: [true, false]},
|
||||
sort: "_score",
|
||||
aggs: {},
|
||||
highlight: {}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_percolate_id', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/{type}/{id}/_percolate"
|
||||
],
|
||||
url_params: {
|
||||
routing: "",
|
||||
ignore_unavailable: ["true", "false"],
|
||||
percolate_format: ["ids"],
|
||||
percolate_index: "{index}",
|
||||
percolate_type: "{type}",
|
||||
percolate_routing: "",
|
||||
percolate_preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
version: 1,
|
||||
version_type: ["external", "internal"]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {},
|
||||
filter: {},
|
||||
size: 10,
|
||||
track_scores: {__one_of: [true, false]},
|
||||
sort: "_score",
|
||||
aggs: {},
|
||||
highlight: {}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_percolate_count', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/{type}/_percolate/count"
|
||||
],
|
||||
url_params: {
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
routing: "",
|
||||
ignore_unavailable: ["true", "false"],
|
||||
percolate_format: ["ids"]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
doc: {},
|
||||
query: {},
|
||||
filter: {}
|
||||
}
|
||||
});
|
||||
};
|
589
src/plugins/console/api_server/es_1_0/query.js
Normal file
|
@ -0,0 +1,589 @@
|
|||
let _ = require("lodash");
|
||||
|
||||
var SPAN_QUERIES = {
|
||||
// TODO add one_of for objects
|
||||
span_first: {
|
||||
__scope_link: '.span_first'
|
||||
},
|
||||
span_near: {
|
||||
__scope_link: '.span_near'
|
||||
},
|
||||
span_or: {
|
||||
__scope_link: '.span_or'
|
||||
},
|
||||
span_not: {
|
||||
__scope_link: '.span_not'
|
||||
},
|
||||
span_term: {
|
||||
__scope_link: '.span_term'
|
||||
}
|
||||
};
|
||||
|
||||
var DECAY_FUNC_DESC = {
|
||||
__template: {
|
||||
"FIELD": {
|
||||
"origin": "",
|
||||
"scale": ""
|
||||
}
|
||||
},
|
||||
"{field}": {
|
||||
"origin": "",
|
||||
"scale": "",
|
||||
"offset": "",
|
||||
"decay": 0.5
|
||||
}
|
||||
},
|
||||
SCORING_FUNCS = {
|
||||
"script_score": {
|
||||
__template: {
|
||||
"script": "_score * doc['f'].value"
|
||||
},
|
||||
"script": "",
|
||||
"script_id": "",
|
||||
"lang": "groovy",
|
||||
"params": {}
|
||||
},
|
||||
"boost_factor": 2.0,
|
||||
"random_score": {
|
||||
"seed": 314159265359
|
||||
},
|
||||
"linear": DECAY_FUNC_DESC,
|
||||
"exp": DECAY_FUNC_DESC,
|
||||
"gauss": DECAY_FUNC_DESC,
|
||||
"field_value_factor": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"field": "{field}",
|
||||
"factor": 1.2,
|
||||
"modifier": {
|
||||
__one_of: ["none", "log", "log1p", "log2p", "ln", "ln1p", "ln2p", "square", "sqrt", "reciprocal"]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('query', {
|
||||
match: {
|
||||
__template: {
|
||||
'FIELD': 'TEXT'
|
||||
},
|
||||
'{field}': {
|
||||
'query': '',
|
||||
'operator': {
|
||||
__one_of: ['and', 'or']
|
||||
},
|
||||
'type': {
|
||||
__one_of: ['phrase', 'phrase_prefix', 'boolean']
|
||||
},
|
||||
'max_expansions': 10,
|
||||
'analyzer': '',
|
||||
'fuzziness': 1.0,
|
||||
'prefix_length': 1
|
||||
}
|
||||
},
|
||||
match_phrase: {
|
||||
__template: {
|
||||
'FIELD': 'PHRASE'
|
||||
},
|
||||
'{field}': {
|
||||
query: '',
|
||||
analyzer: ''
|
||||
}
|
||||
},
|
||||
match_phrase_prefix: {
|
||||
__template: {
|
||||
'FIELD': 'PREFIX'
|
||||
},
|
||||
'{field}': {
|
||||
query: '',
|
||||
analyzer: '',
|
||||
max_expansions: 10,
|
||||
prefix_length: 1,
|
||||
fuzziness: 0.1
|
||||
}
|
||||
},
|
||||
multi_match: {
|
||||
__template: {
|
||||
'query': '',
|
||||
'fields': []
|
||||
},
|
||||
query: '',
|
||||
fields: ['{field}'],
|
||||
use_dis_max: {
|
||||
__template: true,
|
||||
__one_of: [true, false]
|
||||
},
|
||||
tie_breaker: 0.0,
|
||||
type: {__one_of: ['best_fields', 'most_fields', 'cross_fields', 'phrase', 'phrase_prefix']}
|
||||
},
|
||||
bool: {
|
||||
must: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
must_not: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
should: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
minimum_number_should_match: 1,
|
||||
boost: 1.0
|
||||
},
|
||||
boosting: {
|
||||
positive: {
|
||||
__scope_link: '.'
|
||||
},
|
||||
negative: {
|
||||
__scope_link: '.'
|
||||
},
|
||||
negative_boost: 0.2
|
||||
},
|
||||
ids: {
|
||||
type: '',
|
||||
values: []
|
||||
},
|
||||
constant_score: {
|
||||
__template: {
|
||||
filter: {},
|
||||
boost: 1.2
|
||||
},
|
||||
query: {},
|
||||
filter: {},
|
||||
boost: 1.2
|
||||
},
|
||||
dis_max: {
|
||||
__template: {
|
||||
tie_breaker: 0.7,
|
||||
boost: 1.2,
|
||||
queries: []
|
||||
},
|
||||
tie_breaker: 0.7,
|
||||
boost: 1.2,
|
||||
queries: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
]
|
||||
},
|
||||
field: {
|
||||
'{field}': {
|
||||
query: '',
|
||||
boost: 2.0,
|
||||
enable_position_increments: {
|
||||
__template: false,
|
||||
__one_of: [true, false]
|
||||
}
|
||||
}
|
||||
},
|
||||
filtered: {
|
||||
__template: {
|
||||
query: {},
|
||||
filter: {}
|
||||
},
|
||||
query: {},
|
||||
filter: {}
|
||||
},
|
||||
fuzzy_like_this: {
|
||||
fields: [],
|
||||
like_text: '',
|
||||
max_query_terms: 12
|
||||
},
|
||||
flt: {
|
||||
__scope_link: '.fuzzy_like_this'
|
||||
},
|
||||
fuzzy: {
|
||||
'{field}': {
|
||||
'value': '',
|
||||
'boost': 1.0,
|
||||
'min_similarity': 0.5,
|
||||
'prefix_length': 0
|
||||
}
|
||||
},
|
||||
has_child: {
|
||||
__template: {
|
||||
type: 'TYPE',
|
||||
query: {}
|
||||
},
|
||||
'type': '{type}',
|
||||
'score_mode': {
|
||||
__one_of: ['none', 'max', 'sum', 'avg']
|
||||
},
|
||||
'_scope': '',
|
||||
'query': {},
|
||||
'min_children': 1,
|
||||
'max_children': 10
|
||||
},
|
||||
has_parent: {
|
||||
__template: {
|
||||
parent_type: 'TYPE',
|
||||
query: {}
|
||||
},
|
||||
'parent_type': '{type}',
|
||||
'score_mode': {
|
||||
__one_of: ['none', 'score']
|
||||
},
|
||||
'_scope': '',
|
||||
'query': {}
|
||||
},
|
||||
match_all: {},
|
||||
more_like_this: {
|
||||
__template: {
|
||||
'fields': ['FIELD'],
|
||||
'like_text': 'text like this one',
|
||||
'min_term_freq': 1,
|
||||
'max_query_terms': 12
|
||||
},
|
||||
fields: ['{field}'],
|
||||
like_text: '',
|
||||
percent_terms_to_match: 0.3,
|
||||
min_term_freq: 2,
|
||||
max_query_terms: 25,
|
||||
stop_words: [''],
|
||||
min_doc_freq: 5,
|
||||
max_doc_freq: 100,
|
||||
min_word_len: 0,
|
||||
max_word_len: 0,
|
||||
boost_terms: 1,
|
||||
boost: 1.0,
|
||||
analyzer: '',
|
||||
docs: [{
|
||||
_index: "{index}",
|
||||
_type: "{type}",
|
||||
_id: ""
|
||||
}],
|
||||
ids: [""]
|
||||
},
|
||||
mlt: {
|
||||
__template: {
|
||||
'fields': ['FIELD'],
|
||||
'like_text': 'text like this one',
|
||||
'min_term_freq': 1,
|
||||
'max_query_terms': 12
|
||||
},
|
||||
__scope_link: ".more_like_this"
|
||||
},
|
||||
more_like_this_field: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'like_text': 'text like this one',
|
||||
'min_term_freq': 1,
|
||||
'max_query_terms': 12
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
like_text: '',
|
||||
percent_terms_to_match: 0.3,
|
||||
min_term_freq: 2,
|
||||
max_query_terms: 25,
|
||||
stop_words: [''],
|
||||
min_doc_freq: 5,
|
||||
max_doc_freq: 100,
|
||||
min_word_len: 0,
|
||||
max_word_len: 0,
|
||||
boost_terms: 1,
|
||||
boost: 1.0,
|
||||
analyzer: ''
|
||||
}
|
||||
},
|
||||
prefix: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'value': ''
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
value: '',
|
||||
boost: 1.0
|
||||
}
|
||||
},
|
||||
query_string: {
|
||||
__template: {
|
||||
'default_field': 'FIELD',
|
||||
'query': 'this AND that OR thus'
|
||||
},
|
||||
query: '',
|
||||
default_field: '{field}',
|
||||
fields: ['{field}'],
|
||||
default_operator: {
|
||||
__one_of: ['OR', 'AND']
|
||||
},
|
||||
analyzer: '',
|
||||
allow_leading_wildcard: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
lowercase_expanded_terms: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
enable_position_increments: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
fuzzy_max_expansions: 50,
|
||||
fuzzy_min_sim: 0.5,
|
||||
fuzzy_prefix_length: 0,
|
||||
phrase_slop: 0,
|
||||
boost: 1.0,
|
||||
analyze_wildcard: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
auto_generate_phrase_queries: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
minimum_should_match: '20%',
|
||||
lenient: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
use_dis_max: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
tie_breaker: 0
|
||||
},
|
||||
simple_query_string: {
|
||||
__template: {
|
||||
query: "",
|
||||
fields: []
|
||||
},
|
||||
query: "",
|
||||
fields: ["{field}"],
|
||||
default_operator: {__one_of: ["OR", "AND"]},
|
||||
analyzer: "",
|
||||
flags: "OR|AND|PREFIX",
|
||||
lowercase_expanded_terms: {__one_of: [true, false]},
|
||||
locale: "ROOT",
|
||||
lenient: {__one_of: [true, false]}
|
||||
},
|
||||
range: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
__template: {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
},
|
||||
gte: 10,
|
||||
gt: 10,
|
||||
lte: 20,
|
||||
lt: 20,
|
||||
time_zone: "+1:00",
|
||||
boost: 1.0
|
||||
}
|
||||
},
|
||||
span_first: {
|
||||
__template: {
|
||||
'match': {
|
||||
'span_term': {
|
||||
'FIELD': 'VALUE'
|
||||
}
|
||||
},
|
||||
'end': 3
|
||||
},
|
||||
match: SPAN_QUERIES
|
||||
},
|
||||
span_near: {
|
||||
__template: {
|
||||
'clauses': [
|
||||
{
|
||||
span_term: {
|
||||
'FIELD': {
|
||||
'value': 'VALUE'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
slop: 12,
|
||||
in_order: false
|
||||
},
|
||||
clauses: [
|
||||
SPAN_QUERIES
|
||||
],
|
||||
slop: 12,
|
||||
in_order: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
collect_payloads: {
|
||||
__one_of: [false, true]
|
||||
}
|
||||
},
|
||||
span_term: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'value': 'VALUE'
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
value: '',
|
||||
boost: 2.0
|
||||
}
|
||||
},
|
||||
span_not: {
|
||||
__template: {
|
||||
include: {
|
||||
span_term: {
|
||||
'FIELD': {
|
||||
'value': 'VALUE'
|
||||
}
|
||||
}
|
||||
},
|
||||
exclude: {
|
||||
span_term: {
|
||||
'FIELD': {
|
||||
'value': 'VALUE'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
include: SPAN_QUERIES,
|
||||
exclude: SPAN_QUERIES
|
||||
},
|
||||
span_or: {
|
||||
__template: {
|
||||
clauses: [
|
||||
{
|
||||
span_term: {
|
||||
'FIELD': {
|
||||
'value': 'VALUE'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
clauses: [
|
||||
SPAN_QUERIES
|
||||
]
|
||||
},
|
||||
term: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
value: 'VALUE'
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
value: '',
|
||||
boost: 2.0
|
||||
}
|
||||
},
|
||||
terms: {
|
||||
__template: {
|
||||
'FIELD': ['VALUE1', 'VALUE2']
|
||||
},
|
||||
'{field}': [''],
|
||||
minimum_match: 1
|
||||
},
|
||||
top_children: {
|
||||
__template: {
|
||||
type: 'CHILD_TYPE',
|
||||
query: {}
|
||||
},
|
||||
type: '$CHILD_TYPE$',
|
||||
query: {},
|
||||
score: {
|
||||
__one_of: ['max', 'sum', 'avg']
|
||||
},
|
||||
factor: 5,
|
||||
incremental_factor: 2
|
||||
},
|
||||
wildcard: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
value: 'VALUE'
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
value: '',
|
||||
boost: 2.0
|
||||
}
|
||||
},
|
||||
nested: {
|
||||
__template: {
|
||||
path: 'path_to_nested_doc',
|
||||
query: {}
|
||||
},
|
||||
path: '',
|
||||
query: {},
|
||||
filter: {},
|
||||
score_mode: {
|
||||
__one_of: ['avg', 'total', 'max', 'none']
|
||||
}
|
||||
},
|
||||
custom_filters_score: {
|
||||
__template: {
|
||||
query: {},
|
||||
filters: [
|
||||
{
|
||||
filter: {}
|
||||
}
|
||||
]
|
||||
},
|
||||
query: {},
|
||||
filters: [
|
||||
{
|
||||
filter: {},
|
||||
boost: 2.0,
|
||||
script: ''
|
||||
}
|
||||
],
|
||||
score_mode: {
|
||||
__one_of: ['first', 'min', 'max', 'total', 'avg', 'multiply']
|
||||
},
|
||||
max_boost: 2.0,
|
||||
params: {},
|
||||
lang: ''
|
||||
},
|
||||
indices: {
|
||||
__template: {
|
||||
indices: ['INDEX1', 'INDEX2'],
|
||||
query: {}
|
||||
},
|
||||
indices: ['{index}'],
|
||||
query: {},
|
||||
no_match_query: {
|
||||
__scope_link: '.'
|
||||
}
|
||||
},
|
||||
geo_shape: {
|
||||
__template: {
|
||||
location: {},
|
||||
relation: 'within'
|
||||
},
|
||||
__scope_link: '.filter.geo_shape'
|
||||
},
|
||||
// js hint gets confused here
|
||||
/* jshint -W015 */
|
||||
function_score: _.defaults({
|
||||
__template: {
|
||||
query: {},
|
||||
functions: [
|
||||
{}
|
||||
]
|
||||
},
|
||||
query: {},
|
||||
filter: {},
|
||||
functions: [
|
||||
_.defaults(
|
||||
{
|
||||
filter: {},
|
||||
weight: 1.0
|
||||
},
|
||||
SCORING_FUNCS
|
||||
)
|
||||
],
|
||||
boost: 1.0,
|
||||
boost_mode: {__one_of: ["multiply", "replace", "sum", "avg", "max", "min"]},
|
||||
score_mode: {__one_of: ["multiply", "sum", "first", "avg", "max", "min"]},
|
||||
max_boost: 10
|
||||
},
|
||||
SCORING_FUNCS
|
||||
)
|
||||
|
||||
});
|
||||
};
|
238
src/plugins/console/api_server/es_1_0/search.js
Normal file
|
@ -0,0 +1,238 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_search', {
|
||||
methods: ['GET', 'POST'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/{types}/_search",
|
||||
"{indices}/_search",
|
||||
"_search"
|
||||
],
|
||||
url_params: {
|
||||
q: "",
|
||||
df: "",
|
||||
analyzer: "",
|
||||
default_operator: ["AND", "OR"],
|
||||
explain: "__flag__",
|
||||
_source: "",
|
||||
_source_include: "",
|
||||
_source_exclude: "",
|
||||
fields: [],
|
||||
sort: "",
|
||||
track_scores: "__flag__",
|
||||
timeout: 1,
|
||||
from: 0,
|
||||
size: 10,
|
||||
search_type: ["dfs_query_then_fetch", "dfs_query_and_fetch", "query_then_fetch", "query_and_fetch", "count", "scan"],
|
||||
terminate_after: 10,
|
||||
lowercase_expanded_terms: ["true", "false"],
|
||||
analyze_wildcard: "__flag__",
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
scroll: "5m",
|
||||
scroll_id: "",
|
||||
routing: "",
|
||||
query_cache: ["true", "false"]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
},
|
||||
facets: {
|
||||
__template: {
|
||||
'NAME': {
|
||||
'TYPE': {}
|
||||
}
|
||||
}
|
||||
// populated by a global rule
|
||||
},
|
||||
aggs: {
|
||||
__template: {
|
||||
"NAME": {
|
||||
"AGG_TYPE": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
post_filter: {
|
||||
__scope_link: 'GLOBAL.filter'
|
||||
},
|
||||
size: {
|
||||
__template: 20
|
||||
},
|
||||
from: 0,
|
||||
sort: {
|
||||
__template: [
|
||||
{
|
||||
'FIELD': {
|
||||
'order': 'desc'
|
||||
}
|
||||
}
|
||||
],
|
||||
__any_of: [
|
||||
{
|
||||
'{field}': {
|
||||
'order': {
|
||||
__one_of: ['desc', 'asc']
|
||||
},
|
||||
missing: {
|
||||
__one_of: ['_last', '_first']
|
||||
},
|
||||
mode: {
|
||||
__one_of: ['min', 'max', 'avg', 'sum']
|
||||
},
|
||||
nested_path: "",
|
||||
nested_filter: {
|
||||
__scope_link: "GLOBAL.filter"
|
||||
}
|
||||
}
|
||||
},
|
||||
'{field}',
|
||||
'_score',
|
||||
{
|
||||
'_geo_distance': {
|
||||
__template: {
|
||||
"FIELD": {
|
||||
lat: 40,
|
||||
lon: -70
|
||||
},
|
||||
order: "asc"
|
||||
},
|
||||
"{field}": {
|
||||
__one_of: [
|
||||
{
|
||||
__template: {
|
||||
lat: 40,
|
||||
lon: -70
|
||||
},
|
||||
lat: 40,
|
||||
lon: -70
|
||||
},
|
||||
[
|
||||
{
|
||||
__template: {
|
||||
lat: 40,
|
||||
lon: -70
|
||||
},
|
||||
lat: 40,
|
||||
lon: -70
|
||||
}
|
||||
],
|
||||
[""],
|
||||
""
|
||||
]
|
||||
},
|
||||
distance_type: {__one_of: ["sloppy_arc", "arc", "plane"]},
|
||||
sort_mode: {__one_of: ["min", "max", "avg"]},
|
||||
order: {__one_of: ["asc", "desc"]},
|
||||
unit: "km"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
fields: ['{field}'],
|
||||
fielddata_fields: ["{field}"],
|
||||
script_fields: {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'script': ''
|
||||
}
|
||||
},
|
||||
'*': {
|
||||
__scope_link: 'GLOBAL.SCRIPT_ENV'
|
||||
}
|
||||
},
|
||||
partial_fields: {
|
||||
__template: {
|
||||
'NAME': {
|
||||
include: []
|
||||
}
|
||||
},
|
||||
'*': {
|
||||
include: [],
|
||||
exclude: []
|
||||
}
|
||||
},
|
||||
highlight: {
|
||||
// populated by a global rule
|
||||
},
|
||||
_source: {
|
||||
__one_of: [
|
||||
"{field}",
|
||||
["{field}"],
|
||||
{
|
||||
"include": {
|
||||
__one_of: [
|
||||
"{field}",
|
||||
["{field}"]
|
||||
]
|
||||
},
|
||||
"exclude": {
|
||||
__one_of: [
|
||||
"{field}",
|
||||
["{field}"]
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
explain: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
stats: [''],
|
||||
timeout: "1s",
|
||||
version: {__one_of: [true, false]}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_search_template', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{indices}/{types}/_search/template",
|
||||
"{indices}/_search/template",
|
||||
"_search/template"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
"template": {
|
||||
__one_of: [
|
||||
{__scope_link: "_search"},
|
||||
{"file": ""},
|
||||
{"id": ""}
|
||||
]
|
||||
},
|
||||
"params": {}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_get_delete_search_template', {
|
||||
methods: ['GET', 'DELETE'],
|
||||
patterns: [
|
||||
"_search/template/{id}"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_put_search_template', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"_search/template/{id}"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
"template": {
|
||||
__scope_link: "_search"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_search_shards', {
|
||||
methods: ['GET'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/{types}/_search_shards",
|
||||
"{indices}/_search_shards",
|
||||
"_search_shards"
|
||||
],
|
||||
url_params: {
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
routing: "",
|
||||
local: "__flag__"
|
||||
}
|
||||
});
|
||||
};
|
83
src/plugins/console/api_server/es_1_0/settings.js
Normal file
|
@ -0,0 +1,83 @@
|
|||
module.exports = function (api) {
|
||||
|
||||
api.addEndpointDescription('_get_settings', {
|
||||
patterns: [
|
||||
"{indices}/_settings",
|
||||
"_settings"
|
||||
],
|
||||
url_params: {
|
||||
flat_settings: "__flag__"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_put_settings', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{indices}/_settings",
|
||||
"_settings"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
refresh_interval: '1s',
|
||||
number_of_shards: 5,
|
||||
number_of_replicas: 1,
|
||||
'blocks.read_only': {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
'blocks.read': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
'blocks.write': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
'blocks.metadata': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
term_index_interval: 32,
|
||||
term_index_divisor: 1,
|
||||
'translog.flush_threshold_ops': 5000,
|
||||
'translog.flush_threshold_size': '200mb',
|
||||
'translog.flush_threshold_period': '30m',
|
||||
'translog.disable_flush': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
'cache.filter.max_size': '2gb',
|
||||
'cache.filter.expire': '2h',
|
||||
'gateway.snapshot_interval': '10s',
|
||||
routing: {
|
||||
allocation: {
|
||||
include: {
|
||||
tag: ''
|
||||
},
|
||||
exclude: {
|
||||
tag: ''
|
||||
},
|
||||
require: {
|
||||
tag: ''
|
||||
},
|
||||
total_shards_per_node: -1
|
||||
}
|
||||
},
|
||||
'recovery.initial_shards': {
|
||||
__one_of: ['quorum', 'quorum-1', 'half', 'full', 'full-1']
|
||||
},
|
||||
'ttl.disable_purge': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
analysis: {
|
||||
analyzer: {},
|
||||
tokenizer: {},
|
||||
filter: {},
|
||||
char_filter: {}
|
||||
},
|
||||
'cache.query.enable': {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
shadow_replicas: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
shared_filesystem: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
data_path: 'path'
|
||||
}
|
||||
});
|
||||
};
|
153
src/plugins/console/api_server/es_1_0/snapshot_restore.js
Normal file
|
@ -0,0 +1,153 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('restore_snapshot', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
'_snapshot/{id}/{id}/_restore'
|
||||
],
|
||||
url_params: {
|
||||
wait_for_completion: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
indices: "*",
|
||||
ignore_unavailable: {__one_of: [true, false]},
|
||||
include_global_state: false,
|
||||
rename_pattern: "index_(.+)",
|
||||
rename_replacement: "restored_index_$1"
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
api.addEndpointDescription('single_snapshot', {
|
||||
methods: ['GET', 'DELETE'],
|
||||
patterns: [
|
||||
'_snapshot/{id}/{id}'
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('all_snapshots', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
'_snapshot/{id}/_all'
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('put_snapshot', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
'_snapshot/{id}/{id}'
|
||||
],
|
||||
url_params: {
|
||||
wait_for_completion: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
indices: "*",
|
||||
ignore_unavailable: {__one_of: [true, false]},
|
||||
include_global_state: {__one_of: [true, false]},
|
||||
partial: {__one_of: [true, false]}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_snapshot_status', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
'_snapshot/_status',
|
||||
'_snapshot/{id}/_status',
|
||||
'_snapshot/{id}/{ids}/_status'
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
function getRepositoryType(context, editor) {
|
||||
var iter = editor.iterForCurrentLoc();
|
||||
// for now just iterate back to the first "type" key
|
||||
var t = iter.getCurrentToken();
|
||||
var type;
|
||||
while (t && t.type.indexOf("url") < 0) {
|
||||
if (t.type === 'variable' && t.value === '"type"') {
|
||||
t = editor.parser.nextNonEmptyToken(iter);
|
||||
if (!t || t.type !== "punctuation.colon") {
|
||||
// weird place to be in, but safe choice..
|
||||
break;
|
||||
}
|
||||
t = editor.parser.nextNonEmptyToken(iter);
|
||||
if (t && t.type === "string") {
|
||||
type = t.value.replace(/"/g, '');
|
||||
}
|
||||
break;
|
||||
}
|
||||
t = editor.parser.prevNonEmptyToken(iter);
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
api.addEndpointDescription('put_repository', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
'_snapshot/{id}'
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
__template: {"type": ""},
|
||||
|
||||
"type": {
|
||||
__one_of: ["fs", "url", "s3", "hdfs"]
|
||||
},
|
||||
"settings": {
|
||||
__one_of: [{
|
||||
//fs
|
||||
__condition: {
|
||||
lines_regex: String.raw`type["']\s*:\s*["']fs`
|
||||
},
|
||||
__template: {
|
||||
location: "path"
|
||||
},
|
||||
location: "path",
|
||||
compress: {__one_of: [true, false]},
|
||||
concurrent_streams: 5,
|
||||
chunk_size: "10m",
|
||||
max_restore_bytes_per_sec: "20mb",
|
||||
max_snapshot_bytes_per_sec: "20mb"
|
||||
},
|
||||
{// url
|
||||
__condition: {
|
||||
lines_regex: String.raw`type["']\s*:\s*["']url`
|
||||
},
|
||||
__template: {
|
||||
url: ""
|
||||
},
|
||||
url: "",
|
||||
concurrent_streams: 5
|
||||
},
|
||||
{ //s3
|
||||
__condition: {
|
||||
lines_regex: String.raw`type["']\s*:\s*["']s3`
|
||||
},
|
||||
__template: {
|
||||
bucket: ""
|
||||
},
|
||||
bucket: "",
|
||||
region: "",
|
||||
base_path: "",
|
||||
concurrent_streams: 5,
|
||||
chunk_size: "10m",
|
||||
compress: {__one_of: [true, false]}
|
||||
},
|
||||
{// hdfs
|
||||
__condition: {
|
||||
lines_regex: String.raw`type["']\s*:\s*["']hdfs`
|
||||
},
|
||||
__template: {
|
||||
path: ""
|
||||
},
|
||||
uri: "",
|
||||
path: "some/path",
|
||||
load_defaults: {__one_of: [true, false]},
|
||||
conf_location: "cfg.xml",
|
||||
concurrent_streams: 5,
|
||||
compress: {__one_of: [true, false]},
|
||||
chunk_size: "10m"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
27
src/plugins/console/api_server/es_1_0/templates.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_delete_template', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"_template/{id}",
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_get_template', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_template/{id}",
|
||||
"_template",
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_put_template', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"_template/{id}",
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
template: 'index*',
|
||||
warmers: {__scope_link: '_warmer'},
|
||||
mappings: {__scope_link: '_put_mapping'},
|
||||
settings: {__scope_link: '_put_settings'}
|
||||
}
|
||||
});
|
||||
};
|
30
src/plugins/console/api_server/es_1_0/warmers.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_get_warmer', {
|
||||
patterns: ["_warmer", "_warmer/{name}", "{indices}/_warmer", "{indices}/_warmer/{name}"]
|
||||
});
|
||||
api.addEndpointDescription('_delete_warmer', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"{indices}/_warmer/{name}"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_put_warmer', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{indices}/_warmer/{name}",
|
||||
"{indices}/{types}/_warmer/{name}"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
},
|
||||
facets: {
|
||||
// populated by a global rule
|
||||
},
|
||||
aggs: {},
|
||||
sort: {
|
||||
__scope_link: "_search.sort"
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
55
src/plugins/console/api_server/es_2_0.js
Normal file
|
@ -0,0 +1,55 @@
|
|||
let _ = require("lodash");
|
||||
let Api = require('./api');
|
||||
let parts = [
|
||||
require('./es_2_0/aliases'),
|
||||
require('./es_2_0/aggregations'),
|
||||
require('./es_2_0/cat'),
|
||||
require('./es_2_0/cluster'),
|
||||
require('./es_2_0/count'),
|
||||
require('./es_2_0/document'),
|
||||
require('./es_2_0/field_stats'),
|
||||
require('./es_2_0/filter'),
|
||||
require('./es_2_0/nodes'),
|
||||
require('./es_2_0/globals'),
|
||||
require('./es_2_0/indices'),
|
||||
require('./es_2_0/mappings'),
|
||||
require('./es_2_0/percolator'),
|
||||
require('./es_2_0/query'),
|
||||
require('./es_2_0/snapshot_restore'),
|
||||
require('./es_2_0/search'),
|
||||
require('./es_2_0/settings'),
|
||||
require('./es_2_0/templates'),
|
||||
require('./es_2_0/warmers')
|
||||
];
|
||||
|
||||
function ES_2_0() {
|
||||
Api.call(this, "es_2_0");
|
||||
_.each(parts, function (apiSection) {
|
||||
apiSection(this);
|
||||
}, this);
|
||||
}
|
||||
|
||||
ES_2_0.prototype = _.create(Api.prototype, {'constructor': ES_2_0});
|
||||
|
||||
(function (cls) {
|
||||
cls.addEndpointDescription = function (endpoint, description) {
|
||||
if (description) {
|
||||
var url_params_def = {};
|
||||
_.each(description.patterns || [], function (p) {
|
||||
if (p.indexOf("{indices}") >= 0) {
|
||||
url_params_def["ignore_unavailable"] = "__flag__";
|
||||
url_params_def["allow_no_indices"] = "__flag__";
|
||||
url_params_def["expand_wildcards"] = ["open", "closed"];
|
||||
}
|
||||
});
|
||||
|
||||
if (url_params_def) {
|
||||
description.url_params = description.url_params || {};
|
||||
_.defaults(description.url_params, url_params_def);
|
||||
}
|
||||
}
|
||||
Object.getPrototypeOf(cls).addEndpointDescription.call(this, endpoint, description);
|
||||
};
|
||||
})(ES_2_0.prototype);
|
||||
|
||||
module.exports = new ES_2_0();
|
436
src/plugins/console/api_server/es_2_0/aggregations.js
Normal file
|
@ -0,0 +1,436 @@
|
|||
var simple_metric = {
|
||||
__template: {field: ""},
|
||||
field: "{field}",
|
||||
missing: 0,
|
||||
script: {
|
||||
// populated by a global rule
|
||||
}
|
||||
}, field_metric = {
|
||||
__template: {field: ""},
|
||||
field: "{field}"
|
||||
}, gap_policy = {
|
||||
__one_of: ["skip", "insert_zeros"]
|
||||
}, simple_pipeline = {
|
||||
__template: {
|
||||
buckets_path: ""
|
||||
},
|
||||
buckets_path: "",
|
||||
format: "",
|
||||
gap_policy: gap_policy
|
||||
};
|
||||
var rules = {
|
||||
"*": {
|
||||
"aggs": {
|
||||
__template: {
|
||||
"NAME": {
|
||||
"AGG_TYPE": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"min": simple_metric,
|
||||
"max": simple_metric,
|
||||
"avg": simple_metric,
|
||||
"sum": simple_metric,
|
||||
"stats": simple_metric,
|
||||
"extended_stats": simple_metric,
|
||||
"value_count": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"field": "{field}",
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
}
|
||||
},
|
||||
"global": {},
|
||||
"filter": {},
|
||||
"filters": {
|
||||
__template: {
|
||||
"filters": {
|
||||
"NAME": {}
|
||||
}
|
||||
},
|
||||
"filters": {
|
||||
"*": {__scope_link: "GLOBAL.filter"}
|
||||
},
|
||||
"other_bucket": {__one_of: [true, false]},
|
||||
"other_bucket_key": ""
|
||||
},
|
||||
"missing": field_metric,
|
||||
"nested": {
|
||||
__template: {
|
||||
"path": ""
|
||||
},
|
||||
"path": ""
|
||||
},
|
||||
"reverse_nested": {
|
||||
__template: {
|
||||
"path": ""
|
||||
},
|
||||
"path": ""
|
||||
},
|
||||
"terms": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"size": 10
|
||||
},
|
||||
"field": "{field}",
|
||||
"size": 10,
|
||||
"shard_size": 10,
|
||||
"order": {
|
||||
__template: {
|
||||
"_term": "asc"
|
||||
},
|
||||
"_term": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"min_doc_count": 10,
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
"include": ".*",
|
||||
"exclude": ".*",
|
||||
"execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash", "global_ordinals_low_cardinality"]},
|
||||
"show_term_doc_count_error": {__one_of: [true, false]},
|
||||
"collect_mode": {__one_of: ["depth_first", "breadth_first"]},
|
||||
"missing": ""
|
||||
},
|
||||
"significant_terms": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"field": "{field}",
|
||||
"size": 10,
|
||||
"shard_size": 10,
|
||||
"shard_min_doc_count": 10,
|
||||
"min_doc_count": 10,
|
||||
"include": {__one_of: ["*", {pattern: "", flags: ""}]},
|
||||
"exclude": {__one_of: ["*", {pattern: "", flags: ""}]},
|
||||
"execution_hint": {__one_of: ["map", "global_ordinals", "global_ordinals_hash"]},
|
||||
"background_filter": {
|
||||
__scope_link: "GLOBAL.filter"
|
||||
},
|
||||
"mutual_information": {
|
||||
"include_negatives": {__one_of: [true, false]}
|
||||
},
|
||||
"chi_square": {
|
||||
"include_negatives": {__one_of: [true, false]},
|
||||
"background_is_superset": {__one_of: [true, false]}
|
||||
},
|
||||
"percentage": {},
|
||||
"gnd": {
|
||||
"background_is_superset": {__one_of: [true, false]}
|
||||
},
|
||||
"script_heuristic": {
|
||||
__template: {
|
||||
"script": "_subset_freq/(_superset_freq - _subset_freq + 1)"
|
||||
},
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
}
|
||||
}
|
||||
},
|
||||
"range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": 50, "to": 100},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"ranges": [
|
||||
{"to": 50, "from": 100, "key": ""}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
}
|
||||
},
|
||||
"date_range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": "now-10d/d", "to": "now"},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"format": "MM-yyy",
|
||||
"ranges": [
|
||||
{"to": "", "from": "", "key": ""}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
}
|
||||
},
|
||||
"ip_range": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"ranges": [
|
||||
{"from": "10.0.0.5", "to": "10.0.0.10"},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"format": "MM-yyy",
|
||||
"ranges": [
|
||||
{"to": "", "from": "", "key": "", "mask": "10.0.0.127/25"}
|
||||
],
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
}
|
||||
},
|
||||
"histogram": {
|
||||
__template: {
|
||||
"field": "price",
|
||||
"interval": 50
|
||||
},
|
||||
"field": "{field}",
|
||||
"interval": 50,
|
||||
"min_doc_count": 0,
|
||||
"order": {
|
||||
__template: {
|
||||
"_key": "asc"
|
||||
},
|
||||
"_key": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"missing": 0
|
||||
},
|
||||
"date_histogram": {
|
||||
__template: {
|
||||
"field": "date",
|
||||
"interval": "month"
|
||||
},
|
||||
"field": "{field}",
|
||||
"interval": {__one_of: ["year", "quarter", "week", "day", "hour", "minute", "second"]},
|
||||
"min_doc_count": 0,
|
||||
"order": {
|
||||
__template: {
|
||||
"_key": "asc"
|
||||
},
|
||||
"_key": {__one_of: ["asc", "desc"]},
|
||||
"_count": {__one_of: ["asc", "desc"]},
|
||||
"*": {__one_of: ["asc", "desc"]}
|
||||
},
|
||||
"keyed": {__one_of: [true, false]},
|
||||
"pre_zone": "-01:00",
|
||||
"post_zone": "-01:00",
|
||||
"pre_zone_adjust_large_interval": {__one_of: [true, false]},
|
||||
"factor": 1000,
|
||||
"pre_offset": "1d",
|
||||
"post_offset": "1d",
|
||||
"format": "yyyy-MM-dd",
|
||||
"time_zone": "00:00",
|
||||
"missing": ""
|
||||
},
|
||||
"geo_distance": {
|
||||
__template: {
|
||||
"field": "location",
|
||||
"origin": {"lat": 52.3760, "lon": 4.894},
|
||||
"ranges": [
|
||||
{"from": 100, "to": 300},
|
||||
]
|
||||
},
|
||||
"field": "{field}",
|
||||
"origin": {"lat": 0.0, "lon": 0.0},
|
||||
"unit": {__one_of: ["mi", "km", "in", "yd", "m", "cm", "mm"]},
|
||||
"ranges": [
|
||||
{"from": 50, "to": 100}
|
||||
],
|
||||
"distance_type": {__one_of: ["arc", "sloppy_arc", "plane"]}
|
||||
|
||||
},
|
||||
"geohash_grid": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"precision": 3
|
||||
},
|
||||
"field": "{field}",
|
||||
"precision": {__one_of: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},
|
||||
"size": 10,
|
||||
"shard_size": 10
|
||||
},
|
||||
"percentiles": {
|
||||
__template: {
|
||||
"field": "",
|
||||
"percents": [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0]
|
||||
},
|
||||
"field": "{field}",
|
||||
"percents": {
|
||||
__template: [1.0, 5.0, 25.0, 50.0, 75.0, 95.0, 99.0],
|
||||
// mark type as list
|
||||
__any_of: []
|
||||
},
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
"compression": 100,
|
||||
"method": {__one_of: ["hdr", "tdigest"]},
|
||||
missing: 0
|
||||
},
|
||||
"cardinality": {
|
||||
__template: {
|
||||
"field": ""
|
||||
},
|
||||
"precision_threshold": 100,
|
||||
"rehash": true,
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
missing: ""
|
||||
},
|
||||
"scripted_metric": {
|
||||
__template: {
|
||||
"init_script": "",
|
||||
"map_script": "",
|
||||
"combine_script": "",
|
||||
"reduce_script": ""
|
||||
},
|
||||
"init_script": {
|
||||
__scope_link: "GLOBAL.script"
|
||||
},
|
||||
"map_script": {
|
||||
__scope_link: "GLOBAL.script"
|
||||
},
|
||||
"combine_script": {
|
||||
__scope_link: "GLOBAL.script"
|
||||
},
|
||||
"reduce_script": {
|
||||
__scope_link: "GLOBAL.script"
|
||||
},
|
||||
"lang": "groovy",
|
||||
"params": {},
|
||||
"reduce_params": {}
|
||||
},
|
||||
"geo_bounds": {
|
||||
__template: {
|
||||
field: ""
|
||||
},
|
||||
field: "{field}",
|
||||
wrap_longitude: {__one_of: [true, false]}
|
||||
},
|
||||
"top_hits": {
|
||||
__template: {
|
||||
size: 10
|
||||
},
|
||||
from: 0,
|
||||
size: 10,
|
||||
sort: {
|
||||
__template: [],
|
||||
__scope_link: "_search.sort"
|
||||
},
|
||||
highlight: {},
|
||||
explain: {__one_of: [true, false]},
|
||||
_source: {
|
||||
__template: "",
|
||||
__scope_link: "_search._source"
|
||||
},
|
||||
script_fields: {
|
||||
__scope_link: "_search.script_fields"
|
||||
},
|
||||
fielddata_fields: ["{field}"],
|
||||
version: {__one_of: [true, false]}
|
||||
},
|
||||
"percentile_ranks": {
|
||||
__template: {
|
||||
field: "",
|
||||
values: [10, 15]
|
||||
},
|
||||
field: "{field}",
|
||||
values: [],
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
"compression": 100,
|
||||
"method": {__one_of: ["hdr", "tdigest"]},
|
||||
missing: 0
|
||||
},
|
||||
"sampler": {
|
||||
__template: {},
|
||||
"field": "{field}",
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
"shard_size": 100,
|
||||
"max_docs_per_value": 3,
|
||||
"execution_hint": {__one_of: ["map", "global_ordinals", "bytes_hash"]}
|
||||
},
|
||||
"children": {
|
||||
__template: {
|
||||
"type": "",
|
||||
},
|
||||
"type": ""
|
||||
},
|
||||
"derivative": simple_pipeline,
|
||||
"avg_bucket": simple_pipeline,
|
||||
"max_bucket": simple_pipeline,
|
||||
"min_bucket": simple_pipeline,
|
||||
"sum_bucket": simple_pipeline,
|
||||
"moving_avg": {
|
||||
__template: {
|
||||
buckets_path: ""
|
||||
},
|
||||
buckets_path: "",
|
||||
format: "",
|
||||
gap_policy: gap_policy,
|
||||
"window": 5,
|
||||
model: {__one_of: ["simple", "linear", "ewma", "holt", "holt_winters"]},
|
||||
settings: {
|
||||
type: {__one_of: ["add", "mult"]},
|
||||
alpha: 0.5,
|
||||
beta: 0.5,
|
||||
gamma: 0.5,
|
||||
period: 7
|
||||
}
|
||||
},
|
||||
"cumulative_sum": {
|
||||
__template: {
|
||||
buckets_path: ""
|
||||
},
|
||||
buckets_path: "",
|
||||
format: ""
|
||||
},
|
||||
"serial_diff": {
|
||||
__template: {
|
||||
buckets_path: "",
|
||||
lag: 7
|
||||
},
|
||||
lag: 7,
|
||||
gap_policy: gap_policy,
|
||||
buckets_path: "",
|
||||
format: ""
|
||||
},
|
||||
"bucket_script": {
|
||||
__template: {
|
||||
buckets_path: "",
|
||||
script: {}
|
||||
},
|
||||
buckets_path: "",
|
||||
format: "",
|
||||
gap_policy: gap_policy,
|
||||
script: {
|
||||
// populated by a global rule
|
||||
}
|
||||
},
|
||||
"bucket_selector": {
|
||||
__template: {
|
||||
buckets_path: "",
|
||||
script: {}
|
||||
},
|
||||
buckets_path: "",
|
||||
gap_policy: gap_policy,
|
||||
script: {
|
||||
// populated by a global rule
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
module.exports = function (api) {
|
||||
|
||||
api.addGlobalAutocompleteRules('aggregations', rules);
|
||||
api.addGlobalAutocompleteRules('aggs', rules);
|
||||
};
|
71
src/plugins/console/api_server/es_2_0/aliases.js
Normal file
|
@ -0,0 +1,71 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_post_aliases', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_aliases",
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
'actions': {
|
||||
__template: [
|
||||
{'add': {'index': 'test1', 'alias': 'alias1'}}
|
||||
],
|
||||
__any_of: [
|
||||
{
|
||||
add: {
|
||||
index: '{index}',
|
||||
alias: '',
|
||||
filter: {},
|
||||
routing: '1',
|
||||
search_routing: '1,2',
|
||||
index_routing: '1'
|
||||
},
|
||||
remove: {
|
||||
index: '',
|
||||
alias: ''
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_get_aliases', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_aliases",
|
||||
]
|
||||
});
|
||||
|
||||
var aliasRules = {
|
||||
filter: {},
|
||||
routing: '1',
|
||||
search_routing: '1,2',
|
||||
index_routing: '1'
|
||||
};
|
||||
|
||||
api.addEndpointDescription('_post_alias', {
|
||||
methods: ["POST", "PUT"],
|
||||
patterns: [
|
||||
"{indices}/_alias/{name}"
|
||||
],
|
||||
data_autocomplete_rules: aliasRules
|
||||
});
|
||||
api.addEndpointDescription('_delete_alias', {
|
||||
methods: ["DELETE"],
|
||||
patterns: [
|
||||
"{indices}/_alias/{name}"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_get_alias', {
|
||||
methods: ["GET"],
|
||||
patterns: [
|
||||
"_alias",
|
||||
"{indices}/_alias",
|
||||
"{indices}/_alias/{name}",
|
||||
"_alias/{name}"
|
||||
]
|
||||
});
|
||||
|
||||
api.addGlobalAutocompleteRules('aliases', {
|
||||
'*': aliasRules
|
||||
});
|
||||
};
|
56
src/plugins/console/api_server/es_2_0/cat.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
let _ = require("lodash");
|
||||
|
||||
function addSimpleCat(endpoint, api, params, patterns) {
|
||||
var url_params = {"help": "__flag__", "v": "__flag__", "bytes": ["b"]};
|
||||
_.each(params || [], function (p) {
|
||||
if (_.isString(p)) {
|
||||
url_params[p] = "__flag__";
|
||||
}
|
||||
else {
|
||||
var k = Object.keys(p)[0];
|
||||
url_params[k] = p[k];
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription(endpoint, {
|
||||
match: endpoint,
|
||||
url_params: url_params,
|
||||
patterns: patterns || [endpoint]
|
||||
});
|
||||
}
|
||||
|
||||
function addNodeattrsCat(api) {
|
||||
api.addEndpointDescription('_cat/nodeattrs', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_cat/nodeattrs"
|
||||
],
|
||||
url_params: {
|
||||
help: "__flag__",
|
||||
v: "__flag__",
|
||||
h: ["node", "name", "id", "nodeId", "pid", "p", "host", "h", "ip", "i", "port", "po", "attr", "attr.name", "value", "attr.value"]
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = function (api) {
|
||||
addSimpleCat('_cat/aliases', api);
|
||||
addSimpleCat('_cat/allocation', api, null, ['_cat/allocation', '_cat/allocation/{nodes}']);
|
||||
addSimpleCat('_cat/count', api);
|
||||
addSimpleCat('_cat/health', api, [
|
||||
{"ts": ["false", "true"]}
|
||||
]);
|
||||
addSimpleCat('_cat/indices', api, [
|
||||
{h: []},
|
||||
"pri",
|
||||
],
|
||||
['_cat/indices', '_cat/indices/{indices}']);
|
||||
addSimpleCat('_cat/master', api);
|
||||
addSimpleCat('_cat/nodes', api);
|
||||
addSimpleCat('_cat/pending_tasks', api);
|
||||
addSimpleCat('_cat/recovery', api);
|
||||
addSimpleCat('_cat/thread_pool', api);
|
||||
addSimpleCat('_cat/shards', api);
|
||||
addSimpleCat('_cat/plugins', api);
|
||||
addSimpleCat('_cat/segments', api);
|
||||
addNodeattrsCat(api);
|
||||
};
|
142
src/plugins/console/api_server/es_2_0/cluster.js
Normal file
|
@ -0,0 +1,142 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_cluster/nodes/stats');
|
||||
api.addEndpointDescription('_cluster/state', {
|
||||
patterns: [
|
||||
"_cluster/state",
|
||||
"_cluster/state/{metrics}",
|
||||
"_cluster/state/{metrics}/{indices}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": ["version", "master_node", "nodes", "routing_table", "routing_node", "metadata", "blocks"]
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_cluster/health', {
|
||||
url_params: {
|
||||
"local": "__flag__",
|
||||
"level": ["indices", "shards"],
|
||||
"master_timeout": "30s",
|
||||
"timeout": "30s",
|
||||
"wait_for_status": ["yellow", "green"],
|
||||
"wait_for_relocating_shards": 0,
|
||||
"wait_for_active_shards": 0,
|
||||
"wait_for_nodes": 0
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_cluster/pending_tasks');
|
||||
api.addEndpointDescription('get_cluster/settings', {
|
||||
patterns: [
|
||||
'_cluster/settings'
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('put_cluster/settings', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
'_cluster/settings'
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
persistent: {
|
||||
cluster: {
|
||||
routing: {
|
||||
'allocation.enable': {__one_of: ["all", "primaries", "new_primaries", "none"]},
|
||||
'allocation.disk.threshold_enabled': {__one_of: [false, true]},
|
||||
'allocation.disk.watermark.low': '85%',
|
||||
'allocation.disk.watermark.high': '90%',
|
||||
'allocation.disk.include_relocations': {__one_of: [true, false]},
|
||||
'allocation.disk.reroute_interval': '60s',
|
||||
'allocation.exclude': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.include': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.require': {
|
||||
'_ip': "",
|
||||
'_name': "",
|
||||
'_host': "",
|
||||
'_id': ""
|
||||
},
|
||||
'allocation.awareness.attributes': [],
|
||||
'allocation.awareness.force': {
|
||||
'*': {
|
||||
'values': []
|
||||
}
|
||||
},
|
||||
'allocation.allow_rebalance': {__one_of: ['always', 'indices_primaries_active', 'indices_all_active']},
|
||||
'allocation.cluster_concurrent_rebalance': 2,
|
||||
'allocation.node_initial_primaries_recoveries': 4,
|
||||
'allocation.node_concurrent_recoveries': 2,
|
||||
'allocation.same_shard.host': {__one_of: [false, true]}
|
||||
}
|
||||
},
|
||||
indices: {
|
||||
breaker: {
|
||||
"total.limit": "70%",
|
||||
"fielddata.limit": "60%",
|
||||
"fielddata.overhead": 1.03,
|
||||
"request.limit": "40%",
|
||||
"request.overhead": 1.0
|
||||
}
|
||||
}
|
||||
},
|
||||
transient: {
|
||||
__scope_link: '.persistent'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_cluster/reroute', {
|
||||
methods: ['POST'],
|
||||
url_params: {
|
||||
explain: "__flag__",
|
||||
dry_run: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
commands: [
|
||||
{
|
||||
move: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
from_node: "",
|
||||
to_node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
from_node: "{node}",
|
||||
to_node: "{node}"
|
||||
},
|
||||
cancel: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
node: "{node}",
|
||||
allow_primary: {__one_of: [true, false]}
|
||||
},
|
||||
allocate: {
|
||||
__template: {
|
||||
index: "",
|
||||
shard: 0,
|
||||
node: ""
|
||||
},
|
||||
index: "{index}",
|
||||
shard: 0,
|
||||
node: "{node}",
|
||||
allow_primary: {__one_of: [true, false]}
|
||||
}
|
||||
}
|
||||
],
|
||||
dry_run: {__one_of: [true, false]}
|
||||
}
|
||||
});
|
||||
};
|
22
src/plugins/console/api_server/es_2_0/count.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_count', {
|
||||
methods: ['GET', 'POST'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/{types}/_count",
|
||||
"{indices}/_count",
|
||||
"_count"
|
||||
],
|
||||
url_params: {
|
||||
preference: ["_primary", "_primary_first", "_local", "_only_node:xyz", "_prefer_node:xyz", "_shards:2,3"],
|
||||
routing: "",
|
||||
min_score: 1.0,
|
||||
terminate_after: 10,
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
235
src/plugins/console/api_server/es_2_0/document.js
Normal file
|
@ -0,0 +1,235 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_get_doc', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"_source": "",
|
||||
"_source_exclude": "",
|
||||
"_source_include": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_get_doc_source', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_source"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"_source_exclude": "",
|
||||
"_source_include": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_delete_doc', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": ""
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('index_doc', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"op_type": ["create"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('create_doc', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_create"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('index_doc_no_id', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"{index}/{type}"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["external", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"ttl": "5m",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_update', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_update"
|
||||
],
|
||||
url_params: {
|
||||
"version": 1,
|
||||
"version_type": ["force", "internal"],
|
||||
"routing": "",
|
||||
"parent": "",
|
||||
"timestamp": "",
|
||||
"consistency": ["qurom", "one", "all"],
|
||||
"refresh": "__flag__",
|
||||
"timeout": "1m",
|
||||
"retry_on_conflict": 3,
|
||||
"fields": ""
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
"script": {
|
||||
// populated by a global rule
|
||||
},
|
||||
"doc": {},
|
||||
"upsert": {},
|
||||
"scripted_upsert": {__one_of: [true, false]}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_put_script', {
|
||||
methods: ['POST', 'PUT'],
|
||||
patterns: [
|
||||
"_scripts/{lang}/{id}",
|
||||
"_scripts/{lang}/{id}/_create"
|
||||
],
|
||||
url_components: {
|
||||
"lang": [
|
||||
"groovy",
|
||||
"expressions"
|
||||
]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
"script": ""
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_termvectors', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/_termvectors"
|
||||
],
|
||||
priority: 10, // collision with get doc
|
||||
url_params: {
|
||||
"fields": "",
|
||||
"offsets": "__flag__",
|
||||
"payloads": "__flag__",
|
||||
"positions": "__flag__",
|
||||
"term_statistics": "__flag__",
|
||||
"field_statistics": "__flag__",
|
||||
"routing": "",
|
||||
"version": 1,
|
||||
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
"parent": "",
|
||||
"preference": "",
|
||||
"dfs": "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
fields: [
|
||||
"{field}"
|
||||
],
|
||||
offsets: {__one_of: [false, true]},
|
||||
payloads: {__one_of: [false, true]},
|
||||
positions: {__one_of: [false, true]},
|
||||
term_statistics: {__one_of: [true, false]},
|
||||
field_statistics: {__one_of: [false, true]},
|
||||
dfs: {__one_of: [true, false]},
|
||||
per_field_analyzer: {
|
||||
__template: {"FIELD": ""},
|
||||
"{field}": ""
|
||||
},
|
||||
routing: "",
|
||||
version: 1,
|
||||
version_type: ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
doc: {},
|
||||
filter: { // TODO: Exclude from global filter rules
|
||||
"max_num_terms": 1,
|
||||
"min_term_freq": 1,
|
||||
"max_term_freq": 1,
|
||||
"min_doc_freq": 1,
|
||||
"max_doc_freq": 1,
|
||||
"min_word_length": 1,
|
||||
"max_word_length": 1
|
||||
}
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_termvectors_id', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{index}/{type}/{id}/_termvectors"
|
||||
],
|
||||
url_params: {
|
||||
"fields": "",
|
||||
"offsets": "__flag__",
|
||||
"payloads": "__flag__",
|
||||
"positions": "__flag__",
|
||||
"term_statistics": "__flag__",
|
||||
"field_statistics": "__flag__",
|
||||
"routing": "",
|
||||
"version": 1,
|
||||
"version_type": ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
"parent": "",
|
||||
"preference": "",
|
||||
"dfs": "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
fields: [
|
||||
"{field}"
|
||||
],
|
||||
offsets: {__one_of: [false, true]},
|
||||
payloads: {__one_of: [false, true]},
|
||||
positions: {__one_of: [false, true]},
|
||||
term_statistics: {__one_of: [true, false]},
|
||||
field_statistics: {__one_of: [false, true]},
|
||||
dfs: {__one_of: [true, false]},
|
||||
per_field_analyzer: {
|
||||
__template: {"FIELD": ""},
|
||||
"{field}": ""
|
||||
},
|
||||
routing: "",
|
||||
version: 1,
|
||||
version_type: ["external", "external_gt", "external_gte", "force", "internal"],
|
||||
filter: { // TODO: Exclude from global filter rules
|
||||
"max_num_terms": 1,
|
||||
"min_term_freq": 1,
|
||||
"max_term_freq": 1,
|
||||
"min_doc_freq": 1,
|
||||
"max_doc_freq": 1,
|
||||
"min_word_length": 1,
|
||||
"max_word_length": 1
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
47
src/plugins/console/api_server/es_2_0/field_stats.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_field_stats', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"_field_stats",
|
||||
"{indices}/_field_stats"
|
||||
],
|
||||
url_params: {
|
||||
fields: [],
|
||||
level: ["cluster", "indices"],
|
||||
ignore_unavailable: ["true", "false"],
|
||||
allow_no_indices: [false, true],
|
||||
expand_wildcards: ["open", "closed", "none", "all"]
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
fields: [
|
||||
"{field}",
|
||||
],
|
||||
index_constraints: {
|
||||
"{field}": {
|
||||
min_value: {
|
||||
gt: "MIN",
|
||||
gte: "MAX",
|
||||
lt: "MIN",
|
||||
lte: "MAX"
|
||||
},
|
||||
max_value: {
|
||||
gt: "MIN",
|
||||
gte: "MAX",
|
||||
lt: "MIN",
|
||||
lte: "MAX"
|
||||
}
|
||||
},
|
||||
__template: {
|
||||
"FIELD": {
|
||||
min_value: {
|
||||
gt: "MIN"
|
||||
},
|
||||
max_value: {
|
||||
lt: "MAX"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
336
src/plugins/console/api_server/es_2_0/filter.js
Normal file
|
@ -0,0 +1,336 @@
|
|||
var filters = {};
|
||||
|
||||
filters.and = {
|
||||
__template: {
|
||||
filters: [
|
||||
{}
|
||||
]
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
filters.bool = {
|
||||
__scope_link: 'GLOBAL.query'
|
||||
};
|
||||
|
||||
|
||||
filters.exists = {
|
||||
__template: {
|
||||
'field': 'FIELD_NAME'
|
||||
},
|
||||
'field': '{field}'
|
||||
};
|
||||
|
||||
|
||||
filters.ids = {
|
||||
__template: {
|
||||
'values': ['ID']
|
||||
},
|
||||
'type': '{type}',
|
||||
'values': ['']
|
||||
};
|
||||
|
||||
|
||||
filters.limit = {
|
||||
__template: {
|
||||
value: 100
|
||||
},
|
||||
value: 100
|
||||
};
|
||||
|
||||
|
||||
filters.type = {
|
||||
__template: {
|
||||
value: 'TYPE'
|
||||
},
|
||||
value: '{type}'
|
||||
};
|
||||
|
||||
|
||||
filters.geo_bounding_box = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'top_left': {
|
||||
'lat': 40.73,
|
||||
'lon': -74.1
|
||||
},
|
||||
'bottom_right': {
|
||||
'lat': 40.717,
|
||||
'lon': -73.99
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
'{field}': {
|
||||
top_left: {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
bottom_right: {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
type: {
|
||||
__one_of: ['memory', 'indexed']
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
filters.geo_distance = {
|
||||
__template: {
|
||||
distance: 100,
|
||||
distance_unit: 'km',
|
||||
'FIELD': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
distance: 100,
|
||||
distance_unit: {
|
||||
__one_of: ['km', 'miles']
|
||||
},
|
||||
distance_type: {
|
||||
__one_of: ['arc', 'plane']
|
||||
},
|
||||
optimize_bbox: {
|
||||
__one_of: ['memory', 'indexed', 'none']
|
||||
},
|
||||
'{field}': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
filters.geo_distance_range = {
|
||||
__template: {
|
||||
from: 100,
|
||||
to: 200,
|
||||
distance_unit: 'km',
|
||||
'FIELD': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
},
|
||||
from: 100,
|
||||
to: 200,
|
||||
|
||||
distance_unit: {
|
||||
__one_of: ['km', 'miles']
|
||||
},
|
||||
distance_type: {
|
||||
__one_of: ['arc', 'plane']
|
||||
},
|
||||
include_lower: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
include_upper: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
|
||||
'{field}': {
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_polygon = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
'points': [
|
||||
{
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
},
|
||||
{
|
||||
lat: 40.83,
|
||||
lon: -75.1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
points: [
|
||||
{
|
||||
lat: 40.73,
|
||||
lon: -74.1
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.geo_shape = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
shape: {
|
||||
type: 'envelope',
|
||||
coordinates: [
|
||||
[-45, 45],
|
||||
[45, -45]
|
||||
]
|
||||
},
|
||||
'relation': 'within'
|
||||
}
|
||||
},
|
||||
'{field}': {
|
||||
shape: {
|
||||
type: '',
|
||||
coordinates: []
|
||||
},
|
||||
indexed_shape: {
|
||||
id: '',
|
||||
index: '{index}',
|
||||
type: '{type}',
|
||||
shape_field_name: 'shape'
|
||||
},
|
||||
relation: {
|
||||
__one_of: ['within', 'intersects', 'disjoint']
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.has_child = {
|
||||
__template: {
|
||||
type: 'TYPE',
|
||||
filter: {}
|
||||
},
|
||||
type: '{type}',
|
||||
query: {},
|
||||
filter: {},
|
||||
_scope: '',
|
||||
min_children: 1,
|
||||
max_children: 10
|
||||
};
|
||||
|
||||
|
||||
filters.has_parent = {
|
||||
__template: {
|
||||
parent_type: 'TYPE',
|
||||
filter: {}
|
||||
},
|
||||
parent_type: '{type}',
|
||||
query: {},
|
||||
filter: {},
|
||||
_scope: ''
|
||||
};
|
||||
|
||||
|
||||
filters.m = filters.missing = {
|
||||
__template: {
|
||||
field: 'FIELD'
|
||||
},
|
||||
existence: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
null_value: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
field: '{field}'
|
||||
};
|
||||
|
||||
|
||||
filters.not = {
|
||||
__template: {
|
||||
filter: {}
|
||||
},
|
||||
filter: {}
|
||||
};
|
||||
|
||||
|
||||
filters.range = {
|
||||
__template: {
|
||||
'FIELD': {
|
||||
gte: 10,
|
||||
lte: 20
|
||||
}
|
||||
},
|
||||
"{field}": {
|
||||
gte: 1,
|
||||
gt: 1,
|
||||
lte: 20,
|
||||
lt: 20,
|
||||
time_zone: "+1:00",
|
||||
"format": "dd/MM/yyyy||yyyy",
|
||||
execution: {__one_of: ["index", "fielddata"]}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.or = {
|
||||
__template: {
|
||||
filters: [
|
||||
{}
|
||||
]
|
||||
},
|
||||
filters: [
|
||||
{
|
||||
__scope_link: '.'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
filters.prefix = {
|
||||
__template: {
|
||||
'FIELD': 'VALUE'
|
||||
},
|
||||
'{field}': ''
|
||||
};
|
||||
|
||||
|
||||
filters.query = {
|
||||
// global query
|
||||
};
|
||||
|
||||
filters.script = {
|
||||
__template: {
|
||||
script: {}
|
||||
},
|
||||
script: {
|
||||
// populated by a global rule
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.term = {
|
||||
__template: {
|
||||
'FIELD': 'VALUE'
|
||||
},
|
||||
'{field}': ''
|
||||
};
|
||||
|
||||
|
||||
filters.terms = {
|
||||
__template: {
|
||||
'FIELD': ['VALUE1', 'VALUE2']
|
||||
},
|
||||
field: ['{field}'],
|
||||
execution: {
|
||||
__one_of: ['plain', 'bool', 'and', 'or', 'bool_nocache', 'and_nocache', 'or_nocache']
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
filters.nested = {
|
||||
__template: {
|
||||
path: 'path_to_nested_doc',
|
||||
query: {}
|
||||
},
|
||||
query: {},
|
||||
path: '',
|
||||
_name: ''
|
||||
};
|
||||
|
||||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('filter', filters);
|
||||
};
|
||||
|
24
src/plugins/console/api_server/es_2_0/globals.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
module.exports = function (api) {
|
||||
api.addGlobalAutocompleteRules('highlight', {
|
||||
pre_tags: {},
|
||||
post_tags: {},
|
||||
tags_schema: {},
|
||||
fields: {
|
||||
'{field}': {
|
||||
fragment_size: 20,
|
||||
number_of_fragments: 3
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addGlobalAutocompleteRules('script', {
|
||||
__template: {
|
||||
inline: "SCRIPT"
|
||||
},
|
||||
inline: "SCRIPT",
|
||||
file: "FILE_SCRIPT_NAME",
|
||||
id: "SCRIPT_ID",
|
||||
lang: "",
|
||||
params: {}
|
||||
});
|
||||
};
|
209
src/plugins/console/api_server/es_2_0/indices.js
Normal file
|
@ -0,0 +1,209 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_refresh', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_refresh",
|
||||
"{indices}/_refresh"
|
||||
],
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_flush', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_flush",
|
||||
"{indices}/_flush"
|
||||
],
|
||||
url_params: {
|
||||
wait_if_ongoing: [true, false],
|
||||
force: [true, false]
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_flush_synced', {
|
||||
methods: ['POST'],
|
||||
patterns: [
|
||||
"_flush/synced",
|
||||
"{indices}/_flush/synced"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_stats', {
|
||||
patterns: [
|
||||
"_stats",
|
||||
"_stats/{metrics}",
|
||||
"{indices}/_stats",
|
||||
"{indices}/_stats/{metrics}",
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"docs",
|
||||
"store",
|
||||
"indexing",
|
||||
"search",
|
||||
"get",
|
||||
"merge",
|
||||
"refresh",
|
||||
"flush",
|
||||
"warmer",
|
||||
"filter_cache",
|
||||
"percolate",
|
||||
"segments",
|
||||
"fielddata",
|
||||
"completion",
|
||||
"translog",
|
||||
"query_cache",
|
||||
"commit",
|
||||
"_all"
|
||||
]
|
||||
},
|
||||
url_params: {
|
||||
"fields": [],
|
||||
"types": [],
|
||||
"completion_fields": [],
|
||||
"fielddata_fields": [],
|
||||
"level": ["cluster", "indices", "shards"]
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_segments', {
|
||||
patterns: [
|
||||
"{indices}/_segments",
|
||||
"_segments"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_recovery', {
|
||||
patterns: [
|
||||
"{indices}/_recovery",
|
||||
"_recovery"
|
||||
],
|
||||
url_params: {
|
||||
detailed: "__flag__",
|
||||
active_only: "__flag__",
|
||||
human: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_analyze', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/_analyze",
|
||||
"_analyze"
|
||||
],
|
||||
url_params: {
|
||||
"analyzer": "",
|
||||
"char_filters": [],
|
||||
"field": "",
|
||||
"filters": [],
|
||||
"text": "",
|
||||
"tokenizer": ""
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_validate_query', {
|
||||
methods: ['GET', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/_validate/query",
|
||||
"_validate/query"
|
||||
],
|
||||
url_params: {
|
||||
explain: "__flag__",
|
||||
rewrite: "__flag__"
|
||||
},
|
||||
data_autocomplete_rules: {
|
||||
query: {
|
||||
// populated by a global rule
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_shard_stores', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"{indices}/_shard_stores",
|
||||
"_shard_stores"
|
||||
],
|
||||
url_params: {
|
||||
status: ["green", "yellow", "red", "all"]
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('__create_index__', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{index}"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
mappings: {
|
||||
__scope_link: '_put_mapping'
|
||||
},
|
||||
settings: {
|
||||
__scope_link: '_put_settings'
|
||||
},
|
||||
aliases: {
|
||||
__template: {
|
||||
"NAME": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('__delete_indices__', {
|
||||
methods: ['DELETE'],
|
||||
patterns: [
|
||||
"{indices}"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_get_index_settings', {
|
||||
methods: ['GET',],
|
||||
patterns: [
|
||||
"{indices}/_settings",
|
||||
],
|
||||
url_params: {
|
||||
flat_settings: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_get_index', {
|
||||
methods: ['GET',],
|
||||
patterns: [
|
||||
"{indices}",
|
||||
"{indices}/{feature}"
|
||||
],
|
||||
url_components: {
|
||||
"feature": [
|
||||
"_mappings",
|
||||
"_warmers",
|
||||
"_aliases"
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_cache/clear', {
|
||||
patterns: [
|
||||
"_cache/clear",
|
||||
"{indices}/_cache/clear"
|
||||
]
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_upgrade', {
|
||||
methods: ["POST"],
|
||||
patterns: [
|
||||
"_upgrade",
|
||||
"{indices}/_upgrade"
|
||||
],
|
||||
url_params: {
|
||||
wait_for_completion: "__flag__"
|
||||
}
|
||||
});
|
||||
|
||||
api.addEndpointDescription('_upgrade_status', {
|
||||
methods: ["GET"],
|
||||
patterns: [
|
||||
"_upgrade",
|
||||
"{indices}/_upgrade"
|
||||
]
|
||||
});
|
||||
};
|
237
src/plugins/console/api_server/es_2_0/mappings.js
Normal file
|
@ -0,0 +1,237 @@
|
|||
let _ = require("lodash");
|
||||
|
||||
var INDEX_SETTING = {
|
||||
__one_of: ['analyzed', 'not_analyzed', 'no']
|
||||
}, BOOLEAN = {
|
||||
__one_of: [true, false]
|
||||
};
|
||||
|
||||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_get_mapping', {
|
||||
methods: ['GET'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping",
|
||||
"{indices}/_mapping/{types}",
|
||||
"{indices}/{types}/_mapping",
|
||||
"_mapping"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_get_field_mapping', {
|
||||
methods: ['GET'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping/field/{fields}",
|
||||
"{indices}/_mapping/{type}/field/{fields}"
|
||||
],
|
||||
url_params: {
|
||||
"include_defaults": "__flag__"
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_delete_mapping', {
|
||||
methods: ['DELETE'],
|
||||
priority: 10, // collides with get doc by id
|
||||
patterns: [
|
||||
"{indices}/_mapping",
|
||||
"{indices}/_mapping/{types}",
|
||||
"{indices}/{types}/_mapping",
|
||||
"_mapping"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_put_type_mapping', {
|
||||
methods: ['PUT', 'POST'],
|
||||
patterns: [
|
||||
"{indices}/{type}/_mapping",
|
||||
"{indices}/_mapping/{type}"
|
||||
],
|
||||
priority: 10, // collides with put doc by id
|
||||
data_autocomplete_rules: {
|
||||
__template: {
|
||||
properties: {
|
||||
'FIELD': {}
|
||||
}
|
||||
},
|
||||
'_source': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_all': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_field_names': {
|
||||
'index': INDEX_SETTING
|
||||
},
|
||||
'_routing': {
|
||||
'required': BOOLEAN,
|
||||
},
|
||||
'_index': {
|
||||
'enabled': BOOLEAN
|
||||
},
|
||||
'_parent': {
|
||||
__template: {
|
||||
'type': ''
|
||||
},
|
||||
'type': '{type}'
|
||||
},
|
||||
'_timestamp': {
|
||||
'enabled': BOOLEAN,
|
||||
'format': 'YYYY-MM-dd',
|
||||
'default': ""
|
||||
},
|
||||
'dynamic_date_formats': ['yyyy-MM-dd'],
|
||||
'date_detection': BOOLEAN,
|
||||
'numeric_detection': BOOLEAN,
|
||||
'transform': {
|
||||
__template: {
|
||||
script: {}
|
||||
},
|
||||
__one_of: [
|
||||
{
|
||||
__scope_link: "GLOBAL.script"
|
||||
},
|
||||
[
|
||||
{
|
||||
__scope_link: "GLOBAL.script"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
},
|
||||
'properties': {
|
||||
'*': {
|
||||
type: {
|
||||
__one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',
|
||||
'binary', 'object', 'nested', "geo_point", "geo_shape"
|
||||
]
|
||||
},
|
||||
|
||||
// strings
|
||||
store: BOOLEAN,
|
||||
index: INDEX_SETTING,
|
||||
term_vector: {
|
||||
__one_of: ['no', 'yes', 'with_offsets', 'with_positions', 'with_positions_offsets']
|
||||
},
|
||||
boost: 1.0,
|
||||
null_value: '',
|
||||
omit_norms: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
index_options: {
|
||||
__one_of: ['docs', 'freqs', 'positions']
|
||||
},
|
||||
analyzer: 'standard',
|
||||
search_analyzer: 'standard',
|
||||
include_in_all: {
|
||||
__one_of: [false, true]
|
||||
},
|
||||
ignore_above: 10,
|
||||
position_increment_gap: 0,
|
||||
|
||||
// numeric
|
||||
precision_step: 4,
|
||||
ignore_malformed: BOOLEAN,
|
||||
|
||||
// geo_point
|
||||
lat_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
geohash: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
geohash_precision: '1m',
|
||||
geohash_prefix: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate_lat: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
validate_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize_lat: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
normalize_lon: {
|
||||
__one_of: [true, false]
|
||||
},
|
||||
|
||||
// geo_shape
|
||||
tree: {
|
||||
__one_of: ['geohash', 'quadtree']
|
||||
},
|
||||
precision: '5km',
|
||||
tree_levels: 12,
|
||||
distance_error_pct: 0.025,
|
||||
orientation: 'ccw',
|
||||
|
||||
// dates
|
||||
format: {
|
||||
__one_of: _.flatten([_.map(['date', 'date_time', 'date_time_no_millis',
|
||||
'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis',
|
||||
'time', 'time_no_millis', 't_time', 't_time_no_millis',
|
||||
'week_date', 'week_date_time', 'week_date_time_no_millis'], function (s) {
|
||||
return ['basic_' + s, 'strict_' + s];
|
||||
}),
|
||||
[
|
||||
'date', 'date_hour', 'date_hour_minute', 'date_hour_minute_second', 'date_hour_minute_second_fraction',
|
||||
'date_hour_minute_second_millis', 'date_optional_time', 'date_time', 'date_time_no_millis',
|
||||
'hour', 'hour_minute', 'hour_minute_second', 'hour_minute_second_fraction', 'hour_minute_second_millis',
|
||||
'ordinal_date', 'ordinal_date_time', 'ordinal_date_time_no_millis', 'time', 'time_no_millis',
|
||||
't_time', 't_time_no_millis', 'week_date', 'week_date_time', 'weekDateTimeNoMillis', 'week_year',
|
||||
'weekyearWeek', 'weekyearWeekDay', 'year', 'year_month', 'year_month_day', 'epoch_millis', 'epoch_second'
|
||||
]])
|
||||
},
|
||||
|
||||
fielddata: {
|
||||
filter: {
|
||||
regex: '',
|
||||
frequency: {
|
||||
min: 0.001,
|
||||
max: 0.1,
|
||||
min_segment_size: 500
|
||||
}
|
||||
}
|
||||
},
|
||||
similarity: {
|
||||
__one_of: ['default', 'BM25']
|
||||
},
|
||||
|
||||
// objects
|
||||
properties: {
|
||||
__scope_link: '_put_mapping.{type}.properties'
|
||||
},
|
||||
|
||||
// multi_field
|
||||
fields: {
|
||||
'*': {
|
||||
__scope_link: '_put_mapping.type.properties.field'
|
||||
}
|
||||
},
|
||||
copy_to: {__one_of: ['{field}', ['{field}']]},
|
||||
|
||||
// nested
|
||||
include_in_parent: BOOLEAN,
|
||||
include_in_root: BOOLEAN
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
api.addEndpointDescription('_put_mapping', {
|
||||
methods: ['PUT'],
|
||||
patterns: [
|
||||
"{indices}/_mapping"
|
||||
],
|
||||
data_autocomplete_rules: {
|
||||
'{type}': {
|
||||
__scope_link: '_put_type_mapping'
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
76
src/plugins/console/api_server/es_2_0/nodes.js
Normal file
|
@ -0,0 +1,76 @@
|
|||
module.exports = function (api) {
|
||||
api.addEndpointDescription('_nodes/hot_threads', {
|
||||
methods: ['GET'],
|
||||
patterns: [
|
||||
"_nodes/hot_threads",
|
||||
"_nodes/{nodes}/hot_threads"
|
||||
]
|
||||
});
|
||||
api.addEndpointDescription('_nodes/info', {
|
||||
patterns: [
|
||||
"_nodes",
|
||||
"_nodes/{metrics}",
|
||||
"_nodes/{nodes}",
|
||||
"_nodes/{nodes}/{metrics}",
|
||||
"_nodes/{nodes}/info/{metrics}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"settings",
|
||||
"os",
|
||||
"process",
|
||||
"jvm",
|
||||
"thread_pool",
|
||||
"network",
|
||||
"transport",
|
||||
"http",
|
||||
"plugins",
|
||||
"_all"
|
||||
]
|
||||
}
|
||||
});
|
||||
api.addEndpointDescription('_nodes/stats', {
|
||||
patterns: [
|
||||
"_nodes/stats",
|
||||
"_nodes/stats/{metrics}",
|
||||
"_nodes/stats/{metrics}/{index_metric}",
|
||||
"_nodes/{nodes}/stats",
|
||||
"_nodes/{nodes}/stats/{metrics}",
|
||||
"_nodes/{nodes}/stats/{metrics}/{index_metric}"
|
||||
],
|
||||
url_components: {
|
||||
"metrics": [
|
||||
"os",
|
||||
"jvm",
|
||||
"thread_pool",
|
||||
"network",
|
||||
"fs",
|
||||
"transport",
|
||||
"http",
|
||||
"indices",
|
||||
"process",
|
||||
"breaker",
|
||||
"_all"
|
||||
],
|
||||
"index_metric": [
|
||||
"store",
|
||||
"indexing",
|
||||
"get",
|
||||
"search",
|
||||
"merge",
|
||||
"flush",
|
||||
"refresh",
|
||||
"filter_cache",
|
||||
"fielddata",
|
||||
"docs",
|
||||
"warmer",
|
||||
"percolate",
|
||||
"completion",
|
||||
"segments",
|
||||
"translog",
|
||||
"query_cache",
|
||||
"_all"
|
||||
]
|
||||
}
|
||||
});
|
||||
};
|