elasticsearch-xpack 6.0.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -8
  3. data/Rakefile +18 -51
  4. data/elasticsearch-xpack.gemspec +1 -1
  5. data/examples/watcher/error_500.rb +4 -2
  6. data/lib/elasticsearch/xpack/api/actions/license/get_basic_status.rb +24 -0
  7. data/lib/elasticsearch/xpack/api/actions/license/get_trial_status.rb +24 -0
  8. data/lib/elasticsearch/xpack/api/actions/license/post_start_basic.rb +27 -0
  9. data/lib/elasticsearch/xpack/api/actions/license/post_start_trial.rb +29 -0
  10. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb +26 -0
  11. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb +28 -0
  12. data/lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb +28 -0
  13. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb +5 -1
  14. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb +42 -0
  15. data/lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb +35 -0
  16. data/lib/elasticsearch/xpack/api/actions/machine_learning/info.rb +24 -0
  17. data/lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb +28 -0
  18. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb +27 -0
  19. data/lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb +28 -0
  20. data/lib/elasticsearch/xpack/api/actions/rollup/delete_job.rb +26 -0
  21. data/lib/elasticsearch/xpack/api/actions/rollup/get_jobs.rb +25 -0
  22. data/lib/elasticsearch/xpack/api/actions/rollup/get_rollup_caps.rb +25 -0
  23. data/lib/elasticsearch/xpack/api/actions/rollup/put_job.rb +28 -0
  24. data/lib/elasticsearch/xpack/api/actions/rollup/rollup_search.rb +29 -0
  25. data/lib/elasticsearch/xpack/api/actions/rollup/start_job.rb +26 -0
  26. data/lib/elasticsearch/xpack/api/actions/rollup/stop_job.rb +26 -0
  27. data/lib/elasticsearch/xpack/api/actions/sql/clear_cursor.rb +26 -0
  28. data/lib/elasticsearch/xpack/api/actions/sql/query.rb +29 -0
  29. data/lib/elasticsearch/xpack/api/actions/sql/translate.rb +26 -0
  30. data/lib/elasticsearch/xpack/api/namespace/rollup.rb +18 -0
  31. data/lib/elasticsearch/xpack/api/namespace/sql.rb +18 -0
  32. data/lib/elasticsearch/xpack/version.rb +1 -1
  33. data/pkg/elasticsearch-xpack-0.1.0.gem +0 -0
  34. data/pkg/elasticsearch-xpack-0.1.0.pre.gem +0 -0
  35. data/pkg/elasticsearch-xpack-5.0.0.gem +0 -0
  36. data/pkg/elasticsearch-xpack-5.5.0.gem +0 -0
  37. data/pkg/elasticsearch-xpack-6.0.0.gem +0 -0
  38. metadata +34 -6
  39. data/.gitignore +0 -9
  40. data/.travis.yml +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d48434e595d29f97917ce830f882a8ed59adae3
4
- data.tar.gz: e0ccd6d9d03a15b5903c4f29ee2c1c65b68abd39
3
+ metadata.gz: fa6fc2a74bcb41b804f8ba4dc3b6ba67fe1a270b
4
+ data.tar.gz: d3707ca8cde6dafe9d4838626c73eb02b0bc3755
5
5
  SHA512:
6
- metadata.gz: 7e500cb2dc4facffc1861535c6a036d6959511519df85da4b3d833f9ee227ae857785f378ccd9c43794deefc1ab167cdc96b0dc74ed43fbd646c19da681b5a05
7
- data.tar.gz: 6d463b5c155cb048b0d4528114b21d0c5fa703c7591a8a71a91245d000fa10f076be40bde5f50a12c5e3fbfe30cd05cd665976bb4b615b88ad58849d0f1cfff7
6
+ metadata.gz: 70f3c9ebf64ae75906d9b766a196d61f84db8bdddf3f0bbe6107f1cb0bc28fa8551c7c5e6381ec0f5573a1395128c43c20bc2d02f95c1b79d313e0b45ddbff2a
7
+ data.tar.gz: 04a4a1baa47e744ca64be8ae2c156ac9cb08dc3facccb31d7247b7f01e369a26ac2df14dadf8db4e70ac6493d6bae88f8e841384b31a0bfd0b2fea10a727119a
data/README.md CHANGED
@@ -11,13 +11,8 @@ Install the package from [Rubygems](https://rubygems.org):
11
11
 
12
12
  To use an unreleased version, either add it to your `Gemfile` for [Bundler](http://gembundler.com):
13
13
 
14
- gem 'elasticsearch-xpack', git: 'https://github.com/elastic/elasticsearch-x-pack-ruby.git'
14
+ gem 'elasticsearch-xpack', git: 'https://github.com/elastic/elasticsearch-ruby.git'
15
15
 
16
- or install it from a source code checkout:
17
-
18
- git clone https://github.com/elasticsearch/elasticsearch-xpack-ruby.git
19
- bundle install
20
- rake install
21
16
 
22
17
  ## Usage
23
18
 
@@ -42,8 +37,8 @@ official [X-Pack for the Elastic Stack](https://www.elastic.co/guide/en/x-pack/c
42
37
 
43
38
  For examples, look into the [`examples`](examples) folder in this repository.
44
39
 
45
- You can use the provided `test:server` Rake task to launch
46
- a [Docker-based](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docker.html#_image_types)
40
+ You can use the provided `test:elasticsearch` Rake task to launch
41
+ a [Docker-based](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)
47
42
  Elasticsearch node with the full X-Pack license preinstalled.
48
43
 
49
44
  ## License
data/Rakefile CHANGED
@@ -16,66 +16,33 @@ end
16
16
  namespace :test do
17
17
  desc "Run integration tests"
18
18
  task :integration do
19
- require 'ansi'
20
-
21
- suites = %w[
22
- plugin/src/test/resources/rest-api-spec/test/
23
- ]
24
-
25
- # TEMPORARY
26
- disabled_suites = %w[
27
- ]
28
-
29
- suites = (suites + disabled_suites).select! { |d| d =~ Regexp.new(ENV['SUITE'].gsub(/,/, '|')) } if ENV['SUITE']
30
-
31
- executed_suites = []
32
-
33
- at_exit do
34
- errors = executed_suites.any? { |d| d.values.first == 1 }
35
- color = errors ? :red : :green
36
-
37
- if errors
38
- puts "----- ".ansi(color) + "ERROR".ansi(color).ansi(:bold) + ('-'*(80-12)).ansi(color)
39
- else
40
- puts "----- ".ansi(color) + "SUCCESS".ansi(color).ansi(:bold) + ('-'*(80-13)).ansi(color)
41
- end
42
-
43
- executed_suites.each do |d|
44
- name = d.keys.first.gsub(%r{x-plugins/elasticsearch/x-pack/([^/]+)/.*}, '\1')
45
- status = d.values.first == 0 ? 'OK'.ansi(:green) : 'KO'.ansi(:red)
46
- puts "#{status} #{name.ansi(:bold)}"
47
- end
48
-
49
- puts ('-'*80).ansi(color)
50
-
51
- exit( errors ? 1 : 0 )
52
- end
53
-
54
- suites.each do |suite|
55
- begin
56
- sh <<-COMMAND
57
- TEST_REST_API_SPEC=../x-pack-elasticsearch/#{suite} bundle exec ruby -I lib:test test/integration/yaml_test_runner.rb
58
- COMMAND
59
- executed_suites << { suite => 0 }
60
- rescue RuntimeError
61
- executed_suites << { suite => 1 }
62
- end
63
-
64
- puts '', '-'*80, ''
65
- end
19
+ sh <<-COMMAND
20
+ bundle exec ruby -I ../elasticsearch/lib:../elasticsearch-transport/lib:../elasticsearch-api/lib:./lib:./test test/integration/yaml_test_runner.rb
21
+ COMMAND
66
22
  end
67
23
 
68
24
  desc "Run Elasticsearch with X-Pack installed (Docker)"
69
- task :server do
25
+ task :elasticsearch do
70
26
  sh <<-COMMAND.gsub(/^\s*/, '').gsub(/\s{1,}/, ' ')
71
27
  docker run \
72
28
  --name elasticsearch-xpack \
73
- --env ELASTIC_PASSWORD=changeme \
74
- --env cluster.name=elasticsearch-xpack-test \
29
+ --env "discovery.type=single-node" \
30
+ --env "cluster.name=elasticsearch-api-test" \
31
+ --env "node.name=es-01" \
32
+ --env "http.port=9200" \
33
+ --env "cluster.routing.allocation.disk.threshold_enabled=false" \
34
+ --env "node.attr.testattr=test" \
35
+ --env "path.repo=/tmp" \
36
+ --env "repositories.url.allowed_urls=http://snapshot.test*" \
37
+ --env "bootstrap.memory_lock=true" \
38
+ --env "ELASTIC_PASSWORD=MagicWord" \
39
+ --ulimit nofile=65536:65536 \
40
+ --ulimit memlock=-1:-1 \
75
41
  --publish 9260:9200 \
42
+ --volume $(pwd)/tmp/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
76
43
  --memory 4g \
77
44
  --rm \
78
- docker.elastic.co/elasticsearch/elasticsearch-platinum:6.1.1
45
+ docker.elastic.co/elasticsearch/elasticsearch:7.0.0-alpha1-SNAPSHOT
79
46
  COMMAND
80
47
  end
81
48
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = "Ruby integrations for the X-Pack extensions for Elasticsearch"
13
13
  spec.description = "Ruby integrations for the X-Pack extensions for Elasticsearch"
14
- spec.homepage = "https://github.com/elastic/elasticsearch-xpack-ruby"
14
+ spec.homepage = "https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-xpack"
15
15
  spec.license = "Apache 2"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -25,7 +25,9 @@
25
25
  require 'elasticsearch'
26
26
  require 'elasticsearch/xpack'
27
27
 
28
- client = Elasticsearch::Client.new url: 'http://elastic:changeme@localhost:9260', log: true
28
+ password = ENV.fetch('ELASTIC_PASSWORD', 'changeme')
29
+
30
+ client = Elasticsearch::Client.new url: "http://elastic:#{password}@localhost:9260", log: true
29
31
  client.transport.logger.formatter = proc do |severity, datetime, progname, msg| "\e[2m#{msg}\e[0m\n" end
30
32
 
31
33
  # Print information about the Watcher plugin
@@ -169,4 +171,4 @@ end
169
171
 
170
172
  # Delete the watch
171
173
  #
172
- client.xpack.watcher.delete_watch id: 'error_500', master_timeout: '30s'
174
+ client.xpack.watcher.delete_watch id: 'error_500'
@@ -0,0 +1,24 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module License
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ #
10
+ # @see https://www.elastic.co/guide/en/x-pack/current/license-management.html
11
+ #
12
+ def get_basic_status(arguments={})
13
+ method = Elasticsearch::API::HTTP_GET
14
+ path = "_xpack/license/basic_status"
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,24 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module License
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ #
10
+ # @see https://www.elastic.co/guide/en/x-pack/current/license-management.html
11
+ #
12
+ def get_trial_status(arguments={})
13
+ method = Elasticsearch::API::HTTP_GET
14
+ path = "_xpack/license/trial_status"
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,27 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module License
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false)
10
+ #
11
+ # @see https://www.elastic.co/guide/en/x-pack/current/license-management.html
12
+ #
13
+ def post_start_basic(arguments={})
14
+ valid_params = [
15
+ :acknowledge ]
16
+ method = Elasticsearch::API::HTTP_POST
17
+ path = "_xpack/license/start_basic"
18
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
19
+ body = nil
20
+
21
+ perform_request(method, path, params, body).body
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,29 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module License
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :type The type of trial license to generate (default: "trial")
10
+ # @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false)
11
+ #
12
+ # @see https://www.elastic.co/guide/en/x-pack/current/license-management.html
13
+ #
14
+ def post_start_trial(arguments={})
15
+ valid_params = [
16
+ :type,
17
+ :acknowledge ]
18
+ method = Elasticsearch::API::HTTP_POST
19
+ path = "_xpack/license/start_trial"
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,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] :calendar_id The ID of the calendar to delete (*Required*)
10
+ #
11
+ # @see [TODO]
12
+ #
13
+ def delete_calendar(arguments={})
14
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
15
+ method = Elasticsearch::API::HTTP_DELETE
16
+ path = "_xpack/ml/calendars/#{arguments[:calendar_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,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] :calendar_id The ID of the calendar to modify (*Required*)
10
+ # @option arguments [String] :event_id The ID of the event to remove from the calendar (*Required*)
11
+ #
12
+ # @see [TODO]
13
+ #
14
+ def delete_calendar_event(arguments={})
15
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
16
+ raise ArgumentError, "Required argument 'event_id' missing" unless arguments[:event_id]
17
+ method = Elasticsearch::API::HTTP_DELETE
18
+ path = "_xpack/ml/calendars/#{arguments[:calendar_id]}/events/#{arguments[:event_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,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] :calendar_id The ID of the calendar to modify (*Required*)
10
+ # @option arguments [String] :job_id The ID of the job to remove from the calendar (*Required*)
11
+ #
12
+ # @see [TODO]
13
+ #
14
+ def delete_calendar_job(arguments={})
15
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
16
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
17
+ method = Elasticsearch::API::HTTP_DELETE
18
+ path = "_xpack/ml/calendars/#{arguments[:calendar_id]}/jobs/#{arguments[:job_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
@@ -34,8 +34,12 @@ module Elasticsearch
34
34
  :anomaly_score,
35
35
  :sort,
36
36
  :desc ]
37
+
38
+ arguments = arguments.clone
39
+ timestamp = arguments.delete(:timestamp)
40
+
37
41
  method = Elasticsearch::API::HTTP_GET
38
- path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", arguments[:timestamp]
42
+ path = Elasticsearch::API::Utils.__pathify "_xpack/ml/anomaly_detectors", arguments[:job_id], "results/buckets", timestamp
39
43
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
40
44
  body = arguments[:body]
41
45
 
@@ -0,0 +1,42 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :calendar_id The ID of the calendar containing the events (*Required*)
10
+ # @option arguments [String] :job_id Get events for the job. When this option is used calendar_id must be '_all'
11
+ # @option arguments [String] :start Get events after this time
12
+ # @option arguments [Date] :end Get events before this time
13
+ # @option arguments [Int] :from Skips a number of events
14
+ # @option arguments [Int] :size Specifies a max number of events to get
15
+ #
16
+ # @see [TODO]
17
+ #
18
+ def get_calendar_events(arguments={})
19
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
20
+ valid_params = [
21
+ :calendar_id,
22
+ :job_id,
23
+ :start,
24
+ :end,
25
+ :from,
26
+ :size ]
27
+
28
+ arguments = arguments.clone
29
+ calendar_id = arguments.delete(:calendar_id)
30
+
31
+ method = Elasticsearch::API::HTTP_GET
32
+ path = "_xpack/ml/calendars/#{calendar_id}/events"
33
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
34
+ body = nil
35
+
36
+ perform_request(method, path, params, body).body
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,35 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :calendar_id The ID of the calendar to fetch
10
+ # @option arguments [Int] :from skips a number of calendars
11
+ # @option arguments [Int] :size specifies a max number of calendars to get
12
+ #
13
+ # @see [TODO]
14
+ #
15
+ def get_calendars(arguments={})
16
+ valid_params = [
17
+ :calendar_id,
18
+ :from,
19
+ :size ]
20
+
21
+ arguments = arguments.clone
22
+ calendar_id = arguments.delete(:calendar_id)
23
+
24
+ method = Elasticsearch::API::HTTP_GET
25
+ path = "_xpack/ml/calendars/#{calendar_id}"
26
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
27
+ body = nil
28
+
29
+ perform_request(method, path, params, body).body
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ 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 info(arguments={})
13
+ method = Elasticsearch::API::HTTP_GET
14
+ path = "_xpack/ml/info"
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,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] :calendar_id The ID of the calendar to modify (*Required*)
10
+ # @option arguments [Hash] :body A list of events (*Required*)
11
+ #
12
+ # @see [TODO]
13
+ #
14
+ def post_calendar_events(arguments={})
15
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
16
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
17
+ method = Elasticsearch::API::HTTP_POST
18
+ path = "_xpack/ml/calendars/#{arguments[:calendar_id]}/events"
19
+ params = {}
20
+ body = arguments[:body]
21
+
22
+ perform_request(method, path, params, body).body
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module MachineLearning
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :calendar_id The ID of the calendar to create (*Required*)
10
+ # @option arguments [Hash] :body The calendar details
11
+ #
12
+ # @see [TODO]
13
+ #
14
+ def put_calendar(arguments={})
15
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
16
+ method = Elasticsearch::API::HTTP_PUT
17
+ path = "_xpack/ml/calendars/#{arguments[:calendar_id]}"
18
+ params = {}
19
+ body = arguments[:body]
20
+
21
+ perform_request(method, path, params, body).body
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ 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] :calendar_id The ID of the calendar to modify (*Required*)
10
+ # @option arguments [String] :job_id The ID of the job to add to the calendar (*Required*)
11
+ #
12
+ # @see [TODO]
13
+ #
14
+ def put_calendar_job(arguments={})
15
+ raise ArgumentError, "Required argument 'calendar_id' missing" unless arguments[:calendar_id]
16
+ raise ArgumentError, "Required argument 'job_id' missing" unless arguments[:job_id]
17
+ method = Elasticsearch::API::HTTP_PUT
18
+ path = "_xpack/ml/calendars/#{arguments[:calendar_id]}/jobs/#{arguments[:job_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,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the job to delete (*Required*)
10
+ #
11
+ # @see
12
+ #
13
+ def delete_job(arguments={})
14
+ raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
15
+ method = Elasticsearch::API::HTTP_DELETE
16
+ path = "_xpack/rollup/job/#{arguments[: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,25 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs
10
+ #
11
+ # @see
12
+ #
13
+ def get_jobs(arguments={})
14
+ method = Elasticsearch::API::HTTP_GET
15
+ path = "_xpack/rollup/job/#{arguments[: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,25 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the index to check rollup capabilities on, or left blank for all jobs
10
+ #
11
+ # @see
12
+ #
13
+ def get_rollup_caps(arguments={})
14
+ method = Elasticsearch::API::HTTP_GET
15
+ path = "_xpack/rollup/data/#{arguments[: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,28 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the job to create (*Required*)
10
+ # @option arguments [Hash] :body The job configuration (*Required*)
11
+ #
12
+ # @see
13
+ #
14
+ def put_job(arguments={})
15
+ raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
16
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
17
+ method = Elasticsearch::API::HTTP_PUT
18
+ path = "_xpack/rollup/job/#{arguments[:id]}"
19
+ params = {}
20
+ body = arguments[:body]
21
+
22
+ perform_request(method, path, params, body).body
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,29 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :index The index or index-pattern (containing rollup or regular data) that should be searched (*Required*)
10
+ # @option arguments [String] :type The doc type inside the index
11
+ # @option arguments [Hash] :body The search request body (*Required*)
12
+ #
13
+ # @see
14
+ #
15
+ def rollup_search(arguments={})
16
+ raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
17
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
18
+ method = Elasticsearch::API::HTTP_GET
19
+ path = "#{arguments[:index]}/_rollup_search"
20
+ params = {}
21
+ body = arguments[:body]
22
+
23
+ perform_request(method, path, params, body).body
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the job to start (*Required*)
10
+ #
11
+ # @see
12
+ #
13
+ def start_job(arguments={})
14
+ raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
15
+ method = Elasticsearch::API::HTTP_POST
16
+ path = "_xpack/rollup/job/#{arguments[:id]}/_start"
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,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [String] :id The ID of the job to stop (*Required*)
10
+ #
11
+ # @see
12
+ #
13
+ def stop_job(arguments={})
14
+ raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
15
+ method = Elasticsearch::API::HTTP_POST
16
+ path = "_xpack/rollup/job/#{arguments[:id]}/_stop"
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,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module SQL
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [Hash] :body Specify the cursor value in the `cursor` element to clean the cursor. (*Required*)
10
+ #
11
+ # @see Clear SQL cursor
12
+ #
13
+ def clear_cursor(arguments={})
14
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
15
+ method = Elasticsearch::API::HTTP_POST
16
+ path = "_xpack/sql/close"
17
+ params = {}
18
+ body = arguments[:body]
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 SQL
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [Hash] :body Use the `query` element to start a query. Use the `cursor` element to continue a query. (*Required*)
10
+ # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
11
+ #
12
+ # @see Execute SQL
13
+ #
14
+ def query(arguments={})
15
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
16
+ valid_params = [
17
+ :format ]
18
+ method = Elasticsearch::API::HTTP_POST
19
+ path = "_xpack/sql"
20
+ params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params
21
+ body = arguments[:body]
22
+
23
+ perform_request(method, path, params, body).body
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,26 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module SQL
5
+ module Actions
6
+
7
+ # TODO: Description
8
+ #
9
+ # @option arguments [Hash] :body Specify the query in the `query` element. (*Required*)
10
+ #
11
+ # @see Translate SQL into Elasticsearch queries
12
+ #
13
+ def translate(arguments={})
14
+ raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
15
+ method = Elasticsearch::API::HTTP_POST
16
+ path = "_xpack/sql/translate"
17
+ params = {}
18
+ body = arguments[:body]
19
+
20
+ perform_request(method, path, params, body).body
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module Rollup
5
+ module Actions; end
6
+
7
+ class RollupClient
8
+ include Elasticsearch::API::Common::Client, Elasticsearch::API::Common::Client::Base, Rollup::Actions
9
+ end
10
+
11
+ def rollup
12
+ @rollup ||= RollupClient.new(self)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Elasticsearch
2
+ module XPack
3
+ module API
4
+ module SQL
5
+ module Actions; end
6
+
7
+ class SQLClient
8
+ include Elasticsearch::API::Common::Client, Elasticsearch::API::Common::Client::Base, SQL::Actions
9
+ end
10
+
11
+ def sql
12
+ @sql ||= SQLClient.new(self)
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module XPack
3
- VERSION = "6.0.0"
3
+ VERSION = "6.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-xpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-07 00:00:00.000000000 Z
11
+ date: 2018-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -213,8 +213,6 @@ executables: []
213
213
  extensions: []
