elasticsearch-xpack 5.0.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/elasticsearch-xpack.gemspec +2 -2
  3. data/lib/elasticsearch/xpack.rb +2 -0
  4. data/lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb +31 -0
  5. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb +29 -0
  6. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb +24 -0
  7. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb +26 -0
  8. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_job.rb +29 -0
  9. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_model_snapshot.rb +28 -0
  10. data/lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb +36 -0
  11. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb +48 -0
  12. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb +33 -0
  13. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb +25 -0
  14. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb +25 -0
  15. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_filters.rb +30 -0
  16. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_influencers.rb +44 -0
  17. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_job_stats.rb +25 -0
  18. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_jobs.rb +25 -0
  19. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb +41 -0
  20. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb +44 -0
  21. data/lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb +28 -0
  22. data/lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb +33 -0
  23. data/lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb +26 -0
  24. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb +28 -0
  25. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb +28 -0
  26. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb +28 -0
  27. data/lib/elasticsearch/xpack/api/actions/machine_learning/revert_model_snapshot.rb +31 -0
  28. data/lib/elasticsearch/xpack/api/actions/machine_learning/start_datafeed.rb +34 -0
  29. data/lib/elasticsearch/xpack/api/actions/machine_learning/stop_datafeed.rb +31 -0
  30. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_datafeed.rb +28 -0
  31. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_job.rb +28 -0
  32. data/lib/elasticsearch/xpack/api/actions/machine_learning/update_model_snapshot.rb +30 -0
  33. data/lib/elasticsearch/xpack/api/actions/machine_learning/validate.rb +26 -0
  34. data/lib/elasticsearch/xpack/api/actions/machine_learning/validate_detector.rb +26 -0
  35. data/lib/elasticsearch/xpack/api/actions/security/delete_role_mapping.rb +34 -0
  36. data/lib/elasticsearch/xpack/api/actions/security/disable_user.rb +33 -0
  37. data/lib/elasticsearch/xpack/api/actions/security/enable_user.rb +33 -0
  38. data/lib/elasticsearch/xpack/api/actions/security/get_role_mapping.rb +25 -0
  39. data/lib/elasticsearch/xpack/api/actions/security/get_token.rb +26 -0
  40. data/lib/elasticsearch/xpack/api/actions/security/invalidate_token.rb +26 -0
  41. data/lib/elasticsearch/xpack/api/actions/security/put_role_mapping.rb +36 -0
  42. data/lib/elasticsearch/xpack/api/namespace/machine_learning.rb +20 -0
  43. data/lib/elasticsearch/xpack/version.rb +1 -1
  44. metadata +50 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0afd2c0eab78339bb2f6450ba069722868ad7798
4
- data.tar.gz: 6658e1652f08645cd154f7fbfd27f24bc1f3e8d3
3
+ metadata.gz: 07db460f6169c230788a8065924cf9bfabf75ded
4
+ data.tar.gz: 99035150cc2c228c4456e23273dbf5a55b5c24ba
5
5
  SHA512:
6
- metadata.gz: fab2369f74f72cdb096a40533b4522e4f6b30391d6a03d0f10750bbc47c16a78c2858d944e25725dfaadaf68e3bd7e713a81fbeeb6144f4af6b5b7098d493d8c
7
- data.tar.gz: 681fad54b21fb163f4db599d765cf973a12b2482d106ae9617a3e87c4324af33827cf4ea41bab6fcd5743711c6db520af5a5791efdeb33421bcbbacd47f330b6
6
+ metadata.gz: 2b352de12499a84034a704a66a78ca5022a604bc231eb5c5a1b113d41ec9accc1234c0b492722e428628955d6a34b3a89e487b010cee6cd1c44f9eeeb116a6a9
7
+ data.tar.gz: 976c0a21635d66387285944afca22dfd3f062e1cfc835ed3fdc78e6be2aee46138fc1771d84bea99c8d30a2a8c13ab01b782dabe917ecf4a92fda3a04b0410ab
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_dependency "elasticsearch-api"
25
25
 
26
- spec.add_development_dependency "elasticsearch"
27
- spec.add_development_dependency "elasticsearch-transport"
26
+ spec.add_development_dependency "elasticsearch", '~> 5'
27
+ spec.add_development_dependency "elasticsearch-transport", '~> 5'
28
28
  spec.add_development_dependency "elasticsearch-extensions"
29
29
 
30
30
  spec.add_development_dependency "activesupport"
@@ -21,6 +21,8 @@ module Elasticsearch
21
21
  end
22
22
  end
23
23
 
24
+ Elasticsearch::API::COMMON_PARAMS.push :job_id, :datafeed_id, :filter_id, :snapshot_id, :category_id
25
+
24
26
  module Elasticsearch
