瀏覽代碼

[Connectors API] Add create connector sync job docs (#103275)

Adds documentation for the create connector sync job API endpoint.
Tim Grein 1 年之前
父節點
當前提交
16a4d00999

+ 3 - 0
docs/reference/connector/apis/connector-apis.asciidoc

@@ -36,8 +36,11 @@ You can use these APIs to create, cancel, delete and update sync jobs.
 
 Use the following APIs to manage sync jobs:
 
+* <<create-connector-sync-job-api>>
+
 
 include::create-connector-api.asciidoc[]
+include::create-connector-sync-job-api.asciidoc[]
 include::delete-connector-api.asciidoc[]
 include::get-connector-api.asciidoc[]
 include::list-connectors-api.asciidoc[]

+ 69 - 0
docs/reference/connector/apis/create-connector-sync-job-api.asciidoc

@@ -0,0 +1,69 @@
+[[create-connector-sync-job-api]]
+=== Create connector sync job API
+++++
+<titleabbrev>Create connector sync job</titleabbrev>
+++++
+
+Creates a connector sync job.
+
+[source, console]
+--------------------------------------------------
+POST _connector/_sync_job
+{
+  "id": "connector-id",
+  "job_type": "full",
+  "trigger_method": "on_demand"
+}
+--------------------------------------------------
+// TEST[skip:there's no way to clean up after this code snippet, as we don't know the id ahead of time]
+
+
+[[create-connector-sync-job-api-request]]
+==== {api-request-title}
+`POST _connector/_sync_job`
+
+
+[[create-connector-sync-job-api-prereqs]]
+==== {api-prereq-title}
+
+* To sync data using connectors, it's essential to have the Elastic connectors service running.
+* The `id` parameter should reference an existing connector.
+
+[[create-connector-sync-job-api-desc]]
+==== {api-description-title}
+
+Creates a connector sync job document in the internal index and initializes its counters and timestamps with default values.
+Certain values can be updated via the API.
+
+[role="child_attributes"]
+[[create-connector-sync-job-api-request-body]]
+==== {api-request-body-title}
+
+`id`::
+(Required, string) The id of the connector to create the sync job for.
+
+`job_type`::
+(Optional, string) The job type of the created sync job. Defaults to `full`.
+
+`trigger_method`::
+(Optional, string) The trigger method of the created sync job. Defaults to `on_demand`.
+
+
+[role="child_attributes"]
+[[create-connector-sync-job-api-response-body]]
+==== {api-response-body-title}
+
+`id`::
+(string) The ID associated with the connector sync job document.
+
+[[create-connector-sync-job-api-response-codes]]
+==== {api-response-codes-title}
+
+`201`::
+Indicates that the connector sync job was created successfully.
+
+`400`::
+Indicates that the request was malformed.
+
+`404`::
+Indicates that either the index or the referenced connector is missing.