Skip to content

Commit

Permalink
[Docs][Connector API] Add documentation for update featueres endpoint (
Browse files Browse the repository at this point in the history
  • Loading branch information
jedrazb authored Jun 4, 2024
1 parent 2109adc commit 0412416
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/reference/connector/apis/connector-apis.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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>>
Expand Down Expand Up @@ -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[]
Expand Down
138 changes: 138 additions & 0 deletions docs/reference/connector/apis/update-connector-features-api.asciidoc
Original file line number Diff line number Diff line change
@@ -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"
}
----

0 comments on commit 0412416

Please sign in to comment.