forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] Add delete connector endpoint through new _connectors api (e…
…lastic#175249) ## Summary Add Delete connector modal https://github.com/elastic/kibana/assets/1410658/16838df7-9614-40b2-a768-ad9de0393d49 ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
- Loading branch information
Showing
7 changed files
with
530 additions
and
147 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
x-pack/plugins/enterprise_search/common/types/connectors.ts
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,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export interface DeleteConnectorResponse { | ||
acknowledge: boolean; | ||
} |
44 changes: 44 additions & 0 deletions
44
...public/applications/enterprise_search_content/api/connector/delete_connector_api_logic.ts
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,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { DeleteConnectorResponse } from '../../../../../common/types/connectors'; | ||
|
||
import { Actions, createApiLogic } from '../../../shared/api_logic/create_api_logic'; | ||
import { HttpLogic } from '../../../shared/http'; | ||
|
||
export interface DeleteConnectorApiLogicArgs { | ||
connectorId: string; | ||
shouldDeleteIndex: boolean; | ||
} | ||
|
||
export interface DeleteConnectorApiLogicResponse { | ||
acknowledged: boolean; | ||
} | ||
|
||
export const deleteConnector = async ({ | ||
connectorId, | ||
shouldDeleteIndex = false, | ||
}: DeleteConnectorApiLogicArgs) => { | ||
return await HttpLogic.values.http.delete( | ||
`/internal/enterprise_search/connectors/${connectorId}`, | ||
{ | ||
query: { | ||
shouldDeleteIndex, | ||
}, | ||
} | ||
); | ||
}; | ||
|
||
export const DeleteConnectorApiLogic = createApiLogic( | ||
['delete_connector_api_logic'], | ||
deleteConnector | ||
); | ||
|
||
export type DeleteConnectorApiLogicActions = Actions< | ||
DeleteConnectorApiLogicArgs, | ||
DeleteConnectorResponse | ||
>; |
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.