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

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