214
214
  extra_rdoc_files: []
215
215
  files:
216
- - ".gitignore"
217
- - ".travis.yml"
218
216
  - Gemfile
219
217
  - LICENSE.txt
220
218
  - README.md
@@ -226,8 +224,15 @@ files:
226
224
  - lib/elasticsearch/xpack/api/actions/info.rb
227
225
  - lib/elasticsearch/xpack/api/actions/license/delete.rb
228
226
  - lib/elasticsearch/xpack/api/actions/license/get.rb
227
+ - lib/elasticsearch/xpack/api/actions/license/get_basic_status.rb
228
+ - lib/elasticsearch/xpack/api/actions/license/get_trial_status.rb
229
229
  - lib/elasticsearch/xpack/api/actions/license/post.rb
230
+ - lib/elasticsearch/xpack/api/actions/license/post_start_basic.rb
231
+ - lib/elasticsearch/xpack/api/actions/license/post_start_trial.rb
230
232
  - lib/elasticsearch/xpack/api/actions/machine_learning/close_job.rb
233
+ - lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar.rb
234
+ - lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_event.rb
235
+ - lib/elasticsearch/xpack/api/actions/machine_learning/delete_calendar_job.rb
231
236
  - lib/elasticsearch/xpack/api/actions/machine_learning/delete_datafeed.rb
