-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
134 changed files
with
2,412 additions
and
315 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff a/.buildkite/ftr_platform_stateful_configs.yml b/.buildkite/ftr_platform_stateful_configs.yml (rejected hunks) | ||
@@ -344,7 +344,7 @@ enabled: | ||
- x-pack/test/task_manager_claimer_mget/config.ts | ||
- x-pack/test/ui_capabilities/security_and_spaces/config.ts | ||
- x-pack/test/ui_capabilities/spaces_only/config.ts | ||
- - x-pack/test/upgrade_assistant_integration/config.js | ||
+ - x-pack/test/upgrade_assistant_integration/config.ts | ||
- x-pack/test/usage_collection/config.ts | ||
- x-pack/performance/journeys_e2e/aiops_log_rate_analysis.ts | ||
- x-pack/performance/journeys_e2e/ecommerce_dashboard.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
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
17 changes: 17 additions & 0 deletions
17
examples/routing_example/server/routes/deprecated_routes/index.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,17 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { IRouter } from '@kbn/core/server'; | ||
import { registerDeprecatedRoute } from './unversioned'; | ||
import { registerVersionedDeprecatedRoute } from './versioned'; | ||
|
||
export function registerDeprecatedRoutes(router: IRouter) { | ||
registerDeprecatedRoute(router); | ||
registerVersionedDeprecatedRoute(router); | ||
} |
62 changes: 62 additions & 0 deletions
62
examples/routing_example/server/routes/deprecated_routes/unversioned.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,62 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import type { IRouter } from '@kbn/core/server'; | ||
import { schema } from '@kbn/config-schema'; | ||
import { DEPRECATED_ROUTES } from '../../../common'; | ||
|
||
export const registerDeprecatedRoute = (router: IRouter) => { | ||
router.get( | ||
{ | ||
path: DEPRECATED_ROUTES.REMOVED_ROUTE, | ||
validate: false, | ||
options: { | ||
access: 'public', | ||
deprecated: { | ||
documentationUrl: 'https://elastic.co/', | ||
severity: 'critical', | ||
reason: { type: 'remove' }, | ||
}, | ||
}, | ||
}, | ||
async (ctx, req, res) => { | ||
return res.ok({ | ||
body: { result: 'Called deprecated route. Check UA to see the deprecation.' }, | ||
}); | ||
} | ||
); | ||
|
||
router.post( | ||
{ | ||
path: DEPRECATED_ROUTES.MIGRATED_ROUTE, | ||
validate: { | ||
body: schema.object({ | ||
test: schema.maybe(schema.boolean()), | ||
}), | ||
}, | ||
options: { | ||
access: 'public', | ||
deprecated: { | ||
documentationUrl: 'https://elastic.co/', | ||
severity: 'critical', | ||
reason: { | ||
type: 'migrate', | ||
newApiMethod: 'GET', | ||
newApiPath: `${DEPRECATED_ROUTES.VERSIONED_ROUTE}?apiVersion=2`, | ||
}, | ||
}, | ||
}, | ||
}, | ||
async (ctx, req, res) => { | ||
return res.ok({ | ||
body: { result: 'Called deprecated route. Check UA to see the deprecation.' }, | ||
}); | ||
} | ||
); | ||
}; |
53 changes: 53 additions & 0 deletions
53
examples/routing_example/server/routes/deprecated_routes/versioned.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,53 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import type { RequestHandler } from '@kbn/core-http-server'; | ||
import type { IRouter } from '@kbn/core/server'; | ||
import { DEPRECATED_ROUTES } from '../../../common'; | ||
|
||
const createDummyHandler = | ||
(version: string): RequestHandler => | ||
(ctx, req, res) => { | ||
return res.ok({ body: { result: `API version ${version}.` } }); | ||
}; | ||
|
||
export const registerVersionedDeprecatedRoute = (router: IRouter) => { | ||
const versionedRoute = router.versioned.get({ | ||
path: DEPRECATED_ROUTES.VERSIONED_ROUTE, | ||
description: 'Routing example plugin deprecated versioned route.', | ||
access: 'internal', | ||
options: { | ||
excludeFromOAS: true, | ||
}, | ||
enableQueryVersion: true, | ||
}); | ||
|
||
versionedRoute.addVersion( | ||
{ | ||
options: { | ||
deprecated: { | ||
documentationUrl: 'https://elastic.co/', | ||
severity: 'warning', | ||
reason: { type: 'bump', newApiVersion: '2' }, | ||
}, | ||
}, | ||
validate: false, | ||
version: '1', | ||
}, | ||
createDummyHandler('1') | ||
); | ||
|
||
versionedRoute.addVersion( | ||
{ | ||
version: '2', | ||
validate: false, | ||
}, | ||
createDummyHandler('2') | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
diff a/oas_docs/bundle.json b/oas_docs/bundle.json (rejected hunks) | ||
@@ -6409,7 +6409,6 @@ | ||
}, | ||
"/api/fleet/agent-status": { | ||
"get": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fagent-status#0", | ||
"parameters": [ | ||
{ | ||
@@ -17479,7 +17478,6 @@ | ||
] | ||
}, | ||
"put": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fagents%2F%7BagentId%7D%2Freassign#0", | ||
"parameters": [ | ||
{ | ||
@@ -18179,7 +18177,6 @@ | ||
}, | ||
"/api/fleet/enrollment-api-keys": { | ||
"get": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys#0", | ||
"parameters": [ | ||
{ | ||
@@ -18226,7 +18223,6 @@ | ||
"tags": [] | ||
}, | ||
"post": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys#1", | ||
"parameters": [ | ||
{ | ||
@@ -18283,7 +18279,6 @@ | ||
}, | ||
"/api/fleet/enrollment-api-keys/{keyId}": { | ||
"delete": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#1", | ||
"parameters": [ | ||
{ | ||
@@ -18322,7 +18317,6 @@ | ||
"tags": [] | ||
}, | ||
"get": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#0", | ||
"parameters": [ | ||
{ | ||
@@ -25053,7 +25047,6 @@ | ||
}, | ||
"/api/fleet/epm/packages/{pkgkey}": { | ||
"delete": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3", | ||
"parameters": [ | ||
{ | ||
@@ -25111,7 +25104,6 @@ | ||
"tags": [] | ||
}, | ||
"get": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0", | ||
"parameters": [ | ||
{ | ||
@@ -25173,7 +25165,6 @@ | ||
"tags": [] | ||
}, | ||
"post": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2", | ||
"parameters": [ | ||
{ | ||
@@ -25257,7 +25248,6 @@ | ||
"tags": [] | ||
}, | ||
"put": { | ||
- "deprecated": true, | ||
"operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1", | ||
"parameters": [ | ||
{ | ||
@@ -40472,7 +40462,6 @@ | ||
}, | ||
"/api/fleet/service-tokens": { | ||
"post": { | ||
- "deprecated": true, | ||
"description": "Create a service token", | ||
"operationId": "%2Fapi%2Ffleet%2Fservice-tokens#0", | ||
"parameters": [ |
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,89 @@ | ||
diff a/oas_docs/output/kibana.serverless.staging.yaml b/oas_docs/output/kibana.serverless.staging.yaml (rejected hunks) | ||
@@ -15066,7 +15066,6 @@ paths: | ||
- Elastic Agents | ||
/api/fleet/agent-status: | ||
get: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fagent-status#0' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -16769,7 +16768,6 @@ paths: | ||
tags: | ||
- Elastic Agent actions | ||
put: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fagents%2F%7BagentId%7D%2Freassign#0' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -18622,7 +18620,6 @@ paths: | ||
- Fleet enrollment API keys | ||
/api/fleet/enrollment-api-keys: | ||
get: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys#0' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -18654,7 +18651,6 @@ paths: | ||
summary: '' | ||
tags: [] | ||
post: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys#1' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -18692,7 +18688,6 @@ paths: | ||
tags: [] | ||
/api/fleet/enrollment-api-keys/{keyId}: | ||
delete: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#1' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -18719,7 +18714,6 @@ paths: | ||
summary: '' | ||
tags: [] | ||
get: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fenrollment-api-keys%2F%7BkeyId%7D#0' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -20434,7 +20428,6 @@ paths: | ||
- Elastic Package Manager (EPM) | ||
/api/fleet/epm/packages/{pkgkey}: | ||
delete: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -20473,7 +20466,6 @@ paths: | ||
summary: '' | ||
tags: [] | ||
get: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -20514,7 +20506,6 @@ paths: | ||
summary: '' | ||
tags: [] | ||
post: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -20570,7 +20561,6 @@ paths: | ||
summary: '' | ||
tags: [] | ||
put: | ||
- deprecated: true | ||
operationId: '%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1' | ||
parameters: | ||
- description: The version of the API to use | ||
@@ -33533,7 +33523,6 @@ paths: | ||
- Fleet service tokens | ||
/api/fleet/service-tokens: | ||
post: | ||
- deprecated: true | ||
description: Create a service token | ||
operationId: '%2Fapi%2Ffleet%2Fservice-tokens#0' | ||
parameters: |
Oops, something went wrong.