许可证

class elasticsearch.client.LicenseClient

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

from elasticsearch import Elasticsearch

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

删除许可证。

当许可证过期时,您的订阅级别将恢复为基本版。

如果启用了操作员权限功能,则只有操作员用户可以使用此API。

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

Parameters:
  • 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(*, accept_enterprise=None, error_trace=None, filter_path=None, human=None, local=None, pretty=None)

获取许可证信息。

获取有关您的Elastic许可证的信息,包括其类型、状态、签发时间和过期时间。

info 如果主节点正在生成新的集群状态,获取许可证API可能会返回404 Not Found响应。 如果在集群启动后收到意外的404响应,请稍等片刻并重试请求。

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

Parameters:
  • accept_enterprise (bool | None) – 如果为`true`,此参数将返回企业版许可证类型的企业标识。如果为`false`, 此参数将为白金版和企业版许可证类型返回白金标识。此行为是为了保持向后兼容性。 此参数已弃用,在8.x版本中将始终设置为true。

  • local (bool | None) – 指定是否检索本地信息。默认值为`false`,表示从主节点检索信息。

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get_basic_status(*, error_trace=None, filter_path=None, human=None, pretty=None)

获取基本许可证状态。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-basic-status

Parameters:
Return type:

ObjectApiResponse[Any]

get_trial_status(*, error_trace=None, filter_path=None, human=None, pretty=None)

获取试用状态。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-trial-status

Parameters:
Return type:

ObjectApiResponse[Any]

post(*, acknowledge=None, error_trace=None, filter_path=None, human=None, license=None, licenses=None, master_timeout=None, pretty=None, timeout=None, body=None)

更新许可证。

您可以在运行时更新许可证而无需关闭节点。 许可证更新立即生效。 但是,如果您安装的许可证不支持之前许可证的所有功能,您将在响应中收到通知。 然后您必须重新提交API请求,并将acknowledge参数设置为true。

注意:如果启用了Elasticsearch安全功能,并且您正在安装黄金版或更高级别的许可证, 则必须在安装许可证之前在传输网络层启用TLS。 如果启用了操作员权限功能,则只有操作员用户可以使用此API。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post

Parameters:
  • acknowledge (bool | None) – 指定是否确认许可证更改。

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

  • licenses (Sequence[Mapping[str, Any]] | None) – 包含许可证信息的一个或多个JSON文档序列。

  • 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)

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

Return type:

ObjectApiResponse[Any]

post_start_basic(*, acknowledge=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, timeout=None)

启动基础许可证。

启动无限期基础许可证,可访问所有基础功能。

注意:要启动基础许可证,您当前不能拥有基础许可证。

如果基础许可证不支持您当前许可证的所有功能,系统会在响应中通知您。 然后您必须重新提交API请求,并将acknowledge参数设置为true

要检查基础许可证状态,请使用获取基础许可证API。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-basic

Parameters:
  • acknowledge (bool | None) – 用户是否已确认确认消息(默认:false)

  • 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]

post_start_trial(*, acknowledge=None, error_trace=None, filter_path=None, human=None, master_timeout=None, pretty=None, type=None)

启动试用。

启动30天试用期,可访问所有订阅功能。

注意:只有当您的集群尚未为当前主要产品版本激活试用时,才允许启动试用。 例如,如果您已经为v8.0激活了试用,那么在v9.0之前无法启动新试用。但您可以在https://www.elastic.co/trialextension申请延长试用。

要检查试用状态,请使用获取试用状态API。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-trial

Parameters:
  • acknowledge (bool | None) – 用户是否已确认确认消息(默认:false)

  • master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – 等待连接主节点的时间。

  • type (str | None) – 要生成的试用许可证类型(默认:”trial”)

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]