Get autoscaling policy API

Get autoscaling policy API

This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

New API reference

For the most up-to-date API details, refer to Autoscaling APIs.

Get autoscaling policy.

Request

  1. resp = client.autoscaling.get_autoscaling_policy(
  2. name="<name>",
  3. )
  4. print(resp)
  1. const response = await client.autoscaling.getAutoscalingPolicy({
  2. name: "<name>",
  3. });
  4. console.log(response);
  1. GET /_autoscaling/policy/<name>

Prerequisites

  • If the Elasticsearch security features are enabled, you must have manage_autoscaling cluster privileges. For more information, see Security privileges.

Description

This API gets an autoscaling policy with the provided name.

Query parameters

master_timeout

(Optional, time units) Period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. Defaults to 30s. Can also be set to -1 to indicate that the request should never timeout.

Examples

This example gets an autoscaling policy named my_autoscaling_policy.

  1. resp = client.autoscaling.get_autoscaling_policy(
  2. name="my_autoscaling_policy",
  3. )
  4. print(resp)
  1. const response = await client.autoscaling.getAutoscalingPolicy({
  2. name: "my_autoscaling_policy",
  3. });
  4. console.log(response);
  1. GET /_autoscaling/policy/my_autoscaling_policy

The API returns the following result:

  1. {
  2. "roles": <roles>,
  3. "deciders": <deciders>
  4. }