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

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