232
237
  - lib/elasticsearch/xpack/api/actions/machine_learning/delete_expired_data.rb
233
238
  - lib/elasticsearch/xpack/api/actions/machine_learning/delete_filter.rb
@@ -236,6 +241,8 @@ files:
236
241
  - lib/elasticsearch/xpack/api/actions/machine_learning/flush_job.rb
237
242
  - lib/elasticsearch/xpack/api/actions/machine_learning/forecast.rb
238
243
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_buckets.rb
244
+ - lib/elasticsearch/xpack/api/actions/machine_learning/get_calendar_events.rb
245
+ - lib/elasticsearch/xpack/api/actions/machine_learning/get_calendars.rb
239
246
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_categories.rb
240
247
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeed_stats.rb
241
248
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_datafeeds.rb
@@ -246,9 +253,13 @@ files:
246
253
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_model_snapshots.rb
247
254
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_overall_buckets.rb
248
255
  - lib/elasticsearch/xpack/api/actions/machine_learning/get_records.rb
256
+ - lib/elasticsearch/xpack/api/actions/machine_learning/info.rb
249
257
  - lib/elasticsearch/xpack/api/actions/machine_learning/open_job.rb
258
+ - lib/elasticsearch/xpack/api/actions/machine_learning/post_calendar_events.rb
250
259
  - lib/elasticsearch/xpack/api/actions/machine_learning/post_data.rb
