update-connector-error-api.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. [[update-connector-error-api]]
  2. === Update connector error API
  3. ++++
  4. <titleabbrev>Update connector error</titleabbrev>
  5. ++++
  6. preview::[]
  7. Updates the `error` field of a connector.
  8. To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
  9. [[update-connector-error-api-request]]
  10. ==== {api-request-title}
  11. `PUT _connector/<connector_id>/_error`
  12. [[update-connector-error-api-prereq]]
  13. ==== {api-prereq-title}
  14. * 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.
  15. * The `connector_id` parameter should reference an existing connector.
  16. [[update-connector-error-api-desc]]
  17. ==== {api-description-title}
  18. Sets the `error` field for the specified connector. If the `error` provided in the request body is non-null, the connector's status is updated to `error`. Otherwise, if the `error` is reset to null, the connector status is updated to `connected`.
  19. [[update-connector-error-api-path-params]]
  20. ==== {api-path-parms-title}
  21. `<connector_id>`::
  22. (Required, string)
  23. [role="child_attributes"]
  24. [[update-connector-error-api-request-body]]
  25. ==== {api-request-body-title}
  26. `error`::
  27. (Required, string) A messaged related to the last error encountered by the connector.
  28. [[update-connector-error-api-response-codes]]
  29. ==== {api-response-codes-title}
  30. `200`::
  31. Connector `error` field was successfully updated.
  32. `400`::
  33. The `connector_id` was not provided or the request payload was malformed.
  34. `404` (Missing resources)::
  35. No connector matching `connector_id` could be found.
  36. [[update-connector-error-api-example]]
  37. ==== {api-examples-title}
  38. The following example updates the `error` field for the connector with ID `my-connector`:
  39. ////
  40. [source, console]
  41. --------------------------------------------------
  42. PUT _connector/my-connector
  43. {
  44. "index_name": "search-google-drive",
  45. "name": "My Connector",
  46. "service_type": "google_drive"
  47. }
  48. --------------------------------------------------
  49. // TESTSETUP
  50. [source,console]
  51. --------------------------------------------------
  52. DELETE _connector/my-connector
  53. --------------------------------------------------
  54. // TEARDOWN
  55. ////
  56. [source,console]
  57. ----
  58. PUT _connector/my-connector/_error
  59. {
  60. "error": "Houston, we have a problem!"
  61. }
  62. ----
  63. [source,console-result]
  64. ----
  65. {
  66. "result": "updated"
  67. }
  68. ----