连接器(Connector)

class elasticsearch.client.ConnectorClient

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

from elasticsearch import Elasticsearch

# Create the client instance
client = Elasticsearch(...)
# Use the connector client
client.connector.<method>(...)
check_in(*, connector_id, error_trace=None, filter_path=None, human=None, pretty=None)

登记连接器。

更新连接器中的 last_seen 字段并将其设置为当前时间戳。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-check-in

Parameters:
  • connector_id (str) – 要登记的连接器的唯一标识符

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

delete(*, connector_id, delete_sync_jobs=None, error_trace=None, filter_path=None, hard=None, human=None, pretty=None)

删除连接器。

移除连接器及关联的同步作业。 这是一个不可恢复的破坏性操作。 注意:此操作不会删除与连接器关联的任何API密钥、摄取管道或数据索引。 这些需要手动移除。

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

Parameters:
  • connector_id (str) – 要删除的连接器的唯一标识符

  • delete_sync_jobs (bool | None) – 指示是否同时移除关联同步作业的标志。默认为false。

  • hard (bool | None) – 指示是否应硬删除连接器的标志。

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

get(*, connector_id, error_trace=None, filter_path=None, human=None, include_deleted=None, pretty=None)

获取连接器。

获取连接器的详细信息。

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

Parameters:
  • connector_id (str) – 连接器的唯一标识符

  • include_deleted (bool | None) – 指示是否应获取目标连接器的标志,即使它已被软删除。

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

last_sync(*, connector_id, error_trace=None, filter_path=None, human=None, last_access_control_sync_error=None, last_access_control_sync_scheduled_at=None, last_access_control_sync_status=None, last_deleted_document_count=None, last_incremental_sync_scheduled_at=None, last_indexed_document_count=None, last_seen=None, last_sync_error=None, last_sync_scheduled_at=None, last_sync_status=None, last_synced=None, pretty=None, sync_cursor=None, body=None)

更新连接器最后同步统计信息。

更新与连接器最后一次同步相关的字段。 此操作用于分析和监控。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-last-sync

