mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
# Backport This will backport the following commits from `main` to `8.10`: - [[Enterprise Search] Update config template for self managed connectors. (#164854)](https://github.com/elastic/kibana/pull/164854) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Efe Gürkan YALAMAN","email":"efeguerkan.yalaman@elastic.co"},"sourceCommit":{"committedDate":"2023-08-25T17:06:01Z","message":"[Enterprise Search] Update config template for self managed connectors. (#164854)\n\n## Summary\r\n\r\n\r\n\r\ne9e1dfb3
-1acd-4255-9abf-b9b58f1a060a","sha":"7e4b67e2390ff0d2637b10153c049da73ee6ab34","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","ci:cloud-deploy","v8.10.0","v8.11.0"],"number":164854,"url":"https://github.com/elastic/kibana/pull/164854","mergeCommit":{"message":"[Enterprise Search] Update config template for self managed connectors. (#164854)\n\n## Summary\r\n\r\n\r\n\r\ne9e1dfb3
-1acd-4255-9abf-b9b58f1a060a","sha":"7e4b67e2390ff0d2637b10153c049da73ee6ab34"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164854","number":164854,"mergeCommit":{"message":"[Enterprise Search] Update config template for self managed connectors. (#164854)\n\n## Summary\r\n\r\n\r\n\r\ne9e1dfb3
-1acd-4255-9abf-b9b58f1a060a","sha":"7e4b67e2390ff0d2637b10153c049da73ee6ab34"}}]}] BACKPORT--> Co-authored-by: Efe Gürkan YALAMAN <efeguerkan.yalaman@elastic.co>
This commit is contained in:
parent
63d021f7d0
commit
4f85aa3cdc
3 changed files with 42 additions and 11 deletions
|
@ -8,7 +8,7 @@
|
|||
import { createApiLogic } from '../../../shared/api_logic/create_api_logic';
|
||||
import { HttpLogic } from '../../../shared/http';
|
||||
|
||||
interface ApiKey {
|
||||
export interface ApiKey {
|
||||
api_key: string;
|
||||
encoded: string;
|
||||
id: string;
|
||||
|
|
|
@ -28,6 +28,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
|
|||
|
||||
import { ConnectorStatus } from '../../../../../../common/types/connectors';
|
||||
import { BetaConnectorCallout } from '../../../../shared/beta/beta_connector_callout';
|
||||
import { useCloudDetails } from '../../../../shared/cloud_details/cloud_details';
|
||||
import { docLinks } from '../../../../shared/doc_links';
|
||||
import { generateEncodedPath } from '../../../../shared/encode_path_params';
|
||||
import { EuiButtonTo, EuiLinkTo } from '../../../../shared/react_router_helpers';
|
||||
|
@ -45,7 +46,7 @@ import { SearchIndexTabId } from '../search_index';
|
|||
import { ApiKeyConfig } from './api_key_configuration';
|
||||
import { ConnectorConfigurationConfig } from './connector_configuration_config';
|
||||
import { ConnectorNameAndDescription } from './connector_name_and_description/connector_name_and_description';
|
||||
import { BETA_CONNECTORS, CONNECTORS } from './constants';
|
||||
import { BETA_CONNECTORS, CONNECTORS, getConnectorTemplate } from './constants';
|
||||
import { NativeConnectorConfiguration } from './native_connector_configuration/native_connector_configuration';
|
||||
|
||||
export const ConnectorConfiguration: React.FC = () => {
|
||||
|
@ -53,6 +54,8 @@ export const ConnectorConfiguration: React.FC = () => {
|
|||
const { index, recheckIndexLoading } = useValues(IndexViewLogic);
|
||||
const { indexName } = useValues(IndexNameLogic);
|
||||
const { recheckIndex } = useActions(IndexViewLogic);
|
||||
const cloudContext = useCloudDetails();
|
||||
|
||||
if (!isConnectorIndex(index)) {
|
||||
return <></>;
|
||||
}
|
||||
|
@ -151,15 +154,14 @@ export const ConnectorConfiguration: React.FC = () => {
|
|||
</EuiText>
|
||||
<EuiSpacer />
|
||||
<EuiCodeBlock fontSize="m" paddingSize="m" color="dark" isCopyable>
|
||||
{`connectors:
|
||||
-
|
||||
connector_id: "${index.connector.id}"
|
||||
service_type: "${index.connector.service_type || 'changeme'}"${
|
||||
apiKeyData?.encoded
|
||||
? `
|
||||
api_key: "${apiKeyData?.encoded}"`
|
||||
: ''
|
||||
}`}
|
||||
{getConnectorTemplate({
|
||||
apiKeyData,
|
||||
connectorData: {
|
||||
id: index.connector.id,
|
||||
service_type: index.connector.service_type,
|
||||
},
|
||||
host: cloudContext.elasticsearchUrl,
|
||||
})}
|
||||
</EuiCodeBlock>
|
||||
<EuiSpacer />
|
||||
<EuiText size="s">
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import dedent from 'dedent';
|
||||
|
||||
import { CONNECTOR_DEFINITIONS } from '../../../../../../common/connectors/connectors';
|
||||
|
||||
import { docLinks } from '../../../../shared/doc_links';
|
||||
import { CONNECTOR_ICONS } from '../../../../shared/icons/connector_icons';
|
||||
import { ApiKey } from '../../../api/connector/generate_connector_api_key_api_logic';
|
||||
|
||||
import { ConnectorClientSideDefinition } from './types';
|
||||
|
||||
|
@ -163,3 +166,29 @@ export const CUSTOM_CONNECTORS = CONNECTORS.filter(({ isNative }) => !isNative);
|
|||
export const NATIVE_CONNECTORS = CONNECTORS.filter(({ isNative }) => isNative);
|
||||
|
||||
export const BETA_CONNECTORS = CONNECTORS.filter(({ isBeta }) => isBeta);
|
||||
|
||||
export const getConnectorTemplate = ({
|
||||
apiKeyData,
|
||||
connectorData,
|
||||
host,
|
||||
}: {
|
||||
apiKeyData: ApiKey | undefined;
|
||||
connectorData: {
|
||||
id: string;
|
||||
service_type: string | null;
|
||||
};
|
||||
host?: string;
|
||||
}) => dedent`connectors:
|
||||
-
|
||||
connector_id: "${connectorData.id}"
|
||||
service_type: "${connectorData.service_type || 'changeme'}"${
|
||||
apiKeyData?.encoded
|
||||
? `
|
||||
api_key: "${apiKeyData?.encoded}"`
|
||||
: ''
|
||||
}
|
||||
|
||||
elasticsearch:
|
||||
host: "${host || 'https://locahost:9200'}"
|
||||
api_key: "${apiKeyData?.encoded || ''}"
|
||||
`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue