12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- [[update-connector-index-name-api]]
- === Update connector index name API
- ++++
- <titleabbrev>Update connector index name</titleabbrev>
- ++++
- beta::[]
- .New API reference
- [sidebar]
- --
- For the most up-to-date API details, refer to {api-es}/group/endpoint-connector[Connector APIs].
- --
- Updates the `index_name` field of a connector, specifying the index where the data ingested by the connector is stored.
- To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
- [[update-connector-index-name-api-request]]
- ==== {api-request-title}
- `PUT _connector/<connector_id>/_index_name`
- [[update-connector-index-name-api-prereq]]
- ==== {api-prereq-title}
- * 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.
- * The `connector_id` parameter should reference an existing connector.
- [[update-connector-index-name-api-path-params]]
- ==== {api-path-parms-title}
- `<connector_id>`::
- (Required, string)
- [role="child_attributes"]
- [[update-connector-index-name-api-request-body]]
- ==== {api-request-body-title}
- `index_name`::
- (Required, string) Index name where the connector ingests data. Each index name can be associated with at most one connector.
- [[update-connector-index-name-api-response-codes]]
- ==== {api-response-codes-title}
- `200`::
- Connector `index_name` field was successfully updated.
- `400`::
- The `connector_id` was not provided or the request payload was malformed.
- `404` (Missing resources)::
- No connector matching `connector_id` could be found.
- [[update-connector-index-name-api-example]]
- ==== {api-examples-title}
- The following example updates the `index_name` field for the connector with ID `my-connector`:
- ////
- [source, console]
- --------------------------------------------------
- PUT _connector/my-connector
- {
- "index_name": "search-google-drive",
- "name": "My Connector",
- "service_type": "google_drive"
- }
- --------------------------------------------------
- // TESTSETUP
- [source,console]
- --------------------------------------------------
- DELETE _connector/my-connector
- --------------------------------------------------
- // TEARDOWN
- ////
- [source,console]
- ----
- PUT _connector/my-connector/_index_name
- {
- "index_name": "data-from-my-google-drive"
- }
- ----
- [source,console-result]
- ----
- {
- "result": "updated"
- }
- ----
|