update-connector-index-name-api.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [[update-connector-index-name-api]]
  2. === Update connector index name API
  3. ++++
  4. <titleabbrev>Update connector index name</titleabbrev>
  5. ++++
  6. beta::[]
  7. Updates the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.
  8. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  9. [[update-connector-index-name-api-request]]
  10. ==== {api-request-title}
  11. `PUT _connector/<connector_id>/_index_name`
  12. [[update-connector-index-name-api-prereq]]
  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_id` parameter should reference an existing connector.
  16. [[update-connector-index-name-api-path-params]]
  17. ==== {api-path-parms-title}
  18. `<connector_id>`::
  19. (Required, string)
  20. [role="child_attributes"]
  21. [[update-connector-index-name-api-request-body]]
  22. ==== {api-request-body-title}
  23. `index_name`::
  24. (Required, string) Index name where the connector ingests data. Each index name can be associated with at most one connector.
  25. [[update-connector-index-name-api-response-codes]]
  26. ==== {api-response-codes-title}
  27. `200`::
  28. Connector `index_name` field was successfully updated.
  29. `400`::
  30. The `connector_id` was not provided or the request payload was malformed.
  31. `404` (Missing resources)::
  32. No connector matching `connector_id` could be found.
  33. [[update-connector-index-name-api-example]]
  34. ==== {api-examples-title}
  35. The following example updates the `index_name` field for 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": "google_drive"
  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/_index_name
  56. {
  57. "index_name": "data-from-my-google-drive"
  58. }
  59. ----
  60. [source,console-result]
  61. ----
  62. {
  63. "result": "updated"
  64. }
  65. ----