Parameters:
  • connector_id (str) – 要更新的连接器的唯一标识符

  • last_access_control_sync_error (str | None)

  • last_access_control_sync_scheduled_at (str | Any | None)

  • last_access_control_sync_status (str | Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended'] | None)

  • last_deleted_document_count (int | None)

  • last_incremental_sync_scheduled_at (str | Any | None)

  • last_indexed_document_count (int | None)

  • last_seen (str | Any | None)

  • last_sync_error (str | None)

  • last_sync_scheduled_at (str | Any | None)

  • last_sync_status (str | Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended'] | None)

  • last_synced (str | Any | None)

  • sync_cursor (Any | 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]

list(*, connector_name=None, error_trace=None, filter_path=None, from_=None, human=None, include_deleted=None, index_name=None, pretty=None, query=None, service_type=None, size=None)

获取所有连接器。

获取所有连接器的信息。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-list

Parameters:
  • connector_name (str | Sequence[str] | None) – 逗号分隔的连接器名称列表,用于获取连接器文档

  • from – 起始偏移量(默认:0)

  • include_deleted (bool | None) – 指示是否应获取目标连接器的标志,即使它已被软删除。

  • index_name (str | Sequence[str] | None) – 逗号分隔的连接器索引名称列表,用于获取连接器文档

  • query (str | None) – 通配符查询字符串,用于筛选名称、描述或索引名称匹配的连接器

  • service_type (str | Sequence[str] | None) – 逗号分隔的连接器服务类型列表,用于获取连接器文档

  • size (int | None) – 指定获取结果的最大数量

  • error_trace (bool | None)

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

  • from_ (int | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

post(*, description=None, error_trace=None, filter_path=None, human=None, index_name=None, is_native=None, language=None, name=None, pretty=None, service_type=None, body=None)

创建连接器。

连接器是Elasticsearch与第三方数据源的集成方案,可部署在Elastic Cloud或自有基础设施上。 Elastic托管连接器(原生连接器)是Elastic Cloud上的托管服务。 自管理连接器(连接器客户端)需在自有基础设施上自行管理。

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

Parameters:
  • description (str | None)

  • index_name (str | None)

  • is_native (bool | None)

  • language (str | None)

  • name (str | None)

  • service_type (str | 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]

put(*, connector_id=None, description=None, error_trace=None, filter_path=None, human=None, index_name=None, is_native=None, language=None, name=None, pretty=None, service_type=None, body=None)

创建或更新连接器。

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

Parameters:
  • connector_id (str | None) – 待创建或更新连接器的唯一标识符。若未提供将自动生成ID。

  • description (str | None)

  • index_name (str | None)

  • is_native (bool | None)

  • language (str | None)

  • name (str | None)

  • service_type (str | 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]

sync_job_cancel(*, connector_sync_job_id, error_trace=None, filter_path=None, human=None, pretty=None)

取消连接器同步任务。

取消连接器同步任务,将状态设置为cancelling并更新cancellation_requested_at为当前时间。 随后由连接器服务负责将同步任务状态变更为cancelled。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-cancel

Parameters:
  • connector_sync_job_id (str) – 连接器同步任务的唯一标识符

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

sync_job_check_in(*, connector_sync_job_id, error_trace=None, filter_path=None, human=None, pretty=None)

签入连接器同步任务。 签入连接器同步任务,在更新内部索引前将last_seen字段设为当前时间。

使用自管理连接器同步数据时,需在自有基础设施上部署Elastic连接器服务。 对于Elastic托管连接器,该服务在Elastic Cloud上自动运行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-check-in

Parameters:
  • connector_sync_job_id (str) – 待签入的连接器同步任务唯一标识符。

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

sync_job_claim(*, connector_sync_job_id, worker_hostname=None, error_trace=None, filter_path=None, human=None, pretty=None, sync_cursor=None, body=None)

认领连接器同步任务。 此操作将任务状态更新为in_progress,并将last_seenstarted_at时间戳设为当前时间。 同时可为同步任务设置sync_cursor属性。

本API不适用于用户直接管理连接器。 其用于支持实现通过连接器协议与Elasticsearch通信的服务。

使用自管理连接器同步数据时,需在自有基础设施上部署Elastic连接器服务。 对于Elastic托管连接器,该服务在Elastic Cloud上自动运行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-claim

Parameters:
  • connector_sync_job_id (str) – 连接器同步任务的唯一标识符。

  • worker_hostname (str | None) – 将运行任务的当前系统主机名。

  • sync_cursor (Any | None) – 上次增量同步任务的游标对象。应引用任务运行时连接器状态中的`sync_cursor`字段。

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

sync_job_delete(*, connector_sync_job_id, error_trace=None, filter_path=None, human=None, pretty=None)

删除连接器同步任务。

移除连接器同步任务及其关联数据。 此操作不可逆,请谨慎执行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-delete

Parameters:
  • connector_sync_job_id (str) – 要删除的连接器同步任务的唯一标识符

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

sync_job_error(*, connector_sync_job_id, error=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

设置连接器同步任务错误。 为连接器同步任务设置error字段,并将其status设为error

使用自托管连接器同步数据时,需在自有基础设施上部署Elastic连接器服务。 对于Elastic托管的连接器,该服务在Elastic Cloud上自动运行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error

Parameters:
  • connector_sync_job_id (str) – 连接器同步任务的唯一标识符

  • error (str | 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]

sync_job_get(*, connector_sync_job_id, error_trace=None, filter_path=None, human=None, pretty=None)

获取连接器同步任务。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-get

Parameters:
  • connector_sync_job_id (str) – 连接器同步任务的唯一标识符

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

sync_job_list(*, connector_id=None, error_trace=None, filter_path=None, from_=None, human=None, job_type=None, pretty=None, size=None, status=None)

获取所有连接器同步任务。

获取所有存储的连接器同步任务信息,按创建日期升序排列。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-list

Parameters:
  • connector_id (str | None) – 用于筛选连接器同步任务的连接器ID

  • from – 起始偏移量(默认:0)

  • job_type (Sequence[str | Literal['access_control', 'full', 'incremental']] | str | ~typing.Literal['access_control', 'full', 'incremental'] | None) – 用于筛选同步任务的作业类型(逗号分隔列表)

  • size (int | None) – 指定获取结果的最大数量

  • status (str | Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended'] | None) – 用于筛选连接器同步任务的状态

  • error_trace (bool | None)

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

  • from_ (int | None)

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

sync_job_post(*, id=None, error_trace=None, filter_path=None, human=None, job_type=None, pretty=None, trigger_method=None, body=None)

创建连接器同步任务。

在内部索引中创建连接器同步任务文档,并使用默认值初始化其计数器和时间戳。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-post

Parameters:
  • id (str | None) – 关联连接器的ID

  • job_type (str | Literal['access_control', 'full', 'incremental'] | None)

  • trigger_method (str | Literal['on_demand', 'scheduled'] | 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]

sync_job_update_stats(*, connector_sync_job_id, deleted_document_count=None, indexed_document_count=None, indexed_document_volume=None, error_trace=None, filter_path=None, human=None, last_seen=None, metadata=None, pretty=None, total_document_count=None, body=None)

设置连接器同步作业的统计信息。 统计信息包括:deleted_document_count(删除文档数)、indexed_document_count(索引文档数)、indexed_document_volume(索引数据量)和total_document_count(总文档数)。 您还可以更新last_seen(最后访问时间)。 此API主要由连接器服务用于更新同步作业信息。

要使用自管理连接器同步数据,您需要在自己的基础设施上部署Elastic连接器服务。 对于Elastic托管的连接器,该服务在Elastic Cloud上自动运行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-update-stats

Parameters:
  • connector_sync_job_id (str) – 连接器同步作业的唯一标识符

  • deleted_document_count (int | None) – 同步作业删除的文档数量

  • indexed_document_count (int | None) – 同步作业索引的文档数量

  • indexed_document_volume (int | None) – 同步作业索引的数据总大小(以MiB为单位)

  • last_seen (str | Literal[-1] | ~typing.Literal[0] | None) – 用于连接器同步作业`last_seen`属性的时间戳

  • metadata (Mapping[str, Any] | None) – 连接器特定的元数据

  • total_document_count (int | 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]

update_active_filtering(*, connector_id, error_trace=None, filter_path=None, human=None, pretty=None)

激活连接器草稿过滤器。

为连接器激活有效的草稿过滤功能。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering

Parameters:
  • connector_id (str) – 待更新连接器的唯一标识符

  • error_trace (bool | None)

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

  • human (bool | None)

  • pretty (bool | None)

Return type:

ObjectApiResponse[Any]

update_api_key_id(*, connector_id, api_key_id=None, api_key_secret_id=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器API密钥ID。

更新连接器的api_key_idapi_key_secret_id字段。 您可以指定用于授权的API密钥ID和存储API密钥的连接器密钥ID。 连接器密钥ID仅适用于Elastic托管(原生)连接器。 自管理连接器(连接器客户端)不使用此字段。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-api-key-id

Parameters:
  • connector_id (str) – 待更新连接器的唯一标识符

  • api_key_id (str | None)

  • api_key_secret_id (str | 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]

update_configuration(*, connector_id, configuration=None, error_trace=None, filter_path=None, human=None, pretty=None, values=None, body=None)

更新连接器配置。

更新连接器文档中的配置字段。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-configuration

Parameters:
Return type:

ObjectApiResponse[Any]

update_error(*, connector_id, error=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器错误字段。

设置连接器的错误字段。 如果请求体中提供的错误非空,则连接器状态将更新为错误状态。 反之,如果将错误重置为空,则连接器状态将更新为已连接状态。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-error

Parameters:
  • connector_id (str) – 待更新连接器的唯一标识符

  • error (None | Any)

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

update_features(*, connector_id, features=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器功能特性。

更新连接器文档中的功能特性。 此API可用于控制连接器的以下方面:

  • 文档级安全性
  • 增量同步
  • 高级同步规则
  • 基础同步规则

通常,运行中的连接器服务会自动管理这些功能。 但您可以使用此API覆盖默认行为。

要使用自托管连接器同步数据,您需要在自己的基础设施上部署Elastic连接器服务。 对于Elastic托管的连接器,该服务会在Elastic Cloud上自动运行。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-features

Parameters:
Return type:

ObjectApiResponse[Any]

update_filtering(*, connector_id, advanced_snippet=None, error_trace=None, filter_path=None, filtering=None, human=None, pretty=None, rules=None, body=None)

更新连接器过滤配置。

更新连接器的草稿过滤配置并将草稿验证状态标记为已编辑。 当运行中的Elastic连接器服务验证通过后,过滤草稿将被激活。 过滤属性用于配置连接器的同步规则(包括基础和高级规则)。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering

Parameters:
Return type:

ObjectApiResponse[Any]

update_filtering_validation(*, connector_id, validation=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器草稿过滤验证信息。

更新连接器的草稿过滤验证信息。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering-validation

Parameters:
Return type:

ObjectApiResponse[Any]

update_index_name(*, connector_id, index_name=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器索引名称。

更新连接器的index_name字段,指定连接器摄取数据的存储索引。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-index-name

Parameters:
  • connector_id (str) – 待更新连接器的唯一标识符

  • index_name (None | Any)

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

update_name(*, connector_id, description=None, error_trace=None, filter_path=None, human=None, name=None, pretty=None, body=None)

更新连接器名称和描述。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-name

Parameters:
  • connector_id (str) – 待更新连接器的唯一标识符

  • description (str | None)

  • name (str | 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]

update_native(*, connector_id, is_native=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器的 is_native 标志。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-native

Parameters:
  • connector_id (str) – 要更新的连接器的唯一标识符

  • is_native (bool | 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]

update_pipeline(*, connector_id, pipeline=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器的管道配置。

创建新连接器时,摄取管道的配置会填充默认设置。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-pipeline

Parameters:
Return type:

ObjectApiResponse[Any]

update_scheduling(*, connector_id, scheduling=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器的调度设置。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-scheduling

Parameters:
Return type:

ObjectApiResponse[Any]

update_service_type(*, connector_id, service_type=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器的服务类型。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type

Parameters:
  • connector_id (str) – 要更新的连接器的唯一标识符

  • service_type (str | 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]

update_status(*, connector_id, status=None, error_trace=None, filter_path=None, human=None, pretty=None, body=None)

更新连接器的状态。

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-status

Parameters:
  • connector_id (str) – 要更新的连接器的唯一标识符

  • status (str | Literal['configured', 'connected', 'created', 'error', 'needs_configuration'] | 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]