create-connector-sync-job-api.asciidoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. [[create-connector-sync-job-api]]
  2. === Create connector sync job API
  3. ++++
  4. <titleabbrev>Create connector sync job</titleabbrev>
  5. ++++
  6. Creates a connector sync job.
  7. [source, console]
  8. --------------------------------------------------
  9. POST _connector/_sync_job
  10. {
  11. "id": "connector-id",
  12. "job_type": "full",
  13. "trigger_method": "on_demand"
  14. }
  15. --------------------------------------------------
  16. // TEST[skip:there's no way to clean up after this code snippet, as we don't know the id ahead of time]
  17. [[create-connector-sync-job-api-request]]
  18. ==== {api-request-title}
  19. `POST _connector/_sync_job`
  20. [[create-connector-sync-job-api-prereqs]]
  21. ==== {api-prereq-title}
  22. * To sync data using connectors, it's essential to have the Elastic connectors service running.
  23. * The `id` parameter should reference an existing connector.
  24. [[create-connector-sync-job-api-desc]]
  25. ==== {api-description-title}
  26. Creates a connector sync job document in the internal index and initializes its counters and timestamps with default values.
  27. Certain values can be updated via the API.
  28. [role="child_attributes"]
  29. [[create-connector-sync-job-api-request-body]]
  30. ==== {api-request-body-title}
  31. `id`::
  32. (Required, string) The id of the connector to create the sync job for.
  33. `job_type`::
  34. (Optional, string) The job type of the created sync job. Defaults to `full`.
  35. `trigger_method`::
  36. (Optional, string) The trigger method of the created sync job. Defaults to `on_demand`.
  37. [role="child_attributes"]
  38. [[create-connector-sync-job-api-response-body]]
  39. ==== {api-response-body-title}
  40. `id`::
  41. (string) The ID associated with the connector sync job document.
  42. [[create-connector-sync-job-api-response-codes]]
  43. ==== {api-response-codes-title}
  44. `201`::
  45. Indicates that the connector sync job was created successfully.
  46. `400`::
  47. Indicates that the request was malformed.
  48. `404`::
  49. Indicates that either the index or the referenced connector is missing.