Skip to content

Commit

Permalink
import es client
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Nov 14, 2019
1 parent 936e560 commit 73594e8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions x-pack/legacy/plugins/integrations_manager/server/lib/ilm/ilm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
* you may not use this file except in compliance with the Elastic License.
*/

import {Client} from 'elasticsearch';


/**
* Calls the given esClient, creates and index and sets it as write index on the given alias.
*/
export function createIndexWithAlias(esClient: object, indexName: string, aliasName: string) {
// TODO: replace esClient by an actual client
const query = '/' + indexName;
const method = 'PUT';
export async function createIndexWithAlias(esClient: Client, indexName: string, aliasName: string) {
const body = getIndexWithWithAlias(indexName, aliasName);
// TODO: API request go create it

client.indices.create({
index: indexName,
body: body,
});

}

export function getIndexWithWithAlias(aliasName: string) {
Expand Down

0 comments on commit 73594e8

Please sign in to comment.