diff --git a/docs/reference/connector/apis/connector-apis.asciidoc b/docs/reference/connector/apis/connector-apis.asciidoc index 9d23fcf8d336e..41186ff6326f2 100644 --- a/docs/reference/connector/apis/connector-apis.asciidoc +++ b/docs/reference/connector/apis/connector-apis.asciidoc @@ -40,6 +40,8 @@ beta:[] beta:[] * <> beta:[] +* <> +beta:[] * <> beta:[] * <> @@ -120,6 +122,7 @@ include::list-connectors-api.asciidoc[] include::update-connector-api-key-id-api.asciidoc[] include::update-connector-configuration-api.asciidoc[] include::update-connector-index-name-api.asciidoc[] +include::update-connector-features-api.asciidoc[] include::update-connector-filtering-api.asciidoc[] include::update-connector-name-description-api.asciidoc[] include::update-connector-pipeline-api.asciidoc[] diff --git a/docs/reference/connector/apis/update-connector-features-api.asciidoc b/docs/reference/connector/apis/update-connector-features-api.asciidoc new file mode 100644 index 0000000000000..0d3457b9bd584 --- /dev/null +++ b/docs/reference/connector/apis/update-connector-features-api.asciidoc @@ -0,0 +1,138 @@ +[[update-connector-features-api]] +=== Update connector features API +++++ +Update connector features +++++ + +beta::[] + +Manages the `features` of a connector. This endpoint can be used to control the following aspects of a connector: + +* document-level security +* incremental syncs +* advanced sync rules +* basic sync rules + +Normally, the running connector service automatically manages these features. However, you can use this API to override the default behavior. + +To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^]. + +[[update-connector-features-api-request]] +==== {api-request-title} + +`PUT _connector//_features` + +[[update-connector-features-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. + +[[update-connector-features-api-path-params]] +==== {api-path-parms-title} + +``:: +(Required, string) + +[role="child_attributes"] +[[update-connector-features-api-request-body]] +==== {api-request-body-title} + +`features`:: +(Required, object) An object containing connector features. + +* `document_level_security` (Optional, object) Controls whether document-level security is enabled with the `enabled` flag. +* `incremental_sync` (Optional, object) Controls whether incremental syncs are enabled with the `enabled` flag. +* `native_connector_api_keys`(Optional, object) Controls whether native connector API keys are enabled with the `enabled` flag. +* `sync_rules` (Optional, object) Controls sync rules. +** `advanced` (Optional, object) Controls whether advanced sync rules are enabled with the `enabled` flag. +** `basic`(Optional, object) Controls whether basic sync rules are enabled with the `enabled` flag. + + + +[[update-connector-features-api-response-codes]] +==== {api-response-codes-title} + +`200`:: +Connector `features` 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-features-api-example]] +==== {api-examples-title} + +The following example updates the `features` 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/_features +{ + "features": { + "document_level_security": { + "enabled": true + }, + "incremental_sync": { + "enabled": true + }, + "sync_rules": { + "advanced": { + "enabled": false + }, + "basic": { + "enabled": true + } + } + } +} +---- + +[source,console-result] +---- +{ + "result": "updated" +} +---- + +The endpoint supports partial updates of the `features` field. For example, to update only the `document_level_security` feature, you can send the following request: + +[source,console] +---- +PUT _connector/my-connector/_features +{ + "features": { + "document_level_security": { + "enabled": true + } + } +} +---- + +[source,console-result] +---- +{ + "result": "updated" +} +----