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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. [[update-connector-index-name-api]]
  2. === Update connector index name API
  3. ++++
  4. <titleabbrev>Update connector index name</titleabbrev>
  5. ++++
  6. preview::[]
  7. Updates the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.
  8. [[update-connector-index-name-api-request]]
  9. ==== {api-request-title}
  10. `PUT _connector/<connector_id>/_index_name`
  11. [[update-connector-index-name-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. [[update-connector-index-name-api-path-params]]
  16. ==== {api-path-parms-title}
  17. `<connector_id>`::
  18. (Required, string)
  19. [role="child_attributes"]
  20. [[update-connector-index-name-api-request-body]]
  21. ==== {api-request-body-title}
  22. `index_name`::
  23. (Required, string) Index name where the connector ingests data. Each index name can be associated with at most one connector.
  24. [[update-connector-index-name-api-response-codes]]
  25. ==== {api-response-codes-title}
  26. `200`::
  27. Connector `index_name` field was successfully updated.
  28. `400`::
  29. The `connector_id` was not provided or the request payload was malformed.
  30. `404` (Missing resources)::
  31. No connector matching `connector_id` could be found.
  32. [[update-connector-index-name-api-example]]
  33. ==== {api-examples-title}
  34. The following example updates the `index_name` field for the connector with ID `my-connector`:
  35. ////
  36. [source, console]
  37. --------------------------------------------------
  38. PUT _connector/my-connector
  39. {
  40. "index_name": "search-google-drive",
  41. "name": "My Connector",
  42. "service_type": "google_drive"
  43. }
  44. --------------------------------------------------
  45. // TESTSETUP
  46. [source,console]
  47. --------------------------------------------------
  48. DELETE _connector/my-connector
  49. --------------------------------------------------
  50. // TEARDOWN
  51. ////
  52. [source,console]
  53. ----
  54. PUT _connector/my-connector/_index_name
  55. {
  56. "index_name": "data-from-my-google-drive"
  57. }
  58. ----
  59. [source,console-result]
  60. ----
  61. {
  62. "result": "updated"
  63. }
  64. ----