25
27
  module Transport
26
28
  class Client
@@ -0,0 +1,31 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id The name of the job to close (*Required*)
10
+ # @option arguments [Boolean] :force True if the job should be forcefully closed
11
+ # @option arguments [Time] :timeout Controls the time to wait until a job has closed. Default to 30 minutes
12
+ #
13
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-close-job.html
14
+ #
15
+ def close_job(arguments={})
16
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
17
+ valid_params = [
18
+ :force,
19
+ :timeout ]
20
+ method = Elasticsearch::API::HTTP_POST
21
+ path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_close"
22
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
23
+ body = nil
24
+
25
+ perform_request(method, path, params, body).body
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,29 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :datafeed_id The ID of the datafeed to delete (*Required*)
10
+ # @option arguments [Boolean] :force True if the datafeed should be forcefully deleted
11
+ #
12
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-delete-datafeed.html
13
+ #
14
+ def delete_datafeed(arguments={})
15
+ raise ArgumentError, "Required argument 'datafeed_id' missing" unless arguments[:datafeed_id]
16
+ valid_params = [
17
+ :force ]
18
+ method = Elasticsearch::API::HTTP_DELETE
19
+ path = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}"
20
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
21
+ body = nil
22
+
23
+ perform_request(method, path, params, body).body
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,24 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ #
10
+ # @see [TODO]
11
+ #
12
+ def delete_expired_data(arguments={})
13
+ method = Elasticsearch::API::HTTP_DELETE
14
+ path = "_xpack/ml/_delete_expired_data"
15
+ params = {}
16
+ body = nil
17
+
18
+ perform_request(method, path, params, body).body
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :filter_id The ID of the filter to delete (*Required*)
10
+ #
11
+ # @see [TODO]
12
+ #
13
+ def delete_filter(arguments={})
14
+ raise ArgumentError, "Required argument 'filter_id' missing" unless arguments[:filter_id]
15
+ method = Elasticsearch::API::HTTP_DELETE
16
+ path = "_xpack/ml/filters/#{arguments[:filter_id]}"
17
+ params = {}
18
+ body = nil
19
+
20
+ perform_request(method, path, params, body).body
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id The ID of the job to delete (*Required*)
10
+ # @option arguments [Boolean] :force True if the job should be forcefully deleted
11
+ #
12
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-delete-job.html
13
+ #
14
+ def delete_job(arguments={})
15
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
16
+ valid_params = [
17
+ :force ]
18
+ method = Elasticsearch::API::HTTP_DELETE
19
+ path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}"
20
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
21
+ body = nil
22
+
23
+ perform_request(method, path, params, body).body
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,28 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id The ID of the job to fetch (*Required*)
10
+ # @option arguments [String] :snapshot_id The ID of the snapshot to delete (*Required*)
11
+ #
12
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-delete-snapshot.html
13
+ #
14
+ def delete_model_snapshot(arguments={})
15
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
16
+ raise ArgumentError, "Required argument 'snapshot_id' missing" unless arguments[:snapshot_id]
17
+ method = Elasticsearch::API::HTTP_DELETE
18
+ path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/model_snapshots/#{arguments[:snapshot_id]}"
19
+ params = {}
20
+ body = nil
21
+
22
+ perform_request(method, path, params, body).body
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id The name of the job to flush (*Required*)
10
+ # @option arguments [Hash] :body Flush parameters
11
+ # @option arguments [Boolean] :calc_interim Calculates interim results for the most recent bucket or all buckets within the latency period
12
+ # @option arguments [String] :start When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
13
+ # @option arguments [String] :end When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results
14
+ # @option arguments [String] :advance_time Setting this tells the Engine API that no data prior to advance_time is expected
15
+ #
16
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-flush-job.html
17
+ #
18
+ def flush_job(arguments={})
19
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
20
+ valid_params = [
21
+ :calc_interim,
22
+ :start,
23
+ :end,
24
+ :advance_time ]
25
+ method = Elasticsearch::API::HTTP_POST
26
+ path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/_flush"
27
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
28
+ body = arguments[:body]
29
+
30
+ perform_request(method, path, params, body).body
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,48 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id ID of the job to get bucket results from (*Required*)
10
+ # @option arguments [String] :timestamp The timestamp of the desired single bucket result
11
+ # @option arguments [Hash] :body Bucket selection details if not provided in URI
12
+ # @option arguments [Boolean] :expand Include anomaly records
13
+ # @option arguments [Boolean] :exclude_interim Exclude interim results
14
+ # @option arguments [Int] :from skips a number of buckets
15
+ # @option arguments [Int] :size specifies a max number of buckets to get
16
+ # @option arguments [String] :start Start time filter for buckets
17
+ # @option arguments [String] :end End time filter for buckets
18
+ # @option arguments [Double] :anomaly_score Filter for the most anomalous buckets
19
+ # @option arguments [String] :sort Sort buckets by a particular field
20
+ # @option arguments [Boolean] :desc Set the sort direction
21
+ #
22
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-get-bucket.html
23
+ #
24
+ def get_buckets(arguments={})
25
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
26
+ valid_params = [
27
+ :timestamp,
28
+ :expand,
29
+ :exclude_interim,
30
+ :from,
31
+ :size,
32
+ :start,
33
+ :end,
34
+ :anomaly_score,
35
+ :sort,
36
+ :desc ]
37
+ method = Elasticsearch::API::HTTP_GET
38
+ path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", arguments[:timestamp]
39
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
40
+ body = arguments[:body]
41
+
42
+ perform_request(method, path, params, body).body
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,33 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id The name of the job (*Required*)
10
+ # @option arguments [Long] :category_id The identifier of the category definition of interest
11
+ # @option arguments [Hash] :body Category selection details if not provided in URI
12
+ # @option arguments [Int] :from skips a number of categories
13
+ # @option arguments [Int] :size specifies a max number of categories to get
14
+ #
15
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-get-category.html
16
+ #
17
+ def get_categories(arguments={})
18
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
19
+ valid_params = [
20
+ :from,
21
+ :size ]
22
+ method = Elasticsearch::API::HTTP_GET
23
+ path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/categories", arguments[:category_id]
24
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
25
+ body = arguments[:body]
26
+
27
+ perform_request(method, path, params, body).body
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,25 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :datafeed_id The ID of the datafeeds stats to fetch
10
+ #
11
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-get-datafeed-stats.html
12
+ #
13
+ def get_datafeed_stats(arguments={})
14
+ method = Elasticsearch::API::HTTP_GET
15
+ path = Elasticsearch::API::Utils.__pathify "_xpack/ml/datafeeds", arguments[:datafeed_id], "/_stats"
16
+ params = {}
17
+ body = nil
18
+
19
+ perform_request(method, path, params, body).body
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :datafeed_id The ID of the datafeeds to fetch
10
+ #
11
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-get-datafeed.html
12
+ #
13
+ def get_datafeeds(arguments={})
14
+ method = Elasticsearch::API::HTTP_GET
15
+ path = "_xpack/ml/datafeeds/#{arguments[:datafeed_id]}"
16
+ params = {}
17
+ body = nil
18
+
19
+ perform_request(method, path, params, body).body
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,30 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :filter_id The ID of the filter to fetch
10
+ # @option arguments [Int] :from skips a number of filters
11
+ # @option arguments [Int] :size specifies a max number of filters to get
12
+ #
13
+ # @see [TODO]
14
+ #
15
+ def get_filters(arguments={})
16
+ valid_params = [
17
+ :from,
18
+ :size ]
19
+ method = Elasticsearch::API::HTTP_GET
20
+ path = "_xpack/ml/filters/#{arguments[:filter_id]}"
21
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
22
+ body = nil
23
+
24
+ perform_request(method, path, params, body).body
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,44 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :job_id [TODO] (*Required*)
10
+ # @option arguments [Hash] :body Influencer selection criteria
11
+ # @option arguments [Boolean] :exclude_interim Exclude interim results
12
+ # @option arguments [Int] :from skips a number of influencers
13
+ # @option arguments [Int] :size specifies a max number of influencers to get
14
+ # @option arguments [String] :start start timestamp for the requested influencers
15
+ # @option arguments [String] :end end timestamp for the requested influencers
16
+ # @option arguments [Double] :influencer_score influencer score threshold for the requested influencers
17
+ # @option arguments [String] :sort sort field for the requested influencers
18
+ # @option arguments [Boolean] :desc whether the results should be sorted in decending order
19
+ #
20
+ # @see http://www.elastic.co/guide/en/x-pack/current/ml-get-influencer.html
21
+ #
22
+ def get_influencers(arguments={})
23
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
24
+ valid_params = [
25
+ :exclude_interim,
26
+ :from,
27
+ :size,
28
+ :start,
29
+ :end,
30
+ :influencer_score,
31
+ :sort,
32
+ :desc ]
33
+ method = Elasticsearch::API::HTTP_GET
34
+ path = "_xpack/ml/anomaly_detectors/#{arguments[:job_id]}/results/influencers"
35
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
36
+ body = arguments[:body]
37
+
38
+ perform_request(method, path, params, body).body
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end