Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes deprecated SO HTTP APIs deprecation field to object #197936

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/upgrade-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,35 @@ The `/agent_status` Fleet API now returns the following statuses:
* `active` — All active
====

[discrete]
[[kibana-150267]]
.Deprecated Saved objects APIs. (8.7)
[%collapsible]
====
*Details* +
The following saved objects APIs have been deprecated.

[source,text]
--
/api/saved_objects/{type}/{id}
/api/saved_objects/resolve/{type}/{id}
/api/saved_objects/{type}/{id?}
/api/saved_objects/{type}/{id}
/api/saved_objects/_find
/api/saved_objects/{type}/{id}
/api/saved_objects/_bulk_get
/api/saved_objects/_bulk_create
/api/saved_objects/_bulk_resolve
/api/saved_objects/_bulk_update
/api/saved_objects/_bulk_delete
--

For more information, refer to ({kibana-pull}150267[#150267]).

*Impact* +
Use dedicated public APIs instead, for example use <<data-views-api>> to manage Data Views.
====

[discrete]
[[deprecation-119494]]
.Updates Fleet API to improve consistency. (8.0)
Expand Down
2 changes: 1 addition & 1 deletion oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50524,7 +50524,7 @@ tags:
name: ml
- name: roles
- description: >
Export sets of saved objects that you want to import into {kib}, resolve
Export sets of saved objects that you want to import into Kibana, resolve
import errors, and rotate an encryption key for encrypted saved objects
with the saved objects APIs.

Expand Down
6 changes: 3 additions & 3 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37229,7 +37229,7 @@ paths:
description: >
Indicates a successful call. NOTE: This HTTP response code indicates
that the bulk operation succeeded. Errors pertaining to individual
objects will be returned in the response body.
objects will be returned in the response body.
'400':
content:
application/json; Elastic-Api-Version=2023-10-31:
Expand Down Expand Up @@ -37263,7 +37263,7 @@ paths:
description: >
Indicates a successful call. NOTE: This HTTP response code indicates
that the bulk operation succeeded. Errors pertaining to individual
objects will be returned in the response body.
objects will be returned in the response body.
'400':
content:
application/json; Elastic-Api-Version=2023-10-31:
Expand Down Expand Up @@ -58900,7 +58900,7 @@ tags:
name: ml
- name: roles
- description: >
Export sets of saved objects that you want to import into {kib}, resolve
Export sets of saved objects that you want to import into Kibana, resolve
import errors, and rotate an encryption key for encrypted saved objects
with the saved objects APIs.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-server-int
import type { CoreKibanaRequest } from '@kbn/core-http-router-server-internal';
import type { InternalHttpServiceSetup } from '@kbn/core-http-server-internal';
import { isObject } from 'lodash';
import { RouteDeprecationInfo } from '@kbn/core-http-server/src/router/route';
import { RouteDeprecationInfo } from '@kbn/core-http-server/src/router/route'; // shouldn't use deep imports
import { buildApiDeprecationId } from '../deprecations';

interface Dependencies {
Expand Down
1 change: 1 addition & 0 deletions packages/core/http/core-http-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export type {
RouteSecurity,
RouteSecurityGetter,
InternalRouteSecurity,
RouteDeprecationInfo,
} from './src/router';
export {
validBodyOutput,
Expand Down
1 change: 1 addition & 0 deletions packages/core/http/core-http-server/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export type {
RouteSecurity,
Privilege,
PrivilegeSet,
RouteDeprecationInfo,
} from './route';

export { validBodyOutput, ReservedPrivilegesSet } from './route';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export class Server {
elasticsearch: elasticsearchServiceSetup,
deprecations: deprecationsSetup,
coreUsageData: coreUsageDataSetup,
docLinks: docLinksSetup,
});

const uiSettingsSetup = await this.uiSettings.setup({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerBulkCreateRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.post(
Expand All @@ -38,8 +39,7 @@ export const registerBulkCreateRoute = (
summary: `Create saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
query: schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerBulkDeleteRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.post(
Expand All @@ -38,8 +39,7 @@ export const registerBulkDeleteRoute = (
summary: `Delete saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
body: schema.arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerBulkGetRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.post(
Expand All @@ -38,8 +39,7 @@ export const registerBulkGetRoute = (
summary: `Get saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
body: schema.arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerBulkResolveRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.post(
Expand All @@ -38,8 +39,7 @@ export const registerBulkResolveRoute = (
summary: `Resolve saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
description: `Retrieve multiple Kibana saved objects by ID, using any legacy URL aliases if they exist.
Under certain circumstances, when Kibana is upgraded, saved object migrations may necessitate regenerating some object IDs to enable new features. When an object's ID is regenerated, a legacy URL alias is created for that object, preserving its old ID. In such a scenario, that object can be retrieved with the bulk resolve API using either its new ID or its old ID.`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerBulkUpdateRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.put(
Expand All @@ -38,8 +39,7 @@ export const registerBulkUpdateRoute = (
summary: `Update saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
body: schema.arrayOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerCreateRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.post(
Expand All @@ -38,8 +39,7 @@ export const registerCreateRoute = (
summary: `Create a saved object`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
params: schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -24,11 +24,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerDeleteRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const { allowHttpApiAccess } = config;
router.delete(
Expand All @@ -38,8 +39,7 @@ export const registerDeleteRoute = (
summary: `Delete a saved object`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
params: schema.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { schema } from '@kbn/config-schema';
import type { RouteAccess } from '@kbn/core-http-server';
import type { RouteAccess, RouteDeprecationInfo } from '@kbn/core-http-server';
import { SavedObjectConfig } from '@kbn/core-saved-objects-base-server-internal';
import type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
import type { Logger } from '@kbn/logging';
Expand All @@ -21,11 +21,12 @@ interface RouteDependencies {
coreUsageData: InternalCoreUsageDataSetup;
logger: Logger;
access: RouteAccess;
deprecationInfo: RouteDeprecationInfo;
}

export const registerFindRoute = (
router: InternalSavedObjectRouter,
{ config, coreUsageData, logger, access }: RouteDependencies
{ config, coreUsageData, logger, access, deprecationInfo }: RouteDependencies
) => {
const referenceSchema = schema.object({
type: schema.string(),
Expand All @@ -42,8 +43,7 @@ export const registerFindRoute = (
summary: `Search for saved objects`,
tags: ['oas-tag:saved objects'],
access,
// @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo}
deprecated: true,
deprecated: deprecationInfo,
},
validate: {
query: schema.object({
Expand Down
Loading