Skip to content

Commit

Permalink
es-archiver call _migrate endpoint instead of creating a migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Feb 6, 2020
1 parent ea7c78d commit 1943e3a
Show file tree
Hide file tree
Showing 11 changed files with 3,129 additions and 3,094 deletions.
19 changes: 19 additions & 0 deletions packages/kbn-dev-utils/src/kbn_client/kbn_client_saved_objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,28 @@ interface UpdateOptions<Attributes> extends IndexOptions<Attributes> {
id: string;
}

interface MigrateResponse {
success: boolean;
result: Array<{ status: string }>;
}

export class KbnClientSavedObjects {
constructor(private readonly log: ToolingLog, private readonly requester: KbnClientRequester) {}

/**
* Run the saved objects migration
*/
public async migrate() {
this.log.debug('Migrating saved objects');

return await this.requester.request<MigrateResponse>({
description: 'migrate saved objects',
path: uriencode`/api/saved_objects/_migrate`,
method: 'POST',
body: {},
});
}

/**
* Get an object
*/
Expand Down
Loading

0 comments on commit 1943e3a

Please sign in to comment.