1
0

update-connector-status-api.asciidoc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. [[update-connector-status-api]]
  2. === Update connector status API
  3. ++++
  4. <titleabbrev>Update connector status</titleabbrev>
  5. ++++
  6. preview::[]
  7. Updates the `status` of a connector.
  8. [[update-connector-status-api-request]]
  9. ==== {api-request-title}
  10. `PUT _connector/<connector_id>/_status`
  11. [[update-connector-status-api-prereq]]
  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_id` parameter should reference an existing connector.
  15. * The change of `status` must be a valid status transition according to the https://github.com/elastic/connectors/blob/main/docs/CONNECTOR_PROTOCOL.md[Connector Protocol].
  16. [[update-connector-status-api-path-params]]
  17. ==== {api-path-parms-title}
  18. `<connector_id>`::
  19. (Required, string)
  20. [role="child_attributes"]
  21. [[update-connector-status-api-request-body]]
  22. ==== {api-request-body-title}
  23. `status`::
  24. (Required, string) A valid connector status string, defined in the Connector Framework.
  25. [[update-connector-status-api-response-codes]]
  26. ==== {api-response-codes-title}
  27. `200`::
  28. Connector `status` field was successfully updated.
  29. `400`::
  30. The `connector_id` was not provided, the request payload was malformed, or the given status transition is not supported.
  31. `404` (Missing resources)::
  32. No connector matching `connector_id` could be found.
  33. [[update-connector-status-api-example]]
  34. ==== {api-examples-title}
  35. The following example updates the `status` of the connector with ID `my-connector`:
  36. ////
  37. [source, console]
  38. --------------------------------------------------
  39. PUT _connector/my-connector
  40. {
  41. "index_name": "search-google-drive",
  42. "name": "My Connector",
  43. "service_type": "needs_configuration"
  44. }
  45. --------------------------------------------------
  46. // TESTSETUP
  47. [source,console]
  48. --------------------------------------------------
  49. DELETE _connector/my-connector
  50. --------------------------------------------------
  51. // TEARDOWN
  52. ////
  53. [source,console]
  54. ----
  55. PUT _connector/my-connector/_status
  56. {
  57. "status": "needs_configuration"
  58. }
  59. ----
  60. [source,console-result]
  61. ----
  62. {
  63. "result": "updated"
  64. }
  65. ----