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

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