Skip to content

Commit ef111e1

Browse files
committed
[XPACK] Adds autoscaling.get_autoscaling_capacity
1 parent fdd13bb commit ef111e1

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Licensed to Elasticsearch B.V. under one or more contributor
2+
# license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright
4+
# ownership. Elasticsearch B.V. licenses this file to you under
5+
# the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
module Elasticsearch
19+
module XPack
20+
module API
21+
module Autoscaling
22+
module Actions
23+
# Gets the current autoscaling capacity based on the configured autoscaling policy.
24+
# This functionality is Experimental and may be changed or removed
25+
# completely in a future release. Elastic will take a best effort approach
26+
# to fix any issues, but experimental features are not subject to the
27+
# support SLA of official GA features.
28+
#
29+
# @option arguments [Hash] :headers Custom HTTP headers
30+
#
31+
# @see https://www.elastic.co/guide/en/elasticsearch/reference/7.x/autoscaling-get-autoscaling-capacity.html
32+
#
33+
def get_autoscaling_capacity(arguments = {})
34+
headers = arguments.delete(:headers) || {}
35+
36+
arguments = arguments.clone
37+
38+
method = Elasticsearch::API::HTTP_GET
39+
path = "_autoscaling/capacity"
40+
params = {}
41+
42+
body = nil
43+
perform_request(method, path, params, body, headers).body
44+
end
45+
end
46+
end
47+
end
48+
end
49+
end

0 commit comments

Comments
 (0)