12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- [[update-connector-status-api]]
- === Update connector status API
- ++++
- <titleabbrev>Update connector status</titleabbrev>
- ++++
- preview::[]
- Updates the `status` of a connector.
- [[update-connector-status-api-request]]
- ==== {api-request-title}
- `PUT _connector/<connector_id>/_status`
- [[update-connector-status-api-prereq]]
- ==== {api-prereq-title}
- * 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.
- * The `connector_id` parameter should reference an existing connector.
- * 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].
- [[update-connector-status-api-path-params]]
- ==== {api-path-parms-title}
- `<connector_id>`::
- (Required, string)
- [role="child_attributes"]
- [[update-connector-status-api-request-body]]
- ==== {api-request-body-title}
- `status`::
- (Required, string) A valid connector status string, defined in the Connector Framework.
- [[update-connector-status-api-response-codes]]
- ==== {api-response-codes-title}
- `200`::
- Connector `status` field was successfully updated.
- `400`::
- The `connector_id` was not provided, the request payload was malformed, or the given status transition is not supported.
- `404` (Missing resources)::
- No connector matching `connector_id` could be found.
- [[update-connector-status-api-example]]
- ==== {api-examples-title}
- The following example updates the `status` of the connector with ID `my-connector`:
- ////
- [source, console]
- --------------------------------------------------
- PUT _connector/my-connector
- {
- "index_name": "search-google-drive",
- "name": "My Connector",
- "service_type": "needs_configuration"
- }
- --------------------------------------------------
- // TESTSETUP
- [source,console]
- --------------------------------------------------
- DELETE _connector/my-connector
- --------------------------------------------------
- // TEARDOWN
- ////
- [source,console]
- ----
- PUT _connector/my-connector/_status
- {
- "status": "needs_configuration"
- }
- ----
- [source,console-result]
- ----
- {
- "result": "updated"
- }
- ----
|