251
260
  - lib/elasticsearch/xpack/api/actions/machine_learning/preview_datafeed.rb
261
+ - lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar.rb
262
+ - lib/elasticsearch/xpack/api/actions/machine_learning/put_calendar_job.rb
252
263
  - lib/elasticsearch/xpack/api/actions/machine_learning/put_datafeed.rb
253
264
  - lib/elasticsearch/xpack/api/actions/machine_learning/put_filter.rb
254
265
  - lib/elasticsearch/xpack/api/actions/machine_learning/put_job.rb
@@ -264,6 +275,13 @@ files:
264
275
  - lib/elasticsearch/xpack/api/actions/migration/get_assistance.rb
265
276
  - lib/elasticsearch/xpack/api/actions/migration/upgrade.rb
266
277
  - lib/elasticsearch/xpack/api/actions/monitoring/bulk.rb
278
+ - lib/elasticsearch/xpack/api/actions/rollup/delete_job.rb
279
+ - lib/elasticsearch/xpack/api/actions/rollup/get_jobs.rb
280
+ - lib/elasticsearch/xpack/api/actions/rollup/get_rollup_caps.rb
281
+ - lib/elasticsearch/xpack/api/actions/rollup/put_job.rb
282
+ - lib/elasticsearch/xpack/api/actions/rollup/rollup_search.rb
283
+ - lib/elasticsearch/xpack/api/actions/rollup/start_job.rb
284
+ - lib/elasticsearch/xpack/api/actions/rollup/stop_job.rb
267
285
  - lib/elasticsearch/xpack/api/actions/security/authenticate.rb
