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

    Check in a connector.

    Update the `last_seen` field in the connector and set it to the current timestamp.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be checked in

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

    Delete a connector.

    Removes a connector and associated sync jobs. This is a destructive action that is not recoverable. NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. These need to be removed manually.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be deleted

      - delete_sync_jobs (bool | None) – A flag indicating if associated sync jobs should be also removed.

      - hard (bool | None) – A flag indicating if the connector should be hard deleted.

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

    Get a connector.

    Get the details about a connector.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector

      - include_deleted (bool | None) – A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.

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

    Update the connector last sync stats.

    Update the fields related to the last sync of a connector. This action is used for analytics and monitoring.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Get all connectors.

    Get information about all connectors.

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

    Parameters:

      - connector_name (str | Sequence[str] | None) – A comma-separated list of connector names to fetch connector documents for

      - from – Starting offset

      - include_deleted (bool | None) – A flag to indicate if the desired connector should be fetched, even if it was soft-deleted.

      - index_name (str | Sequence[str] | None) – A comma-separated list of connector index names to fetch connector documents for

      - query (str | None) – A wildcard query string that filters connectors with matching name, description or index name

      - service_type (str | Sequence[str] | None) – A comma-separated list of connector service types to fetch connector documents for

      - size (int | None) – Specifies a max number of results to get

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

    Create a connector.

    Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. Self-managed connectors (Connector clients) are self-managed on your infrastructure.

    https://www.elastic.co/docs/api/doc/elasticsearch/v9/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)

    Create or update a connector.

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

    Parameters:

      - connector_id (str | None) – The unique identifier of the connector to be created or updated. ID is auto-generated if not provided.

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

    Cancel a connector sync job.

    Cancel a connector sync job, which sets the status to cancelling and updates `cancellation_requested_at` to the current time. The connector service is then responsible for setting the status of connector sync jobs to cancelled.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job

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

    Check in a connector sync job.

    Check in a connector sync job and set the `last_seen` field to the current time before updating it in the internal index.

    To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job to be checked in.

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

    Claim a connector sync job.

    This action updates the job status to `in_progress` and sets the `last_seen` and `started_at` timestamps to the current time. Additionally, it can set the `sync_cursor` property for the sync job.

    This API is not intended for direct connector management by users. It supports the implementation of services that utilize the connector protocol to communicate with Elasticsearch.

    To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job.

      - worker_hostname (str | None) – The host name of the current system that will run the job.

      - sync_cursor (Any | None) – The cursor object from the last incremental sync job. This should reference the sync_cursor field in the connector state for which the job runs.

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

    Delete a connector sync job.

    Remove a connector sync job and its associated data. This is a destructive action that is not recoverable.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job to be deleted

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

    Set a connector sync job error.

    Set the `error` field for a connector sync job and set its `status` to `error`.

    To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier for the connector sync job.

      - error (str | None) – The error for the connector sync job error field.

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

    Get a connector sync job.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job

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

    Get all connector sync jobs.

    Get information about all stored connector sync jobs listed by their creation date in ascending order.

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

    Parameters:

      - connector_id (str | None) – A connector id to fetch connector sync jobs for

      - from – Starting offset

      - job_type (Sequence[str | Literal['access_control', 'full', 'incremental']] | str | ~typing.Literal['access_control', 'full', 'incremental'] | None) – A comma-separated list of job types to fetch the sync jobs for

      - size (int | None) – Specifies a max number of results to get

      - status (str | Literal['canceled', 'canceling', 'completed', 'error', 'in_progress', 'pending', 'suspended'] | None) – A sync job status to fetch connector sync jobs for

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

    Create a connector sync job.

    Create a connector sync job document in the internal index and initialize its counters and timestamps with default values.

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

    Parameters:

      - id (str | None) – The id of the associated connector

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

    Set the connector sync job stats.

    Stats include: `deleted_document_count`, `indexed_document_count`, `indexed_document_volume`, and `total_document_count`. You can also update `last_seen`. This API is mainly used by the connector service for updating sync job information.

    To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

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

    Parameters:

      - connector_sync_job_id (str) – The unique identifier of the connector sync job.

      - deleted_document_count (int | None) – The number of documents the sync job deleted.

      - indexed_document_count (int | None) – The number of documents the sync job indexed.

      - indexed_document_volume (int | None) – The total size of the data (in MiB) the sync job indexed.

      - last_seen (str | Literal[-1] | ~typing.Literal[0] | None) – The timestamp to use in the last_seen property for the connector sync job.

      - metadata (Mapping[str, Any] | None) – The connector-specific metadata.

      - total_document_count (int | None) – The total number of documents in the target index after the sync job finished.

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

    Activate the connector draft filter.

    Activates the valid draft filtering for a connector.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector API key ID.

    Update the `api_key_id` and `api_key_secret_id` fields of a connector. You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. The connector secret ID is required only for Elastic managed (native) connectors. Self-managed connectors (connector clients) do not use this field.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector configuration.

    Update the configuration field in the connector document.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

      - configuration (Mapping[str, Mapping[str, Any]] | None)

      - values (Mapping[str, 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]

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

    Update the connector error field.

    Set the error field for the connector. If the error provided in the request body is non-null, the connector’s status is updated to error. Otherwise, if the error is reset to null, the connector status is updated to connected.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector features.

    Update the connector features in the connector document. This API can be used to control the following aspects of a connector:

    - document-level security
    - incremental syncs
    - advanced sync rules
    - basic sync rules

    Normally, the running connector service automatically manages these features. However, you can use this API to override the default behavior.

    To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated.

      - features (Mapping[str, 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]

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

    Update the connector filtering.

    Update the draft filtering configuration of a connector and marks the draft validation state as edited. The filtering draft is activated once validated by the running Elastic connector service. The filtering property is used to configure sync rules (both basic and advanced) for a connector.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

      - advanced_snippet (Mapping[str, Any] | None)

      - filtering (Sequence[Mapping[str, Any]] | None)

      - rules (Sequence[Mapping[str, 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]

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

    Update the connector draft filtering validation.

    Update the draft filtering validation info for a connector.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

      - validation (Mapping[str, 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]

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

    Update the connector index name.

    Update the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector name and description.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector is_native flag.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector pipeline.

    When you create a new connector, the configuration of an ingest pipeline is populated with default settings.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

      - pipeline (Mapping[str, 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]

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

    Update the connector scheduling.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

      - scheduling (Mapping[str, 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]

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

    Update the connector service type.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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

    Update the connector status.

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

    Parameters:

      - connector_id (str) – The unique identifier of the connector to be updated

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