Use new logstash, addData, logging, ingest URLs (#219286)

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
This commit is contained in:
Lisa Cawley 2025-05-09 18:51:52 -07:00 committed by GitHub
parent 437a9fa4f3
commit b0a841c421
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1015 additions and 977 deletions

View file

@ -113,7 +113,7 @@ tags:
> Do not directly access the `.logstash` index. The structure of the `.logstash` index is subject to change, which could cause your integration to break. Instead, use the Logstash configuration management APIs.
externalDocs:
description: Centralized pipeline management
url: https://www.elastic.co/guide/en/logstash/current/logstash-centralized-pipeline-management.html
url: https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management
name: logstash
x-displayName: Logstash configuration management
- name: Message Signing Service
@ -44064,7 +44064,7 @@ paths:
If your Elasticsearch cluster is protected with basic authentication, you must have either the `logstash_admin` built-in role or a customized Logstash writer role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: delete-logstash-pipeline
parameters:
- description: An identifier for the pipeline.
@ -44086,7 +44086,7 @@ paths:
To use this API, you must have either the `logstash_admin` built-in role or a customized Logstash reader role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: get-logstash-pipeline
parameters:
- description: An identifier for the pipeline.
@ -44124,7 +44124,7 @@ paths:
To use this API, you must have either the `logstash_admin` built-in role or a customized Logstash writer role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: put-logstash-pipeline
parameters:
- description: |
@ -44189,7 +44189,7 @@ paths:
The `username` property appears in the response when security is enabled and depends on when the pipeline was created or last updated.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: get-logstash-pipelines
responses:
'200':

View file

@ -149,7 +149,7 @@ describe('#registerApiDeprecationsInfo', () => {
"message": Array [
"The API \\"GET /api/test_removed/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
Object {
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
"This issue has been marked as resolved on Thursday, October 17, 2024 8:06 AM -04:00 but the API has been called 12 times since.",
@ -200,7 +200,7 @@ describe('#registerApiDeprecationsInfo', () => {
"message": Array [
"The API \\"GET /api/test_migrated/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
Object {
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
"This issue has been marked as resolved on Thursday, October 17, 2024 8:06 AM -04:00 but the API has been called 12 times since.",
@ -249,7 +249,7 @@ describe('#registerApiDeprecationsInfo', () => {
"message": Array [
"The API \\"GET /api/test_bumped/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
Object {
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
"This issue has been marked as resolved on Thursday, October 17, 2024 8:06 AM -04:00 but the API has been called 12 times since.",
@ -297,7 +297,7 @@ describe('#registerApiDeprecationsInfo', () => {
"message": Array [
"The API \\"GET /api/test_deprecated/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
Object {
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
"This issue has been marked as resolved on Thursday, October 17, 2024 8:06 AM -04:00 but the API has been called 12 times since.",
@ -364,7 +364,7 @@ describe('#registerApiDeprecationsInfo', () => {
"message": Array [
"The API \\"GET /api/test_never_resolved/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
Object {
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information about deprecated API calls in debug logs, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
],
@ -413,7 +413,7 @@ describe('#registerApiDeprecationsInfo', () => {
"The API \\"POST /internal/api/\\" has been called 13 times. The last call was on Sunday, September 1, 2024 6:06 AM -04:00.",
"Internal APIs are meant to be used by Elastic services only. You should not use them. External access to these APIs will be restricted.",
Object {
"content": "To include information in debug logs about calls to APIs that are internal to Elastic, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/guide/en/kibana/test-branch/logging-settings.html#enable-http-debug-logs).",
"content": "To include information in debug logs about calls to APIs that are internal to Elastic, edit your Kibana configuration as detailed in [the documentation](https://www.elastic.co/docs/reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs).",
"type": "markdown",
},
],

View file

@ -20,7 +20,6 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
const meta = getDocLinksMeta({ kibanaBranch, buildFlavor });
const DOC_LINK_VERSION = meta.version;
const ECS_VERSION = meta.ecs_version;
const ELASTIC_WEBSITE_URL = meta.elasticWebsiteUrl;
const ELASTIC_GITHUB = meta.elasticGithubUrl;
const SEARCH_LABS_URL = meta.searchLabsUrl;
@ -36,7 +35,6 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
const SECURITY_SOLUTION_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/security/${DOC_LINK_VERSION}/`;
const ENTERPRISE_SEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/enterprise-search/${DOC_LINK_VERSION}/`;
const ESRE_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/esre/${DOC_LINK_VERSION}/`;
const SERVERLESS_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/serverless/current/`;
const SEARCH_LABS_REPO = `${ELASTIC_GITHUB}elasticsearch-labs/`;
const isServerless = buildFlavor === 'serverless';
@ -210,8 +208,8 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
getStarted: `${ELASTIC_DOCS}reference/beats`,
},
logstash: {
base: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}`,
inputElasticAgent: `${ELASTIC_WEBSITE_URL}guide/en/logstash/${DOC_LINK_VERSION}/plugins-inputs-elastic_agent.html`,
base: `${ELASTIC_DOCS}reference/logstash`,
inputElasticAgent: `${ELASTIC_DOCS}reference/logstash/plugins/plugins-inputs-elastic_agent`,
},
winlogbeat: {
base: `${ELASTIC_DOCS}reference/beats/winlogbeat`,
@ -279,7 +277,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
runtimeFields: `${ELASTIC_DOCS}explore-analyze/find-and-organize/data-views#runtime-fields`,
migrateOffScriptedFields: `${ELASTIC_DOCS}explore-analyze/find-and-organize/data-views#migrate-off-scripted-fields`,
},
addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`,
addData: `${ELASTIC_DOCS}manage-data/ingest`,
kibana: {
askElastic: `${ELASTIC_WEBSITE_URL}products/kibana/ask-elastic?blade=kibanaaskelastic`,
createGithubIssue: `${ELASTIC_GITHUB}kibana/issues/new/choose`,
@ -430,7 +428,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
publicBaseUrl: `${ELASTIC_DOCS}reference/kibana/configuration-reference/general-settings#server-publicBaseUrl`,
},
logging: {
enableDeprecationHttpDebugLogs: `${KIBANA_DOCS}logging-settings.html#enable-http-debug-logs`,
enableDeprecationHttpDebugLogs: `${ELASTIC_DOCS}reference/kibana/configuration-reference/logging-settings#enable-http-debug-logs`,
},
securitySolution: {
artifactControl: `${ELASTIC_DOCS}solutions/security/configure-elastic-defend/configure-updates-for-protection-artifacts`,
@ -779,60 +777,66 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
slmStart: `${ELASTICSEARCH_APIS}operation/operation-slm-start`,
},
ingest: {
append: `${ELASTICSEARCH_DOCS}append-processor.html`,
attachment: `${ELASTIC_DOCS}reference/enrich-processor/attachment`,
bytes: `${ELASTICSEARCH_DOCS}bytes-processor.html`,
circle: `${ELASTICSEARCH_DOCS}ingest-circle-processor.html`,
convert: `${ELASTICSEARCH_DOCS}convert-processor.html`,
csv: `${ELASTICSEARCH_DOCS}csv-processor.html`,
date: `${ELASTICSEARCH_DOCS}date-processor.html`,
dateIndexName: `${ELASTICSEARCH_DOCS}date-index-name-processor.html`,
dissect: `${ELASTICSEARCH_DOCS}dissect-processor.html`,
dissectKeyModifiers: `${ELASTICSEARCH_DOCS}dissect-processor.html#dissect-key-modifiers`,
dotExpander: `${ELASTICSEARCH_DOCS}dot-expand-processor.html`,
drop: `${ELASTICSEARCH_DOCS}drop-processor.html`,
enrich: `${ELASTICSEARCH_DOCS}ingest-enriching-data.html`,
fail: `${ELASTICSEARCH_DOCS}fail-processor.html`,
foreach: `${ELASTICSEARCH_DOCS}foreach-processor.html`,
geoIp: `${ELASTICSEARCH_DOCS}geoip-processor.html`,
geoMatch: `${ELASTICSEARCH_DOCS}geo-match-enrich-policy-type.html`,
grok: `${ELASTICSEARCH_DOCS}grok-processor.html`,
gsub: `${ELASTICSEARCH_DOCS}gsub-processor.html`,
htmlString: `${ELASTICSEARCH_DOCS}htmlstrip-processor.html`,
inference: `${ELASTICSEARCH_DOCS}inference-processor.html`,
inferenceClassification: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-classification-opt`,
inferenceRegression: `${ELASTICSEARCH_DOCS}inference-processor.html#inference-processor-regression-opt`,
join: `${ELASTICSEARCH_DOCS}join-processor.html`,
json: `${ELASTICSEARCH_DOCS}json-processor.html`,
kv: `${ELASTICSEARCH_DOCS}kv-processor.html`,
lowercase: `${ELASTICSEARCH_DOCS}lowercase-processor.html`,
pipeline: `${ELASTICSEARCH_DOCS}pipeline-processor.html`,
pipelines: isServerless
? `${SERVERLESS_DOCS}ingest-pipelines.html`
: `${ELASTICSEARCH_DOCS}ingest.html`,
csvPipelines: `${ELASTIC_WEBSITE_URL}guide/en/ecs/${ECS_VERSION}/ecs-converting.html`,
pipelineFailure: `${ELASTICSEARCH_DOCS}ingest.html#handling-pipeline-failures`,
processors: `${ELASTICSEARCH_DOCS}processors.html`,
arrayOrJson: `${ELASTICSEARCH_DOCS}processors.html#ingest-process-category-array-json-handling`,
dataEnrichment: `${ELASTICSEARCH_DOCS}processors.html#ingest-process-category-data-enrichment`,
dataFiltering: `${ELASTICSEARCH_DOCS}processors.html#ingest-process-category-data-filtering`,
dataTransformation: `${ELASTICSEARCH_DOCS}processors.html#ingest-process-category-data-transformation`,
pipelineHandling: `${ELASTICSEARCH_DOCS}processors.html#ingest-process-category-pipeline-handling`,
remove: `${ELASTICSEARCH_DOCS}remove-processor.html`,
rename: `${ELASTICSEARCH_DOCS}rename-processor.html`,
script: `${ELASTICSEARCH_DOCS}script-processor.html`,
set: `${ELASTICSEARCH_DOCS}set-processor.html`,
setSecurityUser: `${ELASTICSEARCH_DOCS}ingest-node-set-security-user-processor.html`,
sort: `${ELASTICSEARCH_DOCS}sort-processor.html`,
split: `${ELASTICSEARCH_DOCS}split-processor.html`,
trim: `${ELASTICSEARCH_DOCS}trim-processor.html`,
uppercase: `${ELASTICSEARCH_DOCS}uppercase-processor.html`,
uriParts: `${ELASTICSEARCH_DOCS}uri-parts-processor.html`,
urlDecode: `${ELASTICSEARCH_DOCS}urldecode-processor.html`,
userAgent: `${ELASTICSEARCH_DOCS}user-agent-processor.html`,
append: `${ELASTIC_DOCS}reference/enrich-processor/append-processor`,
bytes: `${ELASTIC_DOCS}reference/enrich-processor/bytes-processor`,
circle: `${ELASTIC_DOCS}reference/enrich-processor/ingest-circle-processor`,
community: `${ELASTIC_DOCS}reference/enrich-processor/community-id-processor`,
convert: `${ELASTIC_DOCS}reference/enrich-processor/convert-processor`,
csv: `${ELASTIC_DOCS}reference/enrich-processor/csv-processor`,
date: `${ELASTIC_DOCS}reference/enrich-processor/date-processor`,
dateIndexName: `${ELASTIC_DOCS}reference/enrich-processor/date-index-name-processor`,
dissect: `${ELASTIC_DOCS}reference/enrich-processor/dissect-processor`,
dissectKeyModifiers: `${ELASTIC_DOCS}reference/enrich-processor/dissect-processor#dissect-key-modifiers`,
dotExpander: `${ELASTIC_DOCS}reference/enrich-processor/dot-expand-processor`,
drop: `${ELASTIC_DOCS}reference/enrich-processor/drop-processor`,
enrich: `${ELASTIC_DOCS}manage-data/ingest/transform-enrich/data-enrichment`,
fail: `${ELASTIC_DOCS}reference/enrich-processor/fail-processor`,
foreach: `${ELASTIC_DOCS}reference/enrich-processor/foreach-processor`,
geoGrid: `${ELASTIC_DOCS}reference/enrich-processor/ingest-geo-grid-processor`,
geoIp: `${ELASTIC_DOCS}reference/enrich-processor/geoip-processor`,
geoMatch: `${ELASTIC_DOCS}manage-data/ingest/transform-enrich/example-enrich-data-based-on-geolocation`,
grok: `${ELASTIC_DOCS}reference/enrich-processor/grok-processor`,
gsub: `${ELASTIC_DOCS}reference/enrich-processor/gsub-processor`,
htmlString: `${ELASTIC_DOCS}reference/enrich-processor/htmlstrip-processor`,
inference: `${ELASTIC_DOCS}reference/enrich-processor/inference-processor`,
inferenceClassification: `${ELASTIC_DOCS}reference/enrich-processor/inference-processor#inference-processor-classification-opt`,
inferenceRegression: `${ELASTIC_DOCS}reference/enrich-processor/inference-processor#inference-processor-regression-opt`,
ipLocation: `${ELASTIC_DOCS}reference/enrich-processor/ip-location-processor`,
join: `${ELASTIC_DOCS}reference/enrich-processor/join-processor`,
json: `${ELASTIC_DOCS}reference/enrich-processor/json-processor`,
kv: `${ELASTIC_DOCS}reference/enrich-processor/kv-processor`,
lowercase: `${ELASTIC_DOCS}reference/enrich-processor/lowercase-processor`,
network: `${ELASTIC_DOCS}reference/enrich-processor/network-direction-processor`,
pipeline: `${ELASTIC_DOCS}reference/enrich-processor/pipeline-processor`,
pipelines: `${ELASTIC_DOCS}manage-data/ingest/transform-enrich/ingest-pipelines`,
csvPipelines: `${ELASTIC_DOCS}reference/ecs/ecs-converting`,
pipelineFailure: `${ELASTIC_DOCS}manage-data/ingest/transform-enrich/ingest-pipelines#handling-pipeline-failures`,
processors: `${ELASTIC_DOCS}reference/enrich-processor`,
arrayOrJson: `${ELASTIC_DOCS}reference/enrich-processor#ingest-process-category-array-json-handling`,
dataEnrichment: `${ELASTIC_DOCS}reference/enrich-processor#ingest-process-category-data-enrichment`,
dataFiltering: `${ELASTIC_DOCS}reference/enrich-processor#ingest-process-category-data-filtering`,
dataTransformation: `${ELASTIC_DOCS}reference/enrich-processor#ingest-process-category-data-transformation`,
pipelineHandling: `${ELASTIC_DOCS}reference/enrich-processor#ingest-process-category-pipeline-handling`,
redact: `${ELASTIC_DOCS}reference/enrich-processor/redact-processor`,
registeredDomain: `${ELASTIC_DOCS}reference/enrich-processor/registered-domain-processor`,
remove: `${ELASTIC_DOCS}reference/enrich-processor/remove-processor`,
rename: `${ELASTIC_DOCS}reference/enrich-processor/rename-processor`,
reroute: `${ELASTIC_DOCS}reference/enrich-processor/reroute-processor`,
script: `${ELASTIC_DOCS}reference/enrich-processor/script-processor`,
set: `${ELASTIC_DOCS}reference/enrich-processor/set-processor`,
setSecurityUser: `${ELASTIC_DOCS}reference/enrich-processor/ingest-node-set-security-user-processor`,
sort: `${ELASTIC_DOCS}reference/enrich-processor/sort-processor`,
split: `${ELASTIC_DOCS}reference/enrich-processor/split-processor`,
terminate: `${ELASTIC_DOCS}reference/enrich-processor/terminate-processor`,
trim: `${ELASTIC_DOCS}reference/enrich-processor/trim-processor`,
uppercase: `${ELASTIC_DOCS}reference/enrich-processor/uppercase-processor`,
uriParts: `${ELASTIC_DOCS}reference/enrich-processor/uri-parts-processor`,
urlDecode: `${ELASTIC_DOCS}reference/enrich-processor/urldecode-processor`,
userAgent: `${ELASTIC_DOCS}reference/enrich-processor/user-agent-processor`,
},
fleet: {
guide: `${ELASTIC_DOCS}reference/fleet`,
fingerprint: `${ELASTIC_DOCS}reference/fleet/fingerprint-processor`,
fleetServer: `${ELASTIC_DOCS}reference/fleet/fleet-server`,
fleetServerAddFleetServer: `${ELASTIC_DOCS}reference/fleet/deployment-models`,
settings: `${ELASTIC_DOCS}reference/fleet/fleet-settings`,

View file

@ -486,6 +486,7 @@ export interface DocLinks {
readonly fleet: Readonly<{
beatsAgentComparison: string;
guide: string;
fingerprint: string;
fleetServer: string;
fleetServerAddFleetServer: string;
esSettings: string;

View file

@ -15,7 +15,7 @@ tags:
x-displayName: Logstash configuration management
externalDocs:
description: Centralized pipeline management
url: https://www.elastic.co/guide/en/logstash/current/logstash-centralized-pipeline-management.html
url: https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management
servers:
- url: /
paths:
@ -28,7 +28,7 @@ paths:
If your Elasticsearch cluster is protected with basic authentication, you must have either the `logstash_admin` built-in role or a customized Logstash writer role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: delete-logstash-pipeline
x-state: Technical Preview
tags:
@ -51,7 +51,7 @@ paths:
To use this API, you must have either the `logstash_admin` built-in role or a customized Logstash reader role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: get-logstash-pipeline
x-state: Technical Preview
tags:
@ -90,7 +90,7 @@ paths:
To use this API, you must have either the `logstash_admin` built-in role or a customized Logstash writer role.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: put-logstash-pipeline
x-state: Technical Preview
tags:
@ -156,7 +156,7 @@ paths:
The `username` property appears in the response when security is enabled and depends on when the pipeline was created or last updated.
externalDocs:
description: Secure your connection
url: https://www.elastic.co/guide/en/logstash/current/ls-security.html
url: https://www.elastic.co/docs/reference/logstash/secure-connection
operationId: get-logstash-pipelines
x-state: Technical Preview
tags:

View file

@ -9,8 +9,11 @@ import { act } from 'react-dom/test-utils';
import React from 'react';
import { registerTestBed, TestBed } from '@kbn/test-jest-helpers';
import { usageCollectionPluginMock } from '@kbn/usage-collection-plugin/public/mocks';
import { docLinksServiceMock } from '@kbn/core/public/mocks';
import { Props } from '..';
import { ProcessorsEditorWithDeps } from './processors_editor';
import { documentationService, uiMetricService } from '../../../services';
jest.mock('@elastic/eui', () => {
const original = jest.requireActual('@elastic/eui');
@ -63,6 +66,12 @@ export interface SetupResult extends TestBed<TestSubject> {
actions: ReturnType<typeof createActions>;
}
export const setupEnvironment = () => {
// Initialize mock services
uiMetricService.setup(usageCollectionPluginMock.createSetupContract());
documentationService.setup(docLinksServiceMock.createStartContract());
};
/**
* We make heavy use of "processorSelector" in these actions. They are a way to uniquely identify
* a processor and are a stringified version of {@link ProcessorSelector}.

View file

@ -7,7 +7,7 @@
import { act } from 'react-dom/test-utils';
import { licensingMock } from '@kbn/licensing-plugin/server/mocks';
import { setup, SetupResult } from './pipeline_processors_editor.helpers';
import { setup, setupEnvironment, SetupResult } from './pipeline_processors_editor.helpers';
import { Pipeline } from '../../../../../common/types';
import {
extractProcessorDetails,
@ -46,6 +46,7 @@ describe('Pipeline Editor', () => {
let testBed: SetupResult;
beforeAll(() => {
setupEnvironment();
jest.useFakeTimers({ legacyFakeTimers: true });
});
@ -112,7 +113,7 @@ describe('Pipeline Editor', () => {
});
// Get the list of processors that are only available for platinum licenses
const processorsForPlatinumLicense = extractProcessorDetails(mapProcessorTypeToDescriptor)
const processorsForPlatinumLicense = extractProcessorDetails(mapProcessorTypeToDescriptor())
.filter((processor) => processor.forLicenseAtLeast === 'platinum')
.map(({ value, label, category }) => ({ label, value, category }));

View file

@ -9,11 +9,12 @@ import { act } from 'react-dom/test-utils';
import React from 'react';
import { usageCollectionPluginMock } from '@kbn/usage-collection-plugin/public/mocks';
import { docLinksServiceMock } from '@kbn/core/public/mocks';
import { HttpSetup } from '@kbn/core/public';
import { registerTestBed, TestBed } from '@kbn/test-jest-helpers';
import { stubWebWorker } from '@kbn/test-jest-helpers';
import { uiMetricService, apiService } from '../../../../services';
import { uiMetricService, apiService, documentationService } from '../../../../services';
import { Props } from '../..';
import { initHttpRequests } from '../http_requests.helpers';
import { ProcessorsEditorWithDeps } from '../processors_editor';
@ -108,6 +109,7 @@ export const setup = async (httpSetup: HttpSetup, props: Props): Promise<SetupRe
export const setupEnvironment = () => {
// Initialize mock services
uiMetricService.setup(usageCollectionPluginMock.createSetupContract());
documentationService.setup(docLinksServiceMock.createStartContract());
return initHttpRequests();
};

View file

@ -14,7 +14,8 @@ import { HttpSetup } from '@kbn/core/public';
import { registerTestBed, TestBed } from '@kbn/test-jest-helpers';
import { stubWebWorker } from '@kbn/test-jest-helpers';
import { uiMetricService, apiService } from '../../../services';
import { docLinksServiceMock } from '@kbn/core/public/mocks';
import { uiMetricService, apiService, documentationService } from '../../../services';
import { Props } from '..';
import { initHttpRequests } from './http_requests.helpers';
import { ProcessorsEditorWithDeps } from './processors_editor';
@ -197,7 +198,10 @@ export const setup = async (httpSetup: HttpSetup, props: Props): Promise<SetupRe
};
};
export const setupEnvironment = initHttpRequests;
export const setupEnvironment = () => {
documentationService.setup(docLinksServiceMock.createStartContract());
return initHttpRequests();
};
type TestSubject =
| 'addDocumentsButton'

View file

@ -106,7 +106,7 @@ export const AddProcessorForm: FunctionComponent<Props> = ({
return (
<DocumentationButton
processorLabel={formDescriptor.label}
docLink={esDocsBasePath + formDescriptor.docLinkPath}
docLink={formDescriptor.docLinkPath}
/>
);
}

View file

@ -187,7 +187,7 @@ export const EditProcessorForm: FunctionComponent<Props> = ({
return (
<DocumentationButton
processorLabel={formDescriptor.label}
docLink={esDocsBasePath + formDescriptor.docLinkPath}
docLink={formDescriptor.docLinkPath}
/>
);
}

View file

@ -49,7 +49,7 @@ type ProcessorWithCategory = ProcessorTypeAndLabel & {
export const getProcessorTypesAndLabels = (license: ILicense | null) => {
return (
extractProcessorDetails(mapProcessorTypeToDescriptor)
extractProcessorDetails(mapProcessorTypeToDescriptor())
// Filter out any processors that are not available for the current license type
.filter((option) => {
return option.forLicenseAtLeast ? license?.hasAtLeast(option.forLicenseAtLeast) : true;

View file

@ -63,11 +63,7 @@ const getFieldsConfig = (docService: DocumentationService): FieldsConfig => {
defaultMessage="Field references or a static value for the dataset part of the data stream name. Must meet the criteria for {indexNamesLink}. Cannot contain {dash}. 100 characters max."
values={{
indexNamesLink: (
<EuiLink
href={`${docService.getEsDocsBasePath()}/indices-create-index.html#indices-create-api-path-params`}
target="_blank"
external
>
<EuiLink href={`${docService.getIndexParametersUrl()}`} target="_blank" external>
{i18n.translate('xpack.ingestPipelines.pipelineEditor.reroute.indexNameLink', {
defaultMessage: 'index names',
})}
@ -105,11 +101,7 @@ const getFieldsConfig = (docService: DocumentationService): FieldsConfig => {
defaultMessage="Field references or a static value for the namespace part of the data stream name. Must meet the criteria for {indexNamesLink}. 100 characters max."
values={{
indexNamesLink: (
<EuiLink
href={`${docService.getEsDocsBasePath()}/indices-create-index.html#indices-create-api-path-params`}
target="_blank"
external
>
<EuiLink href={`${docService.getIndexParametersUrl}`} target="_blank" external>
{i18n.translate('xpack.ingestPipelines.pipelineEditor.reroute.indexNameLink', {
defaultMessage: 'index names',
})}

View file

@ -21,12 +21,15 @@ export class DocumentationService {
private classificationUrl: string = '';
private regressionUrl: string = '';
private documentationUrl: string = '';
private createIndexParameters: string = '';
private docLinks: DocLinksStart | undefined;
public setup(docLinks: DocLinksStart): void {
const { DOC_LINK_VERSION, ELASTIC_WEBSITE_URL, links } = docLinks;
const docsBase = `${ELASTIC_WEBSITE_URL}guide/en`;
const { links } = docLinks;
this.esDocBasePath = `${docsBase}/elasticsearch/reference/${DOC_LINK_VERSION}`;
this.docLinks = docLinks;
this.esDocBasePath = links.elasticsearch.docsBase;
this.ingestNodeUrl = links.ingest.pipelines;
this.processorsUrl = links.ingest.processors;
this.handlingFailureUrl = links.ingest.pipelineFailure;
@ -39,6 +42,7 @@ export class DocumentationService {
this.classificationUrl = links.ingest.inferenceClassification;
this.regressionUrl = links.ingest.inferenceRegression;
this.documentationUrl = links.ingest.inference;
this.createIndexParameters = links.elasticsearch.createIndexParameters;
}
public getEsDocsBasePath() {
@ -92,6 +96,14 @@ export class DocumentationService {
public getDocumentationUrl() {
return this.documentationUrl;
}
public getIndexParametersUrl() {
return this.createIndexParameters;
}
public getDocLinks(): undefined | DocLinksStart {
return this.docLinks;
}
}
export const documentationService = new DocumentationService();