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

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