Commit Graph

789 Commits

Author SHA1 Message Date
Tal Levy 41eaa586e8
remove index.lifecycle.skip setting (#34823)
With the introduction of _ilm/stop and _ilm/start APIs, the
use cases where one would only target a select group
of indices to start/stop has been reduced. Since there is no
strong use-case for skipping specific indices, it is best to
remove this functionality and only adding if later desired, with the
hopes of keeping things more simple.
2018-10-25 07:27:04 -07:00
王振荟 24df2eba80 Remove static import from HLRC doc snippet (#34834) 2018-10-25 16:22:50 +02:00
Mayya Sharipova d7afd7c123 Reduce the number of callouts to 15 in docs
relates to #33447
2018-10-24 17:57:35 -04:00
Mark Tozzi d94406a68a
HLRC: Deactivate Watch API (#34192)
Relates to #29827
2018-10-24 17:01:22 -04:00
Mayya Sharipova 6cceba9b54 Correct CRUDDocumentationIT.java
relates to #33447
2018-10-24 15:59:58 -04:00
Andrey Atapin 5f588180f9 Improve IndexNotFoundException's default error message (#34649)
This commit adds the index name to the error message when an index is not found.
2018-10-24 12:53:31 -07:00
Benjamin Trent cd27b0b996
Revert "Rollup add default metrics to histo groups (#34534)" (#34815)
This reverts commit 4236358f5d.
2018-10-24 14:25:10 -05:00
Mayya Sharipova bf4d90a5dc
HLRC API for _termvectors (#33447)
* HLRC API for _termvectors

relates to #27205
2018-10-24 14:27:22 -04:00
Colin Goodheart-Smithe c7fe87e43f
Removes Set Policy API in favour of setting index.lifecycle.name directly (#34304)
* Removes Set Policy API in favour of setting index.lifecycle.name
directly

* Reinstates matcher that will still be used

* Cleans up code after rebase

* Adds test to check changing policy with ndex settings works

* Fixes TimeseriesLifecycleActionsIT after API removal

* Fixes docs tests

* Fixes case on close where lifecycle service was never created
2018-10-24 16:14:59 +01:00
Gordon Brown 17adfeb20f
HLRC: Standardize access in *RequestConverters (#34768)
With the move to separate RequestConverters classes for each client,
some of the access restrictions on the new classes are more open than
the prior RequestConverters classes. This standardizes the
*RequestConverters classes as package-private, final, and with a private
constructor so that no instances of the can be inadvertently created.
2018-10-23 15:59:11 -06:00
Zachary Tong 299d044bfc
Collapse pipeline aggs into single package (#34658)
- Restrict visibility of Aggregators and Factories
- Move PipelineAggregatorBuilders up a level so it is consistent with
AggregatorBuilders
- Checkstyle line length fixes for a few classes
- Minor odds/ends (swapping to method references, formatting, etc)
2018-10-23 16:01:01 -04:00
Tal Levy 62ac2fa5ec Merge remote-tracking branch 'upstream/master' into index-lifecycle 2018-10-23 09:43:46 -07:00
Alpar Torok 0536635c44
Upgrade forbiddenapis to 2.6 (#33809)
* Upgrade forbiddenapis to 2.6

Closes #33759

* Switch forbiddenApis back to official plugin

* Remove CLI based task

* Fix forbiddenApisJava9
2018-10-23 12:06:46 +03:00
Tal Levy 67bfdb16ad Merge remote-tracking branch 'upstream/master' into index-lifecycle 2018-10-22 13:09:37 -07:00
Julie Tibshirani f854330e06
Make sure to use the type _doc in the REST documentation. (#34662)
* Replace custom type names with _doc in REST examples.
* Avoid using two mapping types in the percolator docs.
* Rename doc -> _doc in the main repository README.
* Also replace some custom type names in the HLRC docs.
2018-10-22 11:54:04 -07:00
Ryan Ernst 222652dfce
Scripting: Convert script fields to use script context (#34164)
This commit removes the use of SearchScript for script fields and adds
a new FieldScript.
2018-10-20 16:33:49 -07:00
Yannick Welsch 9fb2f7cc20
HLRC: Delete role API (#34620)
Adds the "Delete role" API to the high-level REST client.
2018-10-20 12:11:36 +02:00
Benjamin Trent b0d4ba2431
HLRC: ML %s/Boolean is/Boolean get/g (#34641) 2018-10-19 12:25:42 -05:00
Vladimir Dolzhenko 423d085bed
HLRC XPack Protocol clean up: Licence, Misc (#34469)
Relates #34451
2018-10-19 19:05:48 +02:00
Jack Conradson 1100942455
[HLRC] Add Start/Stop Watch Service APIs. (#34317) 2018-10-19 09:42:57 -07:00
Armin Braun 910e97422f
HLRC: Add ILM Retry (#33990)
* HLRC: Add ILM Retry

* Relates #33100
2018-10-19 14:04:49 +01:00
Colin Goodheart-Smithe 84ef91529c
Merge branch 'master' into index-lifecycle 2018-10-19 13:24:04 +01:00
Benjamin Trent 4236358f5d
Rollup add default metrics to histo groups (#34534)
* Rollup: Adding default metrics for histo group timefield (#34379)

* Rollup: Adding default histo metrics and tests

* fixing failing client side test with new default values

* Adding HLRC docs for default values

* Addressing PR comments

* Removing value_count default agg

* Updating docs for rollups

* Minor interval change
2018-10-19 07:23:25 -05:00
Yogesh Gaikwad 39a6163316
[HLRC] Add support for Delete role mapping API (#34531)
Building on expression dsl and create role mapping API, this
commit adds support for delete role mapping API to high level client.
2018-10-19 13:46:26 +11:00
Zachary Tong 45546e71c2
Add GetRollupCaps API to high level rest client (#32880)
Adds GetRollupCaps API to the HLRC, and tweaks some of the
Caps objects to be immutable.  Also various style tweaks
2018-10-18 17:12:38 -04:00
Ioannis Kakavas 6874ee8938 Remove deprecated setting from test
Replace xpack.security.transport.ssl.truststore.password deprecated
setting with xpack.security.transport.ssl.truststore.secure_password
in the HLRC integTestCluster.
2018-10-18 10:17:25 +03:00
Vladimir Dolzhenko 3621277969 eliminate NPE on closing restHighLevelClient (if test suite skips all test cases)
(cherry picked from 277704c5972148ee62900e781ac64b061aa4b767)
2018-10-18 09:07:10 +02:00
Colin Goodheart-Smithe 90f7cec7a5
Merge branch 'master' into index-lifecycle 2018-10-17 18:22:23 +01:00
Andy Bristol 18aa1c1381
add start trial API to HLRC (#33406)
Introduces client-specific request and response classes that do not
depend on the server

The `type` parameter is named `licenseType` in the response class to be
more descriptive. The parts that make up the acknowledged-required
response are given slightly different names than their server-response
types to be consistent with the naming in the put license API

Tests do not cover all cases because the integ test cluster starts up
with a trial license - this will be addressed in a future commit
2018-10-17 08:02:04 -07:00
Nik Everett 139bbc3f03
Rollup: Consolidate rollup cleanup for http tests (#34342)
This moves the rollup cleanup code for http tests from the high level rest
client into the test framework and then entirely removes the rollup cleanup
code for http tests that lived in x-pack. This is nice because it
consolidates the cleanup into one spot, automatically invokes the cleanup
without the test having to know that it is "about rollup", and should allow
us to run the rollup docs tests.

Part of #34530
2018-10-17 09:32:16 -04:00
Nik Everett 2cccd4c669
LLREST: Wrap at 140 columns (#34489)
Wraps a single line in a test to fit on 140 characters, removing the
only checkstyle suppression for the clients directory.
2018-10-17 09:17:02 -04:00
Tal Levy 335d268a66 fix timeout assertion in requestconvertertests 2018-10-16 16:38:56 -07:00
Tal Levy fbe8dc014c Merge branch 'master' into index-lifecycle 2018-10-16 13:58:53 -07:00
Jack Conradson 80474e138f
HLRC: Add remove index lifecycle policy (#34204)
This change adds the command RemoveIndexLifecyclePolicy to the HLRC. This uses the 
new TimeRequest as a base class for RemoveIndexLifecyclePolicyRequest on the client side.
2018-10-16 08:12:06 -07:00
lipsill 9b5eaafc24 HLRC: Documentation examples cleanup (#34009)
* Replace deprecated field `code` with `source` for stored scripts (#25127)
* Replace examples using the deprecated endpoint `{index}/{type}/_search`
with `{index}/_search` (#29468)
* Use a system property to avoid deprecation warnings after the Update
Scripts have been moved to their own context (#32096)
2018-10-16 10:46:14 -04:00
Vladimir Dolzhenko 230ad5339b
HLRC: Add support for XPack Post Start Basic Licence API (#33606)
Relates to #29827
2018-10-16 15:21:30 +02:00
Paul Sanwald 936faba6c4
Add delete rollup job support to HL REST Client (#34066)
Add support for delete rollup job to HL REST Client.
2018-10-16 09:02:29 -04:00
Yogesh Gaikwad f5ef2482df
HLRC: Fix the tags to be in sync with docs. (#34501)
Correct the tags mapping with the documentation.
This was added in #34171
2018-10-16 05:12:11 +01:00
Yogesh Gaikwad a4c302067e
HLRC: Create/Update role mapping API (#34171)
We added support for role mapper expression DSL in #33745,
that allows us to build the role mapper expression used in the
role mapping (as rules for determining user roles based on what
the boolean expression resolves to).

This change now adds support for create/update role mapping
API to the high-level rest client.
2018-10-16 03:05:46 +01:00
Ioannis Kakavas 8e133ab451 [DOCS] Fix tag in SecurityDocumentationIT 2018-10-15 20:03:47 +03:00
Ioannis Kakavas 55eaf7a3ff
HLRC: Get SSL Certificates API (#34135)
This change adds support for the get SSL certificate API to 
the high level rest client.
2018-10-15 17:20:34 +01:00
Colin Goodheart-Smithe 0b42eda0e3
Merge branch 'master' into index-lifecycle 2018-10-15 16:03:37 +01:00
Benjamin Trent 6f32f7138d
HLRC: Fixing bug when getting a missing pipeline (#34286)
closes #34119
2018-10-06 07:25:15 -07:00
Nik Everett d905cc8fc8
LLRC: Test for warnings behavior (#34143)
Add tests for the Low Level REST Client's strict deprecation handling.

Relates to #33708
2018-10-05 23:52:39 -04:00
Benjamin Trent 6f5daadb3c
Feature/hlrc ml docs cleanup (#34316)
* HLRC: ML Add preview datafeed api

* Changing deprecation handling for parser

* Removing some duplication in docs, will address other APIs in another PR

* HLRC: ML Cleanup docs

* updating get datafeed stats docs
2018-10-05 08:45:46 -07:00
Nik Everett a9fa5f2b33
Docs: DRY up CRUD docs (#34203)
This further applies the pattern set in #34125 to reduce copy-and-paste
in the single document CRUD portion of the High Level REST Client docs.
It also adds line wraps to snippets that are too wide to fit into the box
when rendered in the docs, following up on the work started in #34163.
2018-10-05 11:41:03 -04:00
Dimitris Athanasiou 4dacfa95d2
[ML] Allow asynchronous job deletion (#34058)
This changes the delete job API by adding
the choice to delete a job asynchronously.
The commit adds a `wait_for_completion` parameter
to the delete job request. When set to `false`,
the action returns immediately and the response
contains the task id.

This also changes the handling of subsequent
delete requests for a job that is already being
deleted. It now uses the task framework to check
if the job is being deleted instead of the cluster
state. This is a beneficial for it is going to also
be working once the job configs are moved out of the
cluster state and into an index. Also, force delete
requests that are waiting for the job to be deleted
will not proceed with the deletion if the first task
fails. This will prevent overloading the cluster. Instead,
the failure is communicated better via notifications
so that the user may retry.

Finally, this makes the `deleting` property of the job
visible (also it was renamed from `deleted`). This allows
a client to render a deleting job differently.

Closes #32836
2018-10-05 02:41:28 +03:00
Benjamin Trent 026488bcbf
HLRC: ML Adding get datafeed stats API (#34271)
* HLRC: ML Adding get datafeed stats API

* addressing PR comments

* fixing field exclusion filter

* removing unnecessary whitespace
2018-10-04 14:43:06 -07:00
Julie Tibshirani a6c5b6807f
Small fixes to the HLRC watcher documentation. (#34306)
* Make sure to use the new docs style for 'ack watch'.
* Replace 'document' with 'watcher' in page names.
2018-10-04 23:30:20 +02:00
Benjamin Trent 2dd058d607
HLRC: ML Add preview datafeed api (#34284)
* HLRC: ML Add preview datafeed api

* Changing deprecation handling for parser

* Removing some duplication in docs, will address other APIs in another PR
2018-10-04 11:28:44 -07:00
iverase f1f0687b57 Fix error in documentation for activete watch 2018-10-04 16:11:43 +02:00
David Kyle ef5007b6d8
[ML] Remove unused last_data_time member from Job (#34262) 2018-10-04 13:16:14 +01:00
Ignacio Vera 3ccb7af56a
HLRC: Add activate watch action (#33988)
* HLRC: Add activate watcher action

Adds activate watch action to the high level rest client.

Relates #29827
2018-10-04 12:49:52 +02:00
Ed Savage 577261ee57
[ML] Label anomalies with multi_bucket_impact (#34233)
* [ML] Label anomalies with  multi_bucket_impact

Add the multi_bucket_impact field to record results.
2018-10-04 09:08:21 +01:00
Gordon Brown d66a63ed7a
[HLRC] Update Stop & Start ILM APIs to use Validatable (#34242)
Convert the Stop and Start request objects to inherit from the
preferred Validatable instead of ActionRequest.
2018-10-03 15:39:21 -06:00
Kazuhiro Sera d45fe43a68 Fix a variety of typos and misspelled words (#32792) 2018-10-03 18:11:38 +01:00
Lee Hinman 90c55f5e36 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-10-03 09:11:28 -06:00
Julie Tibshirani c6fcb60071
Add support for 'ack watch' to the HLRC. (#33962) 2018-10-03 02:03:03 -07:00
Christoph Büscher a1c441f78a
HLRC: Add throttling for update & delete-by-query (#33951)
This change adds throttling to the update-by-query and delete-by-query cases
similar to throttling for reindex. This mostly means additional methods on the
client class itself, since the request hits the same RestHandler, just with
slightly different endpoints, and also the return values are similar.
2018-10-02 21:44:15 +02:00
Gordon Brown fb907706ec Merge branch 'master' into index-lifecycle 2018-10-02 13:43:46 -06:00
Jay Modi 2e5945a5e9
HLRC: PutUserRequest should not be closeable (#34196)
The PutUserRequest implemented closeable as it assumed ownership of the
password provided to the class. This change removes the ownership of
the password, documents it in the javadoc, and removes the closeable
implementation.

Additionally, the intermediate bytes used for writing the password to
XContent are now cleared. This makes the PutUserRequest consistent with
the behavior discussed in #33509.
2018-10-02 10:10:32 -06:00
Christoph Büscher 5183ea3d68
Use OptionalInt instead of Optional<Integer> (#34220)
Optionals containing boxed primitive types are prohibitively costly because they
have two level of boxing. For Optional<Integer> the analogous OptionalInt can be
used to avoid the boxing of the contained int value.
2018-10-02 15:58:07 +02:00
Nik Everett f904c41506
HLRC: Add get rollup job (#33921)
Adds support for the get rollup job to the High Level REST Client. I had
to do three interesting and unexpected things:
1. I ported the rollup state wiping code into the high level client
tests. I'll move this into the test framework in a followup and remove
the x-pack version.
2. The `timeout` in the rollup config was serialized using the
`toString` representation of `TimeValue` which produces fractional time
values which are more human readable but aren't supported by parsing. So
I switched it to `getStringRep`.
3. Refactor the xcontent round trip testing utilities so we can test
parsing of classes that don't implements `ToXContent`.
2018-10-02 09:11:29 -04:00
Ioannis Kakavas 300896d401
HLRC: add change password API support (#33509)
This change adds support for the change password APIs to the high
level rest client.

Relates #29827
2018-10-02 12:14:25 +03:00
Lee Hinman 2d9cb21490 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-10-01 14:10:09 -06:00
Nik Everett ad3218b4ab
Checkstyle: Catch wide snippets (#34163)
We use wrap code in `// tag` and `//end` to include it in our docs. Our
current docs style wraps code snippets in a box that is only wide enough
for 76 characters and adds a horizontal scroll bar for wider snippets
which makes the snippet much harder to read. This adds a checkstyle check
that looks for java code that is included in the docs and is wider than
that 76 characters so all snippets fit into the box. It solves many of
the failures that this catches but suppresses many more. I will clean
those up in a follow up change.
2018-10-01 15:22:15 -04:00
Nik Everett 8082b4ad4a
Docs: DRY up HLRC index docs (#34157)
Use tricks pioneered in #34125 to shorted asciidoc for the index API's
docs. Also slightly shorten the supported-api docs file.
2018-10-01 09:59:36 -04:00
Lee Hinman 6ea396a476 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-28 15:40:12 -06:00
Nik Everett 47bcb56a89
Docs: Cut down on high level rest client copy-and-paste-ness (#34125)
* Anchors

* includes

* get settings

* more

* More
2018-09-28 14:48:11 -04:00
lipsill b3218fef20 LLREST: Introduce a strict mode (#33708)
Introduces `RestClientBuilder#setStrictDeprecationMode` which defaults
to false but when set to true, causes a rest request to fail if a
deprecation warning header comes back in the response from Elasticsearch.
This should be valueable to Elasticsearch's tests, especially those of the
High Level REST Client where they will help catch divergence between the
client and the server.
2018-09-28 09:25:19 -04:00
Lee Hinman a26cc1a242 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-27 11:00:37 -06:00
Dimitris Athanasiou 609ccaad07
[ML][HLRC] Replace REST-based ML test cleanup with the ML client (#34109)
Now that all basic APIs for managing jobs and datafeeds have been
implemented we replace the duplicated `MlRestTestStateCleaner`
with an implementation that uses the HLRC Machine Learning client
itself.
2018-09-27 15:33:22 +03:00
Yogesh Gaikwad 53d10bb3b2
[HLRC] Support for role mapper expression dsl (#33745)
This commit adds support for role mapping expression dsl.
Functionally it is similar to what we have on the server side
except for the rule evaluation which is not required on the client.

The role mapper expression can either be field expression or
composite expression of one or more expressions. Role mapper
expression parser is used to parse JSON DSL to list of expressions.

This forms the base for role mapping APIs (get, post/put and delete)
2018-09-27 18:40:52 +10:00
Nik Everett ddce9704d4
Logging: Drop two deprecated methods (#34055)
This drops two deprecated methods from `ESLoggerFactory`, switching all
calls to those methods to calls to methods of the same name on
`LogManager`.
2018-09-26 11:20:52 -04:00
Benjamin Trent e6d1af66ca
Changing bucket length and data indexed timestamps (#33995)
* Changing bucket length and data indexed timestamps

* changing test variable names to lessen confusion
2018-09-26 06:35:17 -07:00
Christoph Büscher ba3ceeaccf
Clean up "unused variable" warnings (#31876)
This change cleans up "unused variable" warnings. There are several cases were we 
most likely want to suppress the warnings (especially in the client documentation test
where the snippets contain many unused variables). In a lot of cases the unused
variables can just be deleted though.
2018-09-26 14:09:32 +02:00
Lee Hinman 243e863f6e Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-24 10:33:51 -06:00
Christoph Büscher a9ded8f1d5 Mute MachineLearningIT#testStartDatafeed 2018-09-24 11:03:58 +02:00
Benjamin Trent ea3f3e4b61
HLRC: ML Stop datafeed API (#33946)
* HLRC: ML stop data feed api
2018-09-21 12:13:35 -07:00
Benjamin Trent bf0a0f74da
HLRC: ML start data feed API (#33898)
* HLRC: ML start data feed API
2018-09-21 05:56:38 -07:00
Christoph Büscher 77145bb477
HLRC: Add support for reindex rethrottling (#33832)
This change adds support for rethrottling reindex requests to the
RestHighLevelClient.
2018-09-20 18:56:12 +02:00
Christoph Büscher 019aeadb7d
HLRC: Reindex should support `requests_per_seconds` parameter (#33808)
The high level Rest clients reindex method currently doesn't pass on the
"requests_per_second" that are optionally set in ReindexRequest through the Rest
layer. This change makes sure the value is added to the request parameters if
set and also includes it for the update-by-query and delete-by-query cases.
2018-09-20 15:01:36 +02:00
Gordon Brown 90de436e55
Use custom index metadata for ILM state (#33783)
Using index settings for ILM state is fragile and exposes too much
information that doesn't need to be exposed. Using custom index metadata
is more resilient and allows more controlled access to internal
information.

As part of these changes, moves away from using defaults for ILM-related
values, in favor of using null values to clearly indicate that the value is not
present.
2018-09-19 14:50:48 -06:00
Julie Tibshirani c764012347
Create a WatchStatus class for the high-level REST client. (#33527)
This class will be used in a few of the watcher responses ('get watch', 'ack watch', etc.), so it's being introduced first in its own PR.
2018-09-19 12:17:08 -07:00
Lee Hinman 81e9150c7a Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-19 09:43:26 -06:00
David Kyle 68c0a29578
HLRC: Delete ML calendar (#33775) 2018-09-19 10:20:21 +01:00
Lee Hinman c87cff22b4 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-18 13:57:41 -06:00
Dimitris Athanasiou 8e0d74adad
[ML][HLRC] Remove deleted property from Job (#33763)
The deleted property is meant to be used internally.
Users of the client should not need interact with that property.
2018-09-18 12:56:37 +01:00
David Kyle 9543992d8e
HLRC: Get ML calendars (#33760) 2018-09-18 11:51:11 +01:00
Tal Levy 94a66c556d
add phase execution info to ILM Explain API (#33488)
adds a section for phase execution to the Explain API.

This contains

- phase definition
- policy name
- policy version
- modified date
2018-09-17 17:00:00 -07:00
Michael Basnight 42e106fb22
HLRC: split indices request converters (#33433)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the IndicesClient
request converters.
2018-09-17 17:38:30 -05:00
Lee Hinman 7ff11b4ae1 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-17 10:41:10 -06:00
David Turner 6b0fc5382a Suppress DeadHostStateTests on Windows 2018-09-17 09:22:52 +01:00
Tanguy Leroux e77835c6f5
Add create rollup job api to high level rest client (#33521)
This commit adds the Create Rollup Job API to the high level REST
client. It supersedes #32703 and adds dedicated request/response
objects so that it does not depend on server side components.

Related #29827
2018-09-17 09:10:23 +02:00
Dimitris Athanasiou db40315afb
[HLRC][ML] Add ML get datafeed API to HLRC (#33715)
Relates #29827
2018-09-16 11:54:55 +01:00
Lee Hinman e6cbaa5a78 Merge remote-tracking branch 'origin/master' into index-lifecycle 2018-09-14 16:27:37 -06:00
David Kyle b04faa059b
HLRC: ML PUT Calendar (#33362) 2018-09-14 15:00:18 +01:00
Dimitris Athanasiou 9600819cef
[HLRC][ML] Add ML delete datafeed API to HLRC (#33667)
Relates #29827
2018-09-13 17:13:36 +01:00
Colin Goodheart-Smithe 8e59de3eb2
Merge branch 'master' into index-lifecycle 2018-09-13 09:46:14 +01:00
Dimitris Athanasiou 2eb2313b60
[HLRC][ML] Add ML put datafeed API to HLRC (#33603)
This also changes both `DatafeedConfig` and `DatafeedUpdate`
to store the query and aggs as a bytes reference. This allows
the client to remove its dependency to the named objects
registry of the search module.

Relates #29827
2018-09-12 14:52:36 +01:00