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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  9. [[set-connector-sync-job-error-api-request]]
  10. ==== {api-request-title}
  11. `PUT _connector/_sync_job/<connector_sync_job_id>/_error`
  12. [[set-connector-sync-job-error-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. [[set-connector-sync-job-error-api-desc]]
  17. ==== {api-description-title}
  18. Sets the `error` field for the specified connector sync job and sets its `status` to `error`.
  19. [[set-connector-sync-job-error-api-path-params]]
  20. ==== {api-path-parms-title}
  21. `<connector_sync_job_id>`::
  22. (Required, string)
  23. [role="child_attributes"]
  24. [[set-connector-sync-job-error-api-request-body]]
  25. ==== {api-request-body-title}
  26. `error`::
  27. (Required, string) The error to set the connector sync job `error` field to.
  28. [[set-connector-sync-job-api-response-codes]]
  29. ==== {api-response-codes-title}
  30. `200`::
  31. Indicates that the connector sync job error was set successfully.
  32. `404`::
  33. No connector sync job matching `connector_sync_job_id` could be found.
  34. [[set-connector-sync-job-error-api-example]]
  35. ==== {api-examples-title}
  36. The following example sets the error `some-error` in the connector sync job `my-connector-sync-job`:
  37. [source,console]
  38. ----
  39. PUT _connector/_sync_job/my-connector-sync-job/_error
  40. {
  41. "error": "some-error"
  42. }
  43. ----
  44. // 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.]