From fe5464914342c730c01ebaa1586194508b34f2f9 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 19 Dec 2024 10:09:01 -0800 Subject: [PATCH] Add specification for set connector sync job error (#3367) (cherry picked from commit 3d46d13b1e0b6b15167f68ccedb40ae85278503a) --- output/openapi/elasticsearch-openapi.json | 55 +++++++++++++ output/schema/schema.json | 77 ++++++++++++++++++- output/schema/validation-errors.json | 6 -- output/typescript/types.ts | 10 +++ specification/_doc_ids/table.csv | 1 + .../sync_job_error/SyncJobErrorRequest.ts | 46 +++++++++++ .../sync_job_error/SyncJobErrorResponse.ts | 22 ++++++ 7 files changed, 207 insertions(+), 10 deletions(-) create mode 100644 specification/connector/sync_job_error/SyncJobErrorRequest.ts create mode 100644 specification/connector/sync_job_error/SyncJobErrorResponse.ts diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index ad01a3aba5..51dd1e2a9d 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -5099,6 +5099,61 @@ "x-beta": true } }, + "/_connector/_sync_job/{connector_sync_job_id}/_error": { + "put": { + "tags": [ + "connector" + ], + "summary": "Set a connector sync job error", + "description": "Set the `error` field for a connector sync job and set its `status` to `error`.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors.", + "operationId": "connector-sync-job-error", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier for the connector sync job.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "error": { + "description": "The error for the connector sync job error field.", + "type": "string" + } + }, + "required": [ + "error" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "x-state": "Technical preview" + } + }, "/_connector/_sync_job": { "get": { "tags": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 109b4851ee..2e418b2b45 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -3425,15 +3425,22 @@ "visibility": "public" } }, - "description": "Sets an error for a connector sync job.", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/set-connector-sync-job-error-api.html", + "description": "Set a connector sync job error.\nSet the `error` field for a connector sync job and set its `status` to `error`.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors.", + "docId": "connector-sync-job-error", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/set-connector-sync-job-error-api.html", "name": "connector.sync_job_error", - "request": null, + "request": { + "name": "Request", + "namespace": "connector.sync_job_error" + }, "requestBodyRequired": true, "requestMediaType": [ "application/json" ], - "response": null, + "response": { + "name": "Response", + "namespace": "connector.sync_job_error" + }, "responseMediaType": [ "application/json" ], @@ -115531,6 +115538,68 @@ }, "specLocation": "connector/sync_job_delete/SyncJobDeleteResponse.ts#L22-L24" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "The error for the connector sync job error field.", + "name": "error", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "description": "Set a connector sync job error.\nSet the `error` field for a connector sync job and set its `status` to `error`.\n\nTo sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure.\nThis service runs automatically on Elastic Cloud for Elastic managed connectors.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "connector.sync_job_error" + }, + "path": [ + { + "description": "The unique identifier for the connector sync job.", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "connector/sync_job_error/SyncJobErrorRequest.ts#L23-L46" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [] + }, + "name": { + "name": "Response", + "namespace": "connector.sync_job_error" + }, + "specLocation": "connector/sync_job_error/SyncJobErrorResponse.ts#L20-L22" + }, { "kind": "request", "attachedBehaviors": [ diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index accb875a02..4b30c5e771 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -355,12 +355,6 @@ ], "response": [] }, - "connector.sync_job_error": { - "request": [ - "Missing request & response" - ], - "response": [] - }, "connector.sync_job_update_stats": { "request": [ "Missing request & response" diff --git a/output/typescript/types.ts b/output/typescript/types.ts index c6ec92354f..e7b7d9c566 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10020,6 +10020,16 @@ export interface ConnectorSyncJobDeleteRequest extends RequestBase { export type ConnectorSyncJobDeleteResponse = AcknowledgedResponseBase +export interface ConnectorSyncJobErrorRequest extends RequestBase { + connector_sync_job_id: Id + body?: { + error: string + } +} + +export interface ConnectorSyncJobErrorResponse { +} + export interface ConnectorSyncJobGetRequest extends RequestBase { connector_sync_job_id: Id } diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 77833ef176..f6a72b8fd7 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -88,6 +88,7 @@ community-id-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{ connector-sync-job-cancel,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html connector-sync-job-checkin,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/check-in-connector-sync-job-api.html connector-sync-job-claim,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/claim-connector-sync-job-api.html +connector-sync-job-error,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/set-connector-sync-job-error-api.html collapse-search-results,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/collapse-search-results.html connector-sync-job-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html connector-sync-job-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html diff --git a/specification/connector/sync_job_error/SyncJobErrorRequest.ts b/specification/connector/sync_job_error/SyncJobErrorRequest.ts new file mode 100644 index 0000000000..7ee6ff67dc --- /dev/null +++ b/specification/connector/sync_job_error/SyncJobErrorRequest.ts @@ -0,0 +1,46 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' + +/** + * Set a connector sync job error. + * Set the `error` field for a connector sync job and set its `status` to `error`. + * + * To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + * This service runs automatically on Elastic Cloud for Elastic managed connectors. + * @rest_spec_name connector.sync_job_error + * @availability stack stability=experimental visibility=public + * @doc_id connector-sync-job-error + */ +export interface Request extends RequestBase { + path_parts: { + /** + * The unique identifier for the connector sync job. + */ + connector_sync_job_id: Id + } + body: { + /** + * The error for the connector sync job error field. + */ + error: string + } +} diff --git a/specification/connector/sync_job_error/SyncJobErrorResponse.ts b/specification/connector/sync_job_error/SyncJobErrorResponse.ts new file mode 100644 index 0000000000..0769bf66cb --- /dev/null +++ b/specification/connector/sync_job_error/SyncJobErrorResponse.ts @@ -0,0 +1,22 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export class Response { + body: {} +}