Update connector features API

edit

Update connector features API

edit

This functionality is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features.

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 tutorial.

Request

edit

PUT _connector/<connector_id>/_features

Prerequisites

edit
  • To sync data using self-managed connectors, you need to deploy the 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.

Path parameters

edit
<connector_id>
(Required, string)

Request body

edit
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.

Response codes

edit
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.

Examples

edit

The following example updates the features field for the connector with ID my-connector:

resp = client.perform_request(
    "PUT",
    "/_connector/my-connector/_features",
    headers={"Content-Type": "application/json"},
    body={
        "features": {
            "document_level_security": {
                "enabled": True
            },
            "incremental_sync": {
                "enabled": True
            },
            "sync_rules": {
                "advanced": {
                    "enabled": False
                },
                "basic": {
                    "enabled": True
                }
            }
        }
    },
)
print(resp)
const response = await client.transport.request({
  method: "PUT",
  path: "/_connector/my-connector/_features",
  body: {
    features: {
      document_level_security: {
        enabled: true,
      },
      incremental_sync: {
        enabled: true,
      },
      sync_rules: {
        advanced: {
          enabled: false,
        },
        basic: {
          enabled: true,
        },
      },
    },
  },
});
console.log(response);
PUT _connector/my-connector/_features
{
  "features": {
    "document_level_security": {
      "enabled": true
    },
    "incremental_sync": {
      "enabled": true
    },
    "sync_rules": {
      "advanced": {
        "enabled": false
      },
      "basic": {
        "enabled": true
      }
    }
  }
}
{
    "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:

resp = client.perform_request(
    "PUT",
    "/_connector/my-connector/_features",
    headers={"Content-Type": "application/json"},
    body={
        "features": {
            "document_level_security": {
                "enabled": True
            }
        }
    },
)
print(resp)
const response = await client.transport.request({
  method: "PUT",
  path: "/_connector/my-connector/_features",
  body: {
    features: {
      document_level_security: {
        enabled: true,
      },
    },
  },
});
console.log(response);
PUT _connector/my-connector/_features
{
  "features": {
    "document_level_security": {
      "enabled": true
    }
  }
}
{
    "result": "updated"
}