Explorar o código

[Connectors API] Add set connector sync job error API docs (#103456)

Add set connector sync job error API endpoint docs.
Tim Grein hai 1 ano
pai
achega
4217a93454

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

@@ -40,9 +40,10 @@ Use the following APIs to manage sync jobs:
 * <<cancel-connector-sync-job-api>>
 * <<check-in-connector-sync-job-api>>
 * <<create-connector-sync-job-api>>
-* <<delete-connector-sync-job-api>
+* <<delete-connector-sync-job-api>>
 * <<get-connector-sync-job-api>>
 * <<list-connector-sync-jobs-api>>
+* <<set-connector-sync-job-error-api>>
 
 
 include::cancel-connector-sync-job-api.asciidoc[]
@@ -55,3 +56,4 @@ include::get-connector-api.asciidoc[]
 include::get-connector-sync-job-api.asciidoc[]
 include::list-connectors-api.asciidoc[]
 include::list-connector-sync-jobs-api.asciidoc[]
+include::set-connector-sync-job-error-api.asciidoc[]

+ 58 - 0
docs/reference/connector/apis/set-connector-sync-job-error-api.asciidoc

@@ -0,0 +1,58 @@
+[[set-connector-sync-job-error-api]]
+=== Set connector sync job error API
+++++
+<titleabbrev>Set connector sync job error</titleabbrev>
+++++
+
+Sets a connector sync job error.
+
+[[set-connector-sync-job-error-api-request]]
+==== {api-request-title}
+`PUT _connector/_sync_job/<connector_sync_job_id>/_error`
+
+[[set-connector-sync-job-error-api-prereqs]]
+==== {api-prereq-title}
+
+* To sync data using connectors, it's essential to have the Elastic connectors service running.
+* The `connector_sync_job_id` parameter should reference an existing connector sync job.
+
+[[set-connector-sync-job-error-api-desc]]
+==== {api-description-title}
+
+Sets the `error` field for the specified connector sync job and sets its `status` to `error`.
+
+[[set-connector-sync-job-error-api-path-params]]
+==== {api-path-parms-title}
+
+`<connector_sync_job_id>`::
+(Required, string)
+
+[role="child_attributes"]
+[[set-connector-sync-job-error-api-request-body]]
+==== {api-request-body-title}
+
+`error`::
+(Required, string) The error to set the connector sync job `error` field to.
+
+[[set-connector-sync-job-api-response-codes]]
+==== {api-response-codes-title}
+
+`200`::
+Indicates that the connector sync job error was set successfully.
+
+`404`::
+No connector sync job matching `connector_sync_job_id` could be found.
+
+[[set-connector-sync-job-error-api-example]]
+==== {api-examples-title}
+
+The following example sets the error `some-error` in the connector sync job `my-connector-sync-job`:
+
+[source,console]
+----
+PUT _connector/_sync_job/my-connector-sync-job/_error
+{
+    "error": "some-error"
+}
+----
+// TEST[skip:there's no way to clean up after creating a connector sync job, as we don't know the id ahead of time. Therefore, skip this test.]