Module: Elasticsearch::API::Autoscaling::Actions
- Included in:
- AutoscalingClient
- Defined in:
- lib/elasticsearch/api/namespace/autoscaling.rb,
lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb,
lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb,
lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb,
lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb
Instance Method Summary collapse
-
#delete_autoscaling_policy(arguments = {}) ⇒ Object
Delete an autoscaling policy.
-
#get_autoscaling_capacity(arguments = {}) ⇒ Object
Get the autoscaling capacity.
-
#get_autoscaling_policy(arguments = {}) ⇒ Object
Get an autoscaling policy.
-
#put_autoscaling_policy(arguments = {}) ⇒ Object
Create or update an autoscaling policy.
Instance Method Details
#delete_autoscaling_policy(arguments = {}) ⇒ Object
Delete an autoscaling policy
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/autoscaling/delete_autoscaling_policy.rb', line 34 def delete_autoscaling_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.delete_autoscaling_policy' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE path = "_autoscaling/policy/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_autoscaling_capacity(arguments = {}) ⇒ Object
Get the autoscaling capacity
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/autoscaling/get_autoscaling_capacity.rb', line 32 def get_autoscaling_capacity(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_capacity' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_autoscaling/capacity' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_autoscaling_policy(arguments = {}) ⇒ Object
Get an autoscaling policy
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/autoscaling/get_autoscaling_policy.rb', line 33 def get_autoscaling_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.get_autoscaling_policy' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET path = "_autoscaling/policy/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#put_autoscaling_policy(arguments = {}) ⇒ Object
Create or update an autoscaling policy
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/autoscaling/put_autoscaling_policy.rb', line 35 def put_autoscaling_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'autoscaling.put_autoscaling_policy' } defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT path = "_autoscaling/policy/#{Utils.__listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |