mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
87 lines
2.3 KiB
Text
87 lines
2.3 KiB
Text
[[update-connector-status-api]]
|
|
=== Update connector status API
|
|
++++
|
|
<titleabbrev>Update connector status</titleabbrev>
|
|
++++
|
|
|
|
preview::[]
|
|
|
|
Updates the `status` of a connector.
|
|
|
|
To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
|
|
|
|
[[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"
|
|
}
|
|
----
|