update-connector-configuration-api.asciidoc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. [[update-connector-configuration-api]]
  2. === Update connector configuration API
  3. ++++
  4. <titleabbrev>Update connector configuration</titleabbrev>
  5. ++++
  6. beta::[]
  7. Updates a connector's `configuration`, allowing for config value updates within a registered configuration schema.
  8. To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
  9. [[update-connector-configuration-api-request]]
  10. ==== {api-request-title}
  11. `PUT _connector/<connector_id>/_configuration`
  12. [[update-connector-configuration-api-prereq]]
  13. ==== {api-prereq-title}
  14. * To sync data using self-managed connectors, you need to deploy the <<es-connectors-deploy-connector-service,Elastic connector service>>. on your own infrastructure. This service runs automatically on Elastic Cloud for Elastic managed connectors.
  15. * The `connector_id` parameter should reference an existing connector.
  16. * To update configuration `values`, the connector `configuration` schema must be first registered by a running instance of Elastic connector service.
  17. * Make sure configuration fields are compatible with the configuration schema for the third-party data source. Refer to the individual <<es-connectors-refs,connector references>> for details.
  18. [[update-connector-configuration-api-path-params]]
  19. ==== {api-path-parms-title}
  20. `<connector_id>`::
  21. (Required, string)
  22. [role="child_attributes"]
  23. [[update-connector-configuration-api-request-body]]
  24. ==== {api-request-body-title}
  25. `values`::
  26. (Optional, object) Configuration values for the connector, represented as a mapping of configuration fields to their respective values within a registered schema.
  27. `configuration`::
  28. (Optional, object) The configuration schema definition for the connector. The configuration field is a map where each key represents a specific configuration field name, and the value is a `ConnectorConfiguration` object. For connector management use `values` to pass config values. The `configuration` object is used by the Elastic connector service to register the connector configuration schema.
  29. [[update-connector-configuration-api-response-codes]]
  30. ==== {api-response-codes-title}
  31. `200`::
  32. Connector configuration was successfully updated.
  33. `400`::
  34. The `connector_id` was not provided or the request payload was malformed.
  35. `404` (Missing resources)::
  36. No connector matching `connector_id` could be found.
  37. [[update-connector-configuration-api-example]]
  38. ==== {api-examples-title}
  39. The following example configures a `sharepoint_online` connector. Find the supported configuration options in the <<es-connectors-sharepoint-online,Sharepoint Online connector documentation>>, or by inspecting the schema in the connector's `configuration` field using the <<get-connector-api>>.
  40. ////
  41. [source, console]
  42. --------------------------------------------------
  43. PUT _connector/my-spo-connector
  44. {
  45. "index_name": "search-sharepoint-online",
  46. "name": "Sharepoint Online Connector",
  47. "service_type": "sharepoint_online"
  48. }
  49. PUT _connector/my-spo-connector/_configuration
  50. {
  51. "configuration": {
  52. "tenant_id": {
  53. "default_value": null,
  54. "depends_on": [],
  55. "display": "textbox",
  56. "label": "Tenant ID",
  57. "options": [],
  58. "order": 1,
  59. "required": true,
  60. "sensitive": false,
  61. "tooltip": "",
  62. "type": "str",
  63. "ui_restrictions": [],
  64. "validations": [],
  65. "value": ""
  66. },
  67. "tenant_name": {
  68. "default_value": null,
  69. "depends_on": [],
  70. "display": "textbox",
  71. "label": "Tenant name",
  72. "options": [],
  73. "order": 2,
  74. "required": true,
  75. "sensitive": false,
  76. "tooltip": "",
  77. "type": "str",
  78. "ui_restrictions": [],
  79. "validations": [],
  80. "value": ""
  81. },
  82. "client_id": {
  83. "default_value": null,
  84. "depends_on": [],
  85. "display": "textbox",
  86. "label": "Client ID",
  87. "options": [],
  88. "order": 3,
  89. "required": true,
  90. "sensitive": false,
  91. "tooltip": "",
  92. "type": "str",
  93. "ui_restrictions": [],
  94. "validations": [],
  95. "value": ""
  96. },
  97. "secret_value": {
  98. "default_value": null,
  99. "depends_on": [],
  100. "display": "textbox",
  101. "label": "Secret value",
  102. "options": [],
  103. "order": 4,
  104. "required": true,
  105. "sensitive": true,
  106. "tooltip": "",
  107. "type": "str",
  108. "ui_restrictions": [],
  109. "validations": [],
  110. "value": ""
  111. },
  112. "site_collections": {
  113. "default_value": null,
  114. "depends_on": [],
  115. "display": "textarea",
  116. "label": "Comma-separated list of sites",
  117. "options": [],
  118. "order": 5,
  119. "required": true,
  120. "sensitive": false,
  121. "tooltip": "A comma-separated list of sites to ingest data from. Use * to include all available sites.",
  122. "type": "list",
  123. "ui_restrictions": [],
  124. "validations": [],
  125. "value": ""
  126. },
  127. "use_text_extraction_service": {
  128. "default_value": false,
  129. "depends_on": [],
  130. "display": "toggle",
  131. "label": "Use text extraction service",
  132. "options": [],
  133. "order": 6,
  134. "required": true,
  135. "sensitive": false,
  136. "tooltip": "Requires a separate deployment of the Elastic Data Extraction Service. Also requires that pipeline settings disable text extraction.",
  137. "type": "bool",
  138. "ui_restrictions": [
  139. "advanced"
  140. ],
  141. "validations": [],
  142. "value": false
  143. },
  144. "use_document_level_security": {
  145. "default_value": false,
  146. "depends_on": [],
  147. "display": "toggle",
  148. "label": "Enable document level security",
  149. "options": [],
  150. "order": 7,
  151. "required": true,
  152. "sensitive": false,
  153. "tooltip": "Document level security ensures identities and permissions set in Sharepoint Online are maintained in Elasticsearch. This metadata is added to your Elasticsearch documents, so you can control user and group read-access. Access control syncs ensure this metadata is kept up to date.",
  154. "type": "bool",
  155. "ui_restrictions": [],
  156. "validations": [],
  157. "value": false
  158. },
  159. "fetch_drive_item_permissions": {
  160. "default_value": true,
  161. "depends_on": [
  162. {
  163. "field": "use_document_level_security",
  164. "value": true
  165. }
  166. ],
  167. "display": "toggle",
  168. "label": "Fetch drive item permissions",
  169. "options": [],
  170. "order": 8,
  171. "required": true,
  172. "sensitive": false,
  173. "tooltip": "Enable this option to fetch drive item specific permissions. This setting can increase sync time.",
  174. "type": "bool",
  175. "ui_restrictions": [],
  176. "validations": [],
  177. "value": true
  178. },
  179. "fetch_unique_page_permissions": {
  180. "default_value": true,
  181. "depends_on": [
  182. {
  183. "field": "use_document_level_security",
  184. "value": true
  185. }
  186. ],
  187. "display": "toggle",
  188. "label": "Fetch unique page permissions",
  189. "options": [],
  190. "order": 9,
  191. "required": true,
  192. "sensitive": false,
  193. "tooltip": "Enable this option to fetch unique page permissions. This setting can increase sync time. If this setting is disabled a page will inherit permissions from its parent site.",
  194. "type": "bool",
  195. "ui_restrictions": [],
  196. "validations": [],
  197. "value": true
  198. },
  199. "fetch_unique_list_permissions": {
  200. "default_value": true,
  201. "depends_on": [
  202. {
  203. "field": "use_document_level_security",
  204. "value": true
  205. }
  206. ],
  207. "display": "toggle",
  208. "label": "Fetch unique list permissions",
  209. "options": [],
  210. "order": 10,
  211. "required": true,
  212. "sensitive": false,
  213. "tooltip": "Enable this option to fetch unique list permissions. This setting can increase sync time. If this setting is disabled a list will inherit permissions from its parent site.",
  214. "type": "bool",
  215. "ui_restrictions": [],
  216. "validations": [],
  217. "value": true
  218. },
  219. "fetch_unique_list_item_permissions": {
  220. "default_value": true,
  221. "depends_on": [
  222. {
  223. "field": "use_document_level_security",
  224. "value": true
  225. }
  226. ],
  227. "display": "toggle",
  228. "label": "Fetch unique list item permissions",
  229. "options": [],
  230. "order": 11,
  231. "required": true,
  232. "sensitive": false,
  233. "tooltip": "Enable this option to fetch unique list item permissions. This setting can increase sync time. If this setting is disabled a list item will inherit permissions from its parent site.",
  234. "type": "bool",
  235. "ui_restrictions": [],
  236. "validations": [],
  237. "value": true
  238. },
  239. "enumerate_all_sites": {
  240. "default_value": true,
  241. "depends_on": [],
  242. "display": "toggle",
  243. "label": "Enumerate all sites?",
  244. "options": [],
  245. "order": 6,
  246. "required": false,
  247. "sensitive": false,
  248. "tooltip": "If enabled, sites will be fetched in bulk, then filtered down to the configured list of sites. This is efficient when syncing many sites. If disabled, each configured site will be fetched with an individual request. This is efficient when syncing fewer sites.",
  249. "type": "bool",
  250. "ui_restrictions": [],
  251. "validations": [],
  252. "value": true
  253. },
  254. "fetch_subsites": {
  255. "default_value": false,
  256. "depends_on": [
  257. {
  258. "field": "enumerate_all_sites",
  259. "value": false
  260. }
  261. ],
  262. "display": "toggle",
  263. "label": "Fetch sub-sites of configured sites?",
  264. "options": [],
  265. "order": 7,
  266. "required": false,
  267. "sensitive": false,
  268. "tooltip": "Whether subsites of the configured site(s) should be automatically fetched.",
  269. "type": "bool",
  270. "ui_restrictions": [],
  271. "validations": [],
  272. "value": true
  273. }
  274. }
  275. }
  276. --------------------------------------------------
  277. // TESTSETUP
  278. [source,console]
  279. --------------------------------------------------
  280. DELETE _connector/my-spo-connector
  281. --------------------------------------------------
  282. // TEARDOWN
  283. ////
  284. [source,console]
  285. ----
  286. PUT _connector/my-spo-connector/_configuration
  287. {
  288. "values": {
  289. "tenant_id": "my-tenant-id",
  290. "tenant_name": "my-sharepoint-site",
  291. "client_id": "foo",
  292. "secret_value": "bar",
  293. "site_collections": "*"
  294. }
  295. }
  296. ----
  297. [source,console-result]
  298. ----
  299. {
  300. "result": "updated"
  301. }
  302. ----
  303. When you're first setting up your connector you'll need to provide all required configuration details to start running syncs.
  304. But you can also use this API to only update a subset of fields.
  305. Here's an example that only updates the `secret_value` field for a `sharepoint_online` connector.
  306. The other configuration values won't change.
  307. [source,console]
  308. ----
  309. PUT _connector/my-spo-connector/_configuration
  310. {
  311. "values": {
  312. "secret_value": "foo-bar"
  313. }
  314. }
  315. ----
  316. [source,console-result]
  317. ----
  318. {
  319. "result": "updated"
  320. }
  321. ----