Create connector APIedit

This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Creates an Elastic connector. Connectors are third-party Elasticsearch integrations which can be deployed on Elastic Cloud or hosted on your own infrastructure:

  • Native connectors are a managed service on Elastic Cloud
  • Connector clients are self-managed on your infrastructure

Find a list of all supported service types in the connectors documentation.

response = client.connector.put(
  connector_id: 'my-connector',
  body: {
    index_name: 'search-google-drive',
    name: 'My Connector',
    service_type: 'google_drive'
  }
)
puts response
PUT _connector/my-connector
{
  "index_name": "search-google-drive",
  "name": "My Connector",
  "service_type": "google_drive"
}

Requestedit

POST _connector

PUT _connector/<connector_id>

Prerequisitesedit

  • To sync data using connectors, it’s essential to have the Elastic connectors service running.
  • The service_type parameter should reference an existing connector service type.

Descriptionedit

Creates a connector document in the internal index and initializes its configuration, filtering, and scheduling with default values. These values can be updated later as needed.

Path parametersedit

<connector_id>
(Required, string) Unique identifier of a connector.

Request bodyedit

description
(Optional, string) The description of the connector.
index_name
(Required, string) The target index for syncing data by the connector.
name
(Optional, string) The name of the connector.
is_native
(Optional, boolean) Indicates if it’s a native connector. Defaults to false.
language
(Optional, string) Language analyzer for the data. Limited to supported languages.
service_type
(Optional, string) Connector service type. Can reference Elastic-supported connector types or a custom connector type.

Response bodyedit

id
(string) The ID associated with the connector document. Returned when using a POST request.
result
(string) The result of the indexing operation, created or updated. Returned when using a PUT request.

Response codesedit

200
Indicates that an existing connector was updated successfully.
201
Indicates that the connector was created successfully.
400
Indicates that the request was malformed.

Examplesedit

response = client.connector.put(
  connector_id: 'my-connector',
  body: {
    index_name: 'search-google-drive',
    name: 'My Connector',
    description: 'My Connector to sync data to Elastic index from Google Drive',
    service_type: 'google_drive',
    language: 'english'
  }
)
puts response
PUT _connector/my-connector
{
  "index_name": "search-google-drive",
  "name": "My Connector",
  "description": "My Connector to sync data to Elastic index from Google Drive",
  "service_type": "google_drive",
  "language": "english"
}

The API returns the following result:

{
  "result": "created"
}