Claim connector sync job API
editClaim connector sync job API
editThis 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.
Claims a connector sync job.
The _claim
endpoint is not intended for direct connector management by users. It is there to support the implementation of services that utilize the Connector Protocol to communicate with Elasticsearch.
To get started with Connector APIs, check out our tutorial.
Request
editPUT _connector/_sync_job/<connector_sync_job_id>/_claim
Prerequisites
edit- 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.
-
The
connector_sync_job_id
parameter should reference an existing connector sync job.
Description
editClaims a connector sync job. This action updates the job’s 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.
Path parameters
edit-
connector_sync_job_id
- (Required, string)
Request body
edit-
worker_hostname
- (Required, string) The host name of the current system that will execute the job.
-
sync_cursor
-
(Optional, Object) The cursor object from the last incremental sync job. This should reference the
sync_cursor
field in the connector state for which the job is executed.
Response codes
edit-
200
- Connector sync job was successfully claimed.
-
404
-
No connector sync job matching
connector_sync_job_id
could be found.
Examples
editThe following example claims the connector sync job with ID my-connector-sync-job-id
:
resp = client.perform_request( "PUT", "/_connector/_sync_job/my-connector-sync-job-id/_claim", headers={"Content-Type": "application/json"}, body={ "worker_hostname": "some-machine" }, ) print(resp)
const response = await client.transport.request({ method: "PUT", path: "/_connector/_sync_job/my-connector-sync-job-id/_claim", body: { worker_hostname: "some-machine", }, }); console.log(response);
PUT _connector/_sync_job/my-connector-sync-job-id/_claim { "worker_hostname": "some-machine" }