自动扩缩容(Autoscaling)

class elasticsearch.client.AutoscalingClient

To use this client, access client.autoscaling from an Elasticsearch client. For example:

from elasticsearch import Elasticsearch

# Create the client instance
client = Elasticsearch(...)
# Use the autoscaling client
client.autoscaling.<method>(...)
delete_autoscaling_policy(*, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

删除一个自动扩展策略。

注意:此功能专为Elasticsearch Service、Elastic Cloud Enterprise和Kubernetes上的Elastic Cloud间接使用而设计。不支持直接使用。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-delete-autoscaling-policy

Parameters:
  • name (str) – 自动扩展策略的名称

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待响应的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_autoscaling_capacity(*, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)

获取自动扩展容量。

注意:此功能专为Elasticsearch Service、Elastic Cloud Enterprise和Kubernetes上的Elastic Cloud间接使用而设计。不支持直接使用。

此API根据配置的自动扩展策略获取当前自动扩展容量。它将返回适当调整集群规模以适应当前工作负载的信息。

required_capacity计算为策略启用的所有独立决策器required_capacity结果的最大值。

操作员应验证current_nodes是否与其对集群的了解一致,以避免基于过时或不完整的信息做出自动扩展决策。

响应包含决策器特定信息,可用于诊断自动扩展如何以及为何确定需要特定容量。此信息仅供诊断使用。请勿使用此信息做出自动扩展决策。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity

Parameters:
  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_autoscaling_policy(*, name, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None)

获取一个自动扩展策略。

注意:此功能专为Elasticsearch Service、Elastic Cloud Enterprise和Kubernetes上的Elastic Cloud间接使用而设计。不支持直接使用。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-get-autoscaling-capacity

Parameters:
  • name (str) – 自动扩展策略的名称

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

put_autoscaling_policy(*, name, policy=None, body=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

创建或更新一个自动扩展策略。

注意:此功能专为Elasticsearch Service、Elastic Cloud Enterprise和Kubernetes上的Elastic Cloud间接使用而设计。不支持直接使用。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-autoscaling-put-autoscaling-policy

Parameters:
  • name (str) – 自动扩展策略的名称

  • policy (Mapping[str, Any] | None)

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接到主节点的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待响应的时间。如果在超时前未收到响应,请求将失败并返回错误。

  • body (Mapping[str, Any] | None)

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]