cancel-connector-sync-job-api.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. [[cancel-connector-sync-job-api]]
  2. === Cancel connector sync job API
  3. ++++
  4. <titleabbrev>Cancel connector sync job</titleabbrev>
  5. ++++
  6. beta::[]
  7. Cancels a connector sync job.
  8. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  9. [[cancel-connector-sync-job-api-request]]
  10. ==== {api-request-title}
  11. `PUT _connector/_sync_job/<connector_sync_job_id>/_cancel`
  12. [[cancel-connector-sync-job-api-prereqs]]
  13. ==== {api-prereq-title}
  14. * To sync data using self-managed connectors, you need to deploy the {enterprise-search-ref}/build-connector.html[Elastic connector service] on your own infrastructure. This service runs automatically on Elastic Cloud for native connectors.
  15. * The `connector_sync_job_id` parameter should reference an existing connector sync job.
  16. [[cancel-connector-sync-job-api-desc]]
  17. ==== {api-description-title}
  18. Cancels a connector sync job, which sets the `status` to `cancelling` and updates `cancellation_requested_at` to the current time.
  19. The connector service is then responsible for setting the `status` of connector sync jobs to `cancelled`.
  20. [[cancel-connector-sync-job-api-path-params]]
  21. ==== {api-path-parms-title}
  22. `connector_sync_job_id`::
  23. (Required, string)
  24. [[cancel-connector-sync-job-api-response-codes]]
  25. ==== {api-response-codes-title}
  26. `200`::
  27. Connector sync job cancellation was successfully requested.
  28. `404`::
  29. No connector sync job matching `connector_sync_job_id` could be found.
  30. [[cancel-connector-sync-job-api-example]]
  31. ==== {api-examples-title}
  32. The following example cancels the connector sync job with ID `my-connector-sync-job-id`:
  33. [source,console]
  34. ----
  35. PUT _connector/_sync_job/my-connector-sync-job-id/_cancel
  36. ----
  37. // TEST[skip:there's no way to clean up after creating a connector sync job, as we don't know the id ahead of time. Therefore, skip this test.]