Skip to content

Commit

Permalink
More terse!
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed May 14, 2020
1 parent 7b583c5 commit 11d1ef9
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ async function fetchIndicesCall(
callAsCurrentUser: CallAsCurrentUser,
indexNames?: string[]
): Promise<Index[]> {
let indexNamesCSV: string;
if (indexNames && indexNames.length) {
indexNamesCSV = indexNames.join(',');
} else {
indexNamesCSV = '*';
}
const indexNamesString = indexNames && indexNames.length ? indexNames.join(',') : '*';

// This call retrieves alias and settings (incl. hidden status) information about indices
const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', {
method: 'GET',
path: `/${indexNamesCSV}`,
path: `/${indexNamesString}`,
query: {
expand_wildcards: 'hidden,all',
},
Expand All @@ -65,7 +60,7 @@ async function fetchIndicesCall(
format: 'json',
h: 'health,status,index,uuid,pri,rep,docs.count,sth,store.size',
expand_wildcards: 'hidden,all',
index: indexNamesCSV,
index: indexNamesString,
};

// This call retrieves health and other high-level information about indices.
Expand Down

0 comments on commit 11d1ef9

Please sign in to comment.