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

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