-
Notifications
You must be signed in to change notification settings - Fork 24
Get All and Explain All #149
Get All and Explain All #149
Conversation
throw err; | ||
} | ||
} | ||
policy = _.get(getResponse, "policy", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unclear what the behavior here is on the UI when the explain returns a response and the get fails and we have policy: null. I think before a policy could be null when it hadn't initialized yet, is that still possible? Can it be confusing now since policy: null on the UI can mean not initialized vs failed to get.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously policy is from managed-index doc, now it's directly get from policy doc. So now, if policy is null, will always show "Failed to load policy", it actually means policy not exist. If get policy call fail, it will throw an exception.
For initializing, check if metadata contain policy seqNo, if it's null, it means we are still initializing
// If the config index does not exist then nothing is being managed | ||
if (err.statusCode === 404 && err.body.error.type === "index_not_found_exception") { | ||
return indexUuids.reduce((accu, value) => ({ ...accu, [value]: "No" }), {}); | ||
const explainParamas = { index: indexNames.toString() }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a typo? I am assuming that this should be explainParams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, will fix it in today's bump version small PR
return indexUuids.reduce((accu, value) => ({ ...accu, [value]: "No" }), {}); | ||
const explainParamas = { index: indexNames.toString() }; | ||
const { callAsCurrentUser: callWithRequest } = this.esDriver.asScoped(request); | ||
const explainResponse: ExplainResponse = await callWithRequest("ism.explain", explainParamas); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here explaingParamas
-> explainParams
Issue #, if available:
Description of changes:
Following methods in the kibana server Services needs to be changed to use our backend API only:
getManagedIndices
now use backend explainAll, and usegetPolicy
to fill in policy field (we don't have policy saved in explain metadata)getPolicies
now use backend getPoliciessearchPolicies(frontend) now use
getPolicies
_getManagedStatus
now use backend explainAll; getIndices use_getManagedStatus
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.