-
Notifications
You must be signed in to change notification settings - Fork 99
Connector SyncJob API spec #2503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
95d7e3d
Add json spec
jedrazb 51c021d
[Connector API] Define sync job API spec
jedrazb 6a35f12
Prepare to merge with main
jedrazb 6d40597
Merge branch 'main' into add-connector-sync-job-api-spec
jedrazb 7cbe82d
Adjust types, merge with Connector API
jedrazb 952436e
Move sync job endpoints under connector namespace
jedrazb fcc4833
Address review feedback
jedrazb ba2f719
Make types in sync_job_post more specific
jedrazb 5a2cf04
Merge branch 'main' into add-connector-sync-job-api-spec
jedrazb b73b1e2
Address review feedback
jedrazb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"connector.sync_job_cancel": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html", | ||
"description": "Cancels a connector sync job." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel", | ||
"methods": ["PUT"], | ||
"parts": { | ||
"connector_sync_job_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the connector sync job to be canceled" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"connector.sync_job_delete": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html", | ||
"description": "Deletes a connector sync job." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/_sync_job/{connector_sync_job_id}", | ||
"methods": ["DELETE"], | ||
"parts": { | ||
"connector_sync_job_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the connector sync job to be deleted." | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"connector.sync_job_get": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html", | ||
"description": "Returns the details about a connector sync job." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/_sync_job/{connector_sync_job_id}", | ||
"methods": ["GET"], | ||
"parts": { | ||
"connector_sync_job_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the connector sync job to be returned." | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"connector.sync_job_list": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html", | ||
"description": "Lists all connector sync jobs." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/_sync_job", | ||
"methods": ["GET"] | ||
} | ||
] | ||
}, | ||
"params": { | ||
"from": { | ||
"type": "int", | ||
"default": 0, | ||
"description": "Starting offset (default: 0)" | ||
}, | ||
"size": { | ||
"type": "int", | ||
"default": 100, | ||
"description": "specifies a max number of results to get (default: 100)" | ||
}, | ||
"status": { | ||
"type": "string", | ||
"description": "Sync job status, which sync jobs are fetched for" | ||
}, | ||
"connector_id": { | ||
"type": "string", | ||
"description": "Id of the connector to fetch the sync jobs for" | ||
}, | ||
"job_type": { | ||
"type": "list", | ||
"description": "A comma-separated list of job types" | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"connector.sync_job_post": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html", | ||
"description": "Creates a connector sync job." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": ["application/json"], | ||
"content_type": ["application/json"] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/_sync_job", | ||
"methods": ["POST"] | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The connector sync job data.", | ||
"required": true | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* 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 { Id } from '@_types/common' | ||
import { long } from '@_types/Numeric' | ||
import { DateTime } from '@_types/Time' | ||
import { Dictionary } from '@spec_utils/Dictionary' | ||
import { UserDefinedValue } from '@spec_utils/UserDefinedValue' | ||
import { | ||
ConnectorConfiguration, | ||
FilteringConfig, | ||
IngestPipelineParams, | ||
SyncStatus | ||
} from './Connector' | ||
|
||
interface SyncJobConnectorReference { | ||
configuration: ConnectorConfiguration | ||
filtering: FilteringConfig | ||
id: Id | ||
index_name: string | ||
language?: string | ||
pipeline?: IngestPipelineParams | ||
service_type: string | ||
} | ||
|
||
export enum SyncJobType { | ||
full, | ||
incremental, | ||
access_control | ||
} | ||
|
||
export enum SyncJobTriggerMethod { | ||
on_demand, | ||
scheduled | ||
} | ||
|
||
export interface ConnectorSyncJob { | ||
cancelation_requested_at?: DateTime | ||
canceled_at?: DateTime | ||
completed_at?: DateTime | ||
connector: SyncJobConnectorReference | ||
created_at: DateTime | ||
deleted_document_count: long | ||
error?: string | ||
id: Id | ||
indexed_document_count: long | ||
indexed_document_volume: long | ||
job_type: SyncJobType | ||
last_seen?: DateTime | ||
metadata: Dictionary<string, UserDefinedValue> | ||
started_at?: DateTime | ||
status: SyncStatus | ||
total_document_count: long | ||
trigger_method: SyncJobTriggerMethod | ||
worker_hostname?: string | ||
} |
36 changes: 36 additions & 0 deletions
36
specification/connector/sync_job_cancel/SyncJobCancelRequest.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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' | ||
|
||
/** | ||
* Cancels a connector sync job. | ||
* @rest_spec_name connector.sync_job_cancel | ||
* @availability stack since=8.12.0 stability=experimental | ||
* @availability serverless stability=experimental visibility=public | ||
* @doc_id connector-sync-job-cancel | ||
*/ | ||
export interface Request extends RequestBase { | ||
path_parts: { | ||
/** | ||
* The unique identifier of the connector sync job | ||
*/ | ||
connector_sync_job_id: Id | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.