1
0

update-connector-scheduling-api.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. [[update-connector-scheduling-api]]
  2. === Update connector scheduling API
  3. ++++
  4. <titleabbrev>Update connector scheduling</titleabbrev>
  5. ++++
  6. preview::[]
  7. Updates the `scheduling` configuration of a connector.
  8. [[update-connector-scheduling-api-request]]
  9. ==== {api-request-title}
  10. `PUT _connector/<connector_id>/_scheduling`
  11. [[update-connector-scheduling-api-prereq]]
  12. ==== {api-prereq-title}
  13. * 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.
  14. * The `connector_id` parameter should reference an existing connector.
  15. [[update-connector-scheduling-api-path-params]]
  16. ==== {api-path-parms-title}
  17. `<connector_id>`::
  18. (Required, string)
  19. [role="child_attributes"]
  20. [[update-connector-scheduling-api-request-body]]
  21. ==== {api-request-body-title}
  22. `scheduling`::
  23. (Required, object) The scheduling configuration for the connector. This configuration determines frequency of synchronization operations for the connector.
  24. The scheduling configuration includes the following attributes, each represented as a `ScheduleConfig` object:
  25. - `access_control` (Required, `ScheduleConfig` object) Defines the schedule for synchronizing access control settings of the connector.
  26. - `full` (Required, `ScheduleConfig` object) Defines the schedule for a full content syncs.
  27. - `incremental` (Required, `ScheduleConfig` object) Defines the schedule for incremental content syncs.
  28. Each `ScheduleConfig` object includes the following sub-attributes:
  29. - `enabled` (Required, boolean) A flag that enables or disables the scheduling.
  30. - `interval` (Required, string) A CRON expression representing the sync schedule. This expression defines the grequency at which the sync operations should occur. It must be provided in a valid CRON format.
  31. [[update-connector-scheduling-api-response-codes]]
  32. ==== {api-response-codes-title}
  33. `200`::
  34. Connector `scheduling` field was successfully updated.
  35. `400`::
  36. The `connector_id` was not provided or the request payload was malformed.
  37. `404` (Missing resources)::
  38. No connector matching `connector_id` could be found.
  39. [[update-connector-scheduling-api-example]]
  40. ==== {api-examples-title}
  41. The following example updates the `scheduling` property for the connector with ID `my-connector`:
  42. ////
  43. [source, console]
  44. --------------------------------------------------
  45. PUT _connector/my-connector
  46. {
  47. "index_name": "search-google-drive",
  48. "name": "My Connector",
  49. "service_type": "google_drive"
  50. }
  51. --------------------------------------------------
  52. // TESTSETUP
  53. [source,console]
  54. --------------------------------------------------
  55. DELETE _connector/my-connector
  56. --------------------------------------------------
  57. // TEARDOWN
  58. ////
  59. [source,console]
  60. ----
  61. PUT _connector/my-connector/_scheduling
  62. {
  63. "scheduling": {
  64. "access_control": {
  65. "enabled": true,
  66. "interval": "0 10 0 * * ?"
  67. },
  68. "full": {
  69. "enabled": true,
  70. "interval": "0 20 0 * * ?"
  71. },
  72. "incremental": {
  73. "enabled": false,
  74. "interval": "0 30 0 * * ?"
  75. }
  76. }
  77. }
  78. ----
  79. [source,console-result]
  80. ----
  81. {
  82. "result": "updated"
  83. }
  84. ----