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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. [[cancel-connector-sync-job-api]]
  2. === Cancel connector sync job API
  3. ++++
  4. <titleabbrev>Cancel connector sync job</titleabbrev>
  5. ++++
  6. beta::[]
  7. ..New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-connector[Connector APIs].
  11. --
  12. Cancels a connector sync job.
  13. To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
  14. [[cancel-connector-sync-job-api-request]]
  15. ==== {api-request-title}
  16. `PUT _connector/_sync_job/<connector_sync_job_id>/_cancel`
  17. [[cancel-connector-sync-job-api-prereqs]]
  18. ==== {api-prereq-title}
  19. * To sync data using self-managed connectors, you need to deploy the <<es-connectors-deploy-connector-service,Elastic connector service>>. on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.
  20. * The `connector_sync_job_id` parameter should reference an existing connector sync job.
  21. [[cancel-connector-sync-job-api-desc]]
  22. ==== {api-description-title}
  23. Cancels a connector sync job, which sets the `status` to `cancelling` and updates `cancellation_requested_at` to the current time.
  24. The connector service is then responsible for setting the `status` of connector sync jobs to `cancelled`.
  25. [[cancel-connector-sync-job-api-path-params]]
  26. ==== {api-path-parms-title}
  27. `connector_sync_job_id`::
  28. (Required, string)
  29. [[cancel-connector-sync-job-api-response-codes]]
  30. ==== {api-response-codes-title}
  31. `200`::
  32. Connector sync job cancellation was successfully requested.
  33. `404`::
  34. No connector sync job matching `connector_sync_job_id` could be found.
  35. [[cancel-connector-sync-job-api-example]]
  36. ==== {api-examples-title}
  37. The following example cancels the connector sync job with ID `my-connector-sync-job-id`:
  38. [source,console]
  39. ----
  40. PUT _connector/_sync_job/my-connector-sync-job-id/_cancel
  41. ----
  42. // 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.]