Skip to content

Commit 1943e3a

Browse files
committed
es-archiver call _migrate endpoint instead of creating a migrator
1 parent ea7c78d commit 1943e3a

File tree

11 files changed

+3129
-3094
lines changed

11 files changed

+3129
-3094
lines changed

packages/kbn-dev-utils/src/kbn_client/kbn_client_saved_objects.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,28 @@ interface UpdateOptions<Attributes> extends IndexOptions<Attributes> {
5757
id: string;
5858
}
5959

60+
interface MigrateResponse {
61+
success: boolean;
62+
result: Array<{ status: string }>;
63+
}
64+
6065
export class KbnClientSavedObjects {
6166
constructor(private readonly log: ToolingLog, private readonly requester: KbnClientRequester) {}
6267

68+
/**
69+
* Run the saved objects migration
70+
*/
71+
public async migrate() {
72+
this.log.debug('Migrating saved objects');
73+
74+
return await this.requester.request<MigrateResponse>({
75+
description: 'migrate saved objects',
76+
path: uriencode`/api/saved_objects/_migrate`,
77+
method: 'POST',
78+
body: {},
79+
});
80+
}
81+
6382
/**
6483
* Get an object
6584
*/

0 commit comments

Comments
 (0)