268
286
  - lib/elasticsearch/xpack/api/actions/security/change_password.rb
269
287
  - lib/elasticsearch/xpack/api/actions/security/clear_cached_realms.rb
@@ -281,6 +299,9 @@ files:
281
299
  - lib/elasticsearch/xpack/api/actions/security/put_role.rb
282
300
  - lib/elasticsearch/xpack/api/actions/security/put_role_mapping.rb
283
301
  - lib/elasticsearch/xpack/api/actions/security/put_user.rb
302
+ - lib/elasticsearch/xpack/api/actions/sql/clear_cursor.rb
303
+ - lib/elasticsearch/xpack/api/actions/sql/query.rb
304
+ - lib/elasticsearch/xpack/api/actions/sql/translate.rb
284
305
  - lib/elasticsearch/xpack/api/actions/ssl/certificates.rb
285
306
  - lib/elasticsearch/xpack/api/actions/usage.rb
286
307
  - lib/elasticsearch/xpack/api/actions/watcher/ack_watch.rb
@@ -299,11 +320,18 @@ files:
299
320
  - lib/elasticsearch/xpack/api/namespace/machine_learning.rb
300
321
  - lib/elasticsearch/xpack/api/namespace/migration.rb
301
322
  - lib/elasticsearch/xpack/api/namespace/monitoring.rb
