Commit Graph

349 Commits

Author SHA1 Message Date
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
Kazuhiro Sera d45fe43a68 Fix a variety of typos and misspelled words (#32792) 2018-10-03 18:11:38 +01: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
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
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
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
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
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
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
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
David Kyle 68c0a29578
HLRC: Delete ML calendar (#33775) 2018-09-19 10:20:21 +01: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
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
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
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
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
Benjamin Trent 27e07ec859
HLRC: ML Delete Forecast API (#33526)
* HLRC: ML Delete Forecast API
2018-09-11 16:32:52 -07:00
Ed Savage 2f3b542d57
HLRC: Add ML get categories API (#33465)
HLRC: Adding the ML 'get categories' API
2018-09-11 12:48:14 +01:00
Julie Tibshirani 95100e05f9
Remove some duplicate request conversion methods. (#33538) 2018-09-09 20:02:35 -07:00
S.Y. Wang 9073dbefd6 HLRC: Add put stored script support to high-level rest client (#31323)
Relates to #27205
2018-09-09 13:47:47 +02:00
Michael Basnight d6b40f4c7b
HLRC: split ingest request converters (#33435)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the IngestClient
request converters.
2018-09-07 13:44:16 -05:00
Michael Basnight 8d61457d9c
HLRC: split xpack request converters (#33444)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the XPackClient
request converters.
2018-09-07 13:30:57 -05:00
Michael Basnight 43592305a1
HLRC: split watcher request converters (#33442)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the WatcherClient
request converters.
2018-09-07 13:08:31 -05:00
Jay Modi 9d16a7b7f0
HLRC: add enable and disable user API support (#33481)
This change adds support for enable and disable user APIs to the high
level rest client. There is a common request base class for both
requests with specific requests that simplify the use of these APIs.

The response for these APIs is simply an empty object so a new response
class has been created for cases where we expect an empty response to
be returned.

Finally, the put user documentation has been moved to the proper
location that is not within an x-pack sub directory and the document
tags no longer contain x-pack.

See #29827
2018-09-07 11:51:37 -06:00
Benjamin Trent 4d233107f8
HLRC: ML Forecast Job (#33506)
* HLRC: ML Forecast job
2018-09-07 11:16:58 -05:00
Michael Basnight 42469a9930
HLRC: split migration request converters (#33436)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the MigrationClient
request converters.
2018-09-07 09:46:27 -05:00
Michael Basnight c32e71c61f
HLRC: split snapshot request converters (#33439)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the SnapshotClient
request converters.
2018-09-07 09:25:47 -05:00
Benjamin Trent 9230a48722
HLRC: ML Post Data (#33443)
* HLRC: ML Post data
2018-09-07 07:04:27 -05:00
Jim Ferenczi 79cd6385fe
Collapse package structure for metrics aggs (#33463)
This change collapses all metrics aggregations classes into a single package `org.elasticsearch.aggregations.metrics`.
It also restricts the visibility of some classes (aggregators and factories) that should not be used outside of the package.

Relates #22868
2018-09-07 10:58:06 +02:00
Michael Basnight 6a3adbd935
HLRC: split tasks request converters (#33441)
In an effort to encapsulate the different clients, the request
converters are being shuffled around. This splits the TasksClient
request converters.
2018-09-06 14:11:27 -05:00