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

[esArchiver] upgrade to new ES client #89874

Merged
merged 10 commits into from
Feb 2, 2021
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@
"@welldone-software/why-did-you-render": "^5.0.0",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",
"angular-aria": "^1.8.0",
"angular-mocks": "^1.7.9",
"angular-recursion": "^1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/src/actions/empty_kibana_index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Public License, v 1.
*/

import { Client } from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';
import { ToolingLog, KbnClient } from '@kbn/dev-utils';

import { migrateKibanaIndex, createStats, cleanKibanaIndices } from '../lib';
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-es-archiver/src/actions/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { resolve } from 'path';
import { createReadStream } from 'fs';
import { Readable } from 'stream';
import { ToolingLog, KbnClient } from '@kbn/dev-utils';
import { Client } from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';

import { createPromiseFromStreams, concatStreamProviders } from '@kbn/utils';

Expand Down Expand Up @@ -92,7 +92,7 @@ export async function loadAction({

await client.indices.refresh({
index: '_all',
allowNoIndices: true,
allow_no_indices: true,
});

// If we affected the Kibana index, we need to ensure it's migrated...
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/src/actions/save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { resolve } from 'path';
import { createWriteStream, mkdirSync } from 'fs';
import { Readable, Writable } from 'stream';
import { Client } from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';
import { ToolingLog } from '@kbn/dev-utils';
import { createListStream, createPromiseFromStreams } from '@kbn/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/src/actions/unload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { resolve } from 'path';
import { createReadStream } from 'fs';
import { Readable, Writable } from 'stream';
import { Client } from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';
import { ToolingLog, KbnClient } from '@kbn/dev-utils';
import { createPromiseFromStreams } from '@kbn/utils';

Expand Down
7 changes: 3 additions & 4 deletions packages/kbn-es-archiver/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Fs from 'fs';

import { RunWithCommands, createFlagError, KbnClient, CA_CERT_PATH } from '@kbn/dev-utils';
import { readConfigFile } from '@kbn/test';
import legacyElasticsearch from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';

import { EsArchiver } from './es_archiver';

Expand Down Expand Up @@ -115,10 +115,9 @@ export function runCli() {
throw createFlagError('--dir or --config must be defined');
}

const client = new legacyElasticsearch.Client({
host: esUrl,
const client = new Client({
node: esUrl,
ssl: esCa ? { ca: esCa } : undefined,
log: flags.verbose ? 'trace' : [],
});
addCleanupTask(() => client.close());

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es-archiver/src/es_archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Public License, v 1.
*/

import { Client } from 'elasticsearch';
import { Client } from '@elastic/elasticsearch';
import { ToolingLog, KbnClient } from '@kbn/dev-utils';

import {
Expand Down
67 changes: 0 additions & 67 deletions packages/kbn-es-archiver/src/lib/docs/__mocks__/stubs.ts

This file was deleted.

Loading