323
+ - lib/elasticsearch/xpack/api/namespace/rollup.rb
302
324
  - lib/elasticsearch/xpack/api/namespace/security.rb
325
+ - lib/elasticsearch/xpack/api/namespace/sql.rb
303
326
  - lib/elasticsearch/xpack/api/namespace/ssl.rb
304
327
  - lib/elasticsearch/xpack/api/namespace/watcher.rb
305
328
  - lib/elasticsearch/xpack/version.rb
306
- homepage: https://github.com/elastic/elasticsearch-xpack-ruby
329
+ - pkg/elasticsearch-xpack-0.1.0.gem
330
+ - pkg/elasticsearch-xpack-0.1.0.pre.gem
331
+ - pkg/elasticsearch-xpack-5.0.0.gem
332
+ - pkg/elasticsearch-xpack-5.5.0.gem
333
+ - pkg/elasticsearch-xpack-6.0.0.gem
334
+ homepage: https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-xpack
307
335
  licenses:
308
336
  - Apache 2
309
337
  metadata: {}
@@ -323,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
351
  version: '0'
324
352
  requirements: []
325
353
  rubyforge_project:
326
- rubygems_version: 2.5.2
354
+ rubygems_version: 2.6.11
327
355
  signing_key:
328
356
  specification_version: 4
329
357
  summary: Ruby integrations for the X-Pack extensions for Elasticsearch
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
@@ -1,4 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.1.5
4
- before_install: gem install bundler -v 1.10.6