mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ES body
removal] @elastic/kibana-management
(#204871)
This commit is contained in:
parent
ec3013ccd1
commit
2687f4f109
23 changed files with 31 additions and 37 deletions
|
@ -10,7 +10,7 @@ import {
|
|||
HealthStatus,
|
||||
IndicesStatsIndexMetadataState,
|
||||
Uuid,
|
||||
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
} from '@elastic/elasticsearch/lib/api/types';
|
||||
import type { ScopedHistory } from '@kbn/core-application-browser';
|
||||
import type { SerializableRecord } from '@kbn/utility-types';
|
||||
import type { LocatorPublic } from '@kbn/share-plugin/public';
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
|
||||
import { SlmPolicyEs, PolicyIndicesResponse } from '../../../common/types';
|
||||
|
@ -47,7 +46,7 @@ export function registerPolicyRoutes({
|
|||
body: {
|
||||
policies: Object.entries(policiesByName).map(([name, policy]) => {
|
||||
// TODO: Figure out why our {@link SlmPolicyEs} is not compatible with:
|
||||
// import type { SnapshotLifecyclePolicyMetadata } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
// import type { SnapshotLifecyclePolicyMetadata } from '@elastic/elasticsearch/lib/api/types';
|
||||
return deserializePolicy(name, policy as SlmPolicyEs, managedPolicies);
|
||||
}),
|
||||
},
|
||||
|
@ -119,9 +118,9 @@ export function registerPolicyRoutes({
|
|||
try {
|
||||
// Otherwise create new policy
|
||||
const response = await clusterClient.asCurrentUser.slm.putLifecycle({
|
||||
// TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest}
|
||||
...serializePolicy(policy),
|
||||
policy_id: name,
|
||||
// TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest['body']}
|
||||
body: serializePolicy(policy) as unknown as estypes.SlmPutLifecycleRequest['body'],
|
||||
});
|
||||
|
||||
return res.ok({ body: response });
|
||||
|
@ -149,9 +148,9 @@ export function registerPolicyRoutes({
|
|||
|
||||
// Otherwise update policy
|
||||
const response = await clusterClient.asCurrentUser.slm.putLifecycle({
|
||||
// TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest}
|
||||
...serializePolicy(policy),
|
||||
policy_id: name,
|
||||
// TODO: bring {@link SlmPolicyEs['policy']} in line with {@link PutSnapshotLifecycleRequest['body']}
|
||||
body: serializePolicy(policy) as unknown as estypes.SlmPutLifecycleRequest['body'],
|
||||
});
|
||||
|
||||
return res.ok({ body: response });
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TypeOf } from '@kbn/config-schema';
|
|||
import type {
|
||||
SnapshotGetRepositoryResponse,
|
||||
PluginStats,
|
||||
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
} from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
import {
|
||||
ON_PREM_REPOSITORY_TYPES,
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
|
||||
import { SnapshotRestore, SnapshotRestoreShardEs } from '../../../common/types';
|
||||
import { serializeRestoreSettings } from '../../../common/lib';
|
||||
|
@ -114,10 +113,10 @@ export function registerRestoreRoutes({
|
|||
|
||||
try {
|
||||
const response = await clusterClient.asCurrentUser.snapshot.restore({
|
||||
// TODO: Bring {@link RestoreSettingsEs} in line with {@link RestoreRequest}
|
||||
...serializeRestoreSettings(restoreSettings),
|
||||
repository,
|
||||
snapshot,
|
||||
// TODO: Bring {@link RestoreSettingsEs} in line with {@link RestoreRequest['body']}
|
||||
body: serializeRestoreSettings(restoreSettings) as estypes.SnapshotRestoreRequest['body'],
|
||||
});
|
||||
|
||||
return res.ok({ body: response });
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { HealthReportImpact } from '@elastic/elasticsearch/lib/api/types';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { SavedObject } from '@kbn/core/types';
|
||||
|
||||
export type DeprecationSource = 'Kibana' | 'Elasticsearch';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
export const diskIndicatorGreen: estypes.HealthReportDiskIndicator = {
|
||||
status: 'green',
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { IScopedClusterClient } from '@kbn/core/server';
|
||||
import { EnrichedDeprecationInfo } from '../../../common/types';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import { elasticsearchServiceMock } from '@kbn/core/server/mocks';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
import fakeDeprecations from '../__fixtures__/fake_deprecations.json';
|
||||
import * as healthIndicatorsMock from '../__fixtures__/health_indicators';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import type {
|
||||
MigrationDeprecationsResponse,
|
||||
MigrationDeprecationsDeprecation,
|
||||
} from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
} from '@elastic/elasticsearch/lib/api/types';
|
||||
import { IScopedClusterClient } from '@kbn/core-elasticsearch-server';
|
||||
import _ from 'lodash';
|
||||
import { EnrichedDeprecationInfo } from '../../../common/types';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
interface Mapping {
|
||||
type?: string;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { ClusterGetSettingsResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type { ClusterGetSettingsResponse } from '@elastic/elasticsearch/lib/api/types';
|
||||
import { ByteSizeValue } from '@kbn/config-schema';
|
||||
import { API_BASE_PATH } from '../../common/constants';
|
||||
import { versionCheckHandlerWrapper } from '../lib/es_version_precheck';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import type { Moment } from 'moment';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
import { ACTION_STATES, WATCH_STATES, WATCH_STATE_COMMENTS } from '../constants';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { IScopedClusterClient } from '@kbn/core/server';
|
||||
import { get } from 'lodash';
|
||||
import { ES_SCROLL_SETTINGS } from '../../../common/constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { IScopedClusterClient } from '@kbn/core/server';
|
||||
import { reduce, size } from 'lodash';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { IScopedClusterClient } from '@kbn/core/server';
|
||||
import { RouteDependencies } from '../../../types';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { InferenceServiceSettings } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { InferenceServiceSettings } from '@elastic/elasticsearch/lib/api/types';
|
||||
import { LocalInferenceServiceSettings } from '@kbn/ml-trained-models-utils/src/constants/trained_models';
|
||||
import {
|
||||
ChildFieldName,
|
||||
|
|
|
@ -9,7 +9,7 @@ import { METRIC_TYPE } from '@kbn/analytics';
|
|||
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
|
||||
import { IndicesStatsResponse } from '@elastic/elasticsearch/lib/api/types';
|
||||
import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils';
|
||||
import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types';
|
||||
import {
|
||||
API_BASE_PATH,
|
||||
INTERNAL_API_BASE_PATH,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
import { RouteDependencies } from '../../../types';
|
||||
import { addBasePath } from '..';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { forEach, keys, sortBy, reduce, size } from 'lodash';
|
|||
import { flatMap, flow, groupBy, values as valuesFP, map, pickBy } from 'lodash/fp';
|
||||
|
||||
import type { IScopedClusterClient } from '@kbn/core/server';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import type { FieldCapsResponse } from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
export type FieldCapsList = FieldCapsResponse['fields'];
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
|
||||
import { RouteDependencies } from '../../../types';
|
||||
import { addBasePath } from '..';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { schema, TypeOf } from '@kbn/config-schema';
|
||||
|
||||
import { RouteDependencies } from '../../../types';
|
||||
|
@ -40,15 +40,11 @@ export function registerSimulateRoute({ router, lib: { handleEsError } }: RouteD
|
|||
const params: estypes.IndicesSimulateTemplateRequest = templateName
|
||||
? {
|
||||
name: templateName,
|
||||
body: {
|
||||
index_patterns,
|
||||
},
|
||||
index_patterns,
|
||||
}
|
||||
: {
|
||||
body: {
|
||||
...template,
|
||||
index_patterns,
|
||||
},
|
||||
...template,
|
||||
index_patterns,
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { Pipeline, Processor } from '../types';
|
||||
|
||||
export function deserializePipelines(pipelinesByName: {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
|
||||
import type * as estypes from '@elastic/elasticsearch/lib/api/types';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
|
||||
import { API_BASE_PATH } from '../../../common/constants';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue