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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. [[list-connector-sync-jobs-api-request]]
  10. ==== {api-request-title}
  11. `GET _connector/_sync_job`
  12. [[list-connector-sync-jobs-api-prereq]]
  13. ==== {api-prereq-title}
  14. * 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.
  15. [[list-connector-sync-jobs-api-path-params]]
  16. ==== {api-path-parms-title}
  17. `size`::
  18. (Optional, integer) Maximum number of results to retrieve. Defaults to `100`.
  19. `from`::
  20. (Optional, integer) The offset from the first result to fetch. Defaults to `0`.
  21. `status`::
  22. (Optional, job status) The job status the fetched sync jobs need to have.
  23. `connector_id`::
  24. (Optional, string) The connector id the fetched sync jobs need to have.
  25. `job_type`::
  26. (Optional, job type) A comma-separated list of job types.
  27. [[list-connector-sync-jobs-api-example]]
  28. ==== {api-examples-title}
  29. The following example lists all connector sync jobs:
  30. [source,console]
  31. ----
  32. GET _connector/_sync_job
  33. ----
  34. // 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]
  35. The following example lists the first two connector sync jobs:
  36. [source,console]
  37. ----
  38. GET _connector/_sync_job?from=0&size=2
  39. ----
  40. // 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]
  41. The following example lists pending connector sync jobs (the first 100 per default):
  42. [source,console]
  43. ----
  44. GET _connector/_sync_job?status=pending
  45. ----
  46. // 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]
  47. The following example lists connector sync jobs (the first 100 per default) for the connector with id `connector-1`:
  48. [source,console]
  49. ----
  50. GET _connector/_sync_job?connector_id=connector-1
  51. ----
  52. // 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]
  53. The following example lists connector sync jobs (the first 100 per default) for the connector with job type `full` or `incremental`:
  54. [source,console]
  55. ----
  56. GET _connector/_sync_job?job_type=full,incremental
  57. ----
  58. // 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]
  59. [[list-connector-sync-jobs-api-response-codes]]
  60. ==== {api-response-codes-title}
  61. `200`:
  62. Indicates that results were successfully returned (results can also be empty).
  63. `400`:
  64. Indicates that the request was malformed.