set-connector-sync-job-error-api.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. [[set-connector-sync-job-error-api]]
  2. === Set connector sync job error API
  3. ++++
  4. <titleabbrev>Set connector sync job error</titleabbrev>
  5. ++++
  6. preview::[]
  7. Sets a connector sync job error.
  8. [[set-connector-sync-job-error-api-request]]
  9. ==== {api-request-title}
  10. `PUT _connector/_sync_job/<connector_sync_job_id>/_error`
  11. [[set-connector-sync-job-error-api-prereqs]]
  12. ==== {api-prereq-title}
  13. * 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.
  14. * The `connector_sync_job_id` parameter should reference an existing connector sync job.
  15. [[set-connector-sync-job-error-api-desc]]
  16. ==== {api-description-title}
  17. Sets the `error` field for the specified connector sync job and sets its `status` to `error`.
  18. [[set-connector-sync-job-error-api-path-params]]
  19. ==== {api-path-parms-title}
  20. `<connector_sync_job_id>`::
  21. (Required, string)
  22. [role="child_attributes"]
  23. [[set-connector-sync-job-error-api-request-body]]
  24. ==== {api-request-body-title}
  25. `error`::
  26. (Required, string) The error to set the connector sync job `error` field to.
  27. [[set-connector-sync-job-api-response-codes]]
  28. ==== {api-response-codes-title}
  29. `200`::
  30. Indicates that the connector sync job error was set successfully.
  31. `404`::
  32. No connector sync job matching `connector_sync_job_id` could be found.
  33. [[set-connector-sync-job-error-api-example]]
  34. ==== {api-examples-title}
  35. The following example sets the error `some-error` in the connector sync job `my-connector-sync-job`:
  36. [source,console]
  37. ----
  38. PUT _connector/_sync_job/my-connector-sync-job/_error
  39. {
  40. "error": "some-error"
  41. }
  42. ----
  43. // 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.]