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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. .New API reference
  9. [sidebar]
  10. --
  11. For the most up-to-date API details, refer to {api-es}/group/endpoint-connector[Connector APIs].
  12. --
  13. Returns information about all stored connector sync jobs ordered by their creation date in ascending order.
  14. To get started with Connector APIs, check out <<es-connectors-tutorial-api, our tutorial>>.
  15. [[list-connector-sync-jobs-api-request]]
  16. ==== {api-request-title}
  17. `GET _connector/_sync_job`
  18. [[list-connector-sync-jobs-api-prereq]]
  19. ==== {api-prereq-title}
  20. * 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.
  21. [[list-connector-sync-jobs-api-path-params]]
  22. ==== {api-path-parms-title}
  23. `size`::
  24. (Optional, integer) Maximum number of results to retrieve. Defaults to `100`.
  25. `from`::
  26. (Optional, integer) The offset from the first result to fetch. Defaults to `0`.
  27. `status`::
  28. (Optional, job status) A job status to filter the results for. Available statuses include: `canceling`, `canceled`, `completed`, `error`, `in_progress`, `pending`, `suspended`.
  29. `connector_id`::
  30. (Optional, string) The connector id the fetched sync jobs need to have.
  31. `job_type`::
  32. (Optional, job type) A comma-separated list of job types. Available job types are: `full`, `incremental` and `access_control`.
  33. [[list-connector-sync-jobs-api-example]]
  34. ==== {api-examples-title}
  35. The following example lists all connector sync jobs:
  36. [source,console]
  37. ----
  38. GET _connector/_sync_job
  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 the first two connector sync jobs:
  42. [source,console]
  43. ----
  44. GET _connector/_sync_job?from=0&size=2
  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 pending connector sync jobs (the first 100 per default):
  48. [source,console]
  49. ----
  50. GET _connector/_sync_job?status=pending
  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 id `connector-1`:
  54. [source,console]
  55. ----
  56. GET _connector/_sync_job?connector_id=connector-1
  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. The following example lists connector sync jobs (the first 100 per default) for the connector with job type `full` or `incremental`:
  60. [source,console]
  61. ----
  62. GET _connector/_sync_job?job_type=full,incremental
  63. ----
  64. // 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]
  65. [[list-connector-sync-jobs-api-response-codes]]
  66. ==== {api-response-codes-title}
  67. `200`:
  68. Indicates that results were successfully returned (results can also be empty).
  69. `400`:
  70. Indicates that the request was malformed.