list-connector-sync-jobs-api.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [role="xpack"]
  2. [[list-connector-sync-jobs-api]]
  3. === List connector sync jobs API
  4. ++++
  5. <titleabbrev>List connector sync jobs</titleabbrev>
  6. ++++
  7. beta::[]
  8. Returns information about all stored connector sync jobs ordered by their creation date in ascending order.
  9. To get started with Connector APIs, check out the {enterprise-search-ref}/connectors-tutorial-api.html[tutorial^].
  10. [[list-connector-sync-jobs-api-request]]
  11. ==== {api-request-title}
  12. `GET _connector/_sync_job`
  13. [[list-connector-sync-jobs-api-prereq]]
  14. ==== {api-prereq-title}
  15. * 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.
  16. [[list-connector-sync-jobs-api-path-params]]
  17. ==== {api-path-parms-title}
  18. `size`::
  19. (Optional, integer) Maximum number of results to retrieve. Defaults to `100`.
  20. `from`::
  21. (Optional, integer) The offset from the first result to fetch. Defaults to `0`.
  22. `status`::
  23. (Optional, job status) A comma-separated list of job statuses to filter the results. Available statuses include: `canceling`, `canceled`, `completed`, `error`, `in_progress`, `pending`, `suspended`.
  24. `connector_id`::
  25. (Optional, string) The connector id the fetched sync jobs need to have.
  26. `job_type`::
  27. (Optional, job type) A comma-separated list of job types. Available job types are: `full`, `incremental` and `access_control`.
  28. [[list-connector-sync-jobs-api-example]]
  29. ==== {api-examples-title}
  30. The following example lists all connector sync jobs:
  31. [source,console]
  32. ----
  33. GET _connector/_sync_job
  34. ----
  35. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the ids of sync jobs ahead of time]
  36. The following example lists the first two connector sync jobs:
  37. [source,console]
  38. ----
  39. GET _connector/_sync_job?from=0&size=2
  40. ----
  41. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the ids of sync jobs ahead of time]
  42. The following example lists pending connector sync jobs (the first 100 per default):
  43. [source,console]
  44. ----
  45. GET _connector/_sync_job?status=pending
  46. ----
  47. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the ids of sync jobs ahead of time]
  48. The following example lists connector sync jobs (the first 100 per default) for the connector with id `connector-1`:
  49. [source,console]
  50. ----
  51. GET _connector/_sync_job?connector_id=connector-1
  52. ----
  53. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the ids of sync jobs ahead of time]
  54. The following example lists connector sync jobs (the first 100 per default) for the connector with job type `full` or `incremental`:
  55. [source,console]
  56. ----
  57. GET _connector/_sync_job?job_type=full,incremental
  58. ----
  59. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the ids of sync jobs ahead of time]
  60. [[list-connector-sync-jobs-api-response-codes]]
  61. ==== {api-response-codes-title}
  62. `200`:
  63. Indicates that results were successfully returned (results can also be empty).
  64. `400`:
  65. Indicates that the request was malformed.