Browse Source

[Docs][Connector API] Add documentation for update featueres endpoint (#109346)

Jedr Blaszyk 1 year ago
parent
commit
04124165ec

+ 3 - 0
docs/reference/connector/apis/connector-apis.asciidoc

@@ -40,6 +40,8 @@ beta:[]
 beta:[]
 * <<update-connector-configuration-api>>
 beta:[]
+* <<update-connector-features-api>>
+beta:[]
 * <<update-connector-filtering-api>>
 beta:[]
 * <<update-connector-index-name-api>>
@@ -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[]

+ 138 - 0
docs/reference/connector/apis/update-connector-features-api.asciidoc

@@ -0,0 +1,138 @@
+[[update-connector-features-api]]
+=== Update connector features API
+++++
+<titleabbrev>Update connector features</titleabbrev>
+++++
+
+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/<connector_id>/_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}
+
+`<connector_id>`::
+(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"
+}
+----