update-connector-error-api.asciidoc 2.5 KB

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