Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Connector API] Implement update name/description action (#102825)
- Loading branch information
Showing
12 changed files
with
639 additions
and
35 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
rest-api-spec/src/main/resources/rest-api-spec/api/connector.update_name.json
This file contains 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,39 @@ | ||
{ | ||
"connector.update_name": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/enterprise-search/current/connectors.html", | ||
"description": "Updates the name and/or description fields in the connector document." | ||
}, | ||
"stability": "experimental", | ||
"visibility": "feature_flag", | ||
"feature_flag": "es.connector_api_feature_flag_enabled", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_connector/{connector_id}/_name", | ||
"methods": [ | ||
"PUT" | ||
], | ||
"parts": { | ||
"connector_id": { | ||
"type": "string", | ||
"description": "The unique identifier of the connector to be updated." | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "An object containing the connector's name and/or description.", | ||
"required": true | ||
} | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
...est/src/yamlRestTest/resources/rest-api-spec/test/entsearch/336_connector_update_name.yml
This file contains 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,81 @@ | ||
setup: | ||
- skip: | ||
version: " - 8.11.99" | ||
reason: Introduced in 8.12.0 | ||
|
||
- do: | ||
connector.put: | ||
connector_id: test-connector | ||
body: | ||
index_name: search-1-test | ||
name: my-connector | ||
language: pl | ||
is_native: false | ||
service_type: super-connector | ||
|
||
--- | ||
"Update Connector Name": | ||
- do: | ||
connector.update_name: | ||
connector_id: test-connector | ||
body: | ||
name: test-name | ||
|
||
|
||
- match: { result: updated } | ||
|
||
- do: | ||
connector.get: | ||
connector_id: test-connector | ||
|
||
- match: { name: test-name } | ||
|
||
--- | ||
"Update Connector Name and Description": | ||
- do: | ||
connector.update_name: | ||
connector_id: test-connector | ||
body: | ||
name: test-name | ||
description: test-description | ||
|
||
- match: { result: updated } | ||
|
||
- do: | ||
connector.get: | ||
connector_id: test-connector | ||
|
||
- match: { name: test-name } | ||
- match: { description: test-description } | ||
|
||
--- | ||
"Update Connector Scheduling - 404 when connector doesn't exist": | ||
- do: | ||
catch: "missing" | ||
connector.update_name: | ||
connector_id: test-non-existent-connector | ||
body: | ||
name: test-name | ||
description: test-description | ||
|
||
--- | ||
"Update Connector Scheduling - 400 status code when connector_id is empty": | ||
- do: | ||
catch: "bad_request" | ||
connector.update_name: | ||
connector_id: "" | ||
body: | ||
name: test-name | ||
description: test-description | ||
|
||
--- | ||
"Update Connector Scheduling - 400 status code when payload is not string": | ||
- do: | ||
catch: "bad_request" | ||
connector.update_name: | ||
connector_id: test-connector | ||
body: | ||
name: | ||
field_1: test | ||
field_2: something | ||
description: test-description |
This file contains 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 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 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
Oops, something went wrong.