mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Remove es _xpack endpoint usage (#29465)
* _xpack/rollup -> _rollup * _xpack/sql -> _sql * _xpack/license -> _license * _xpack/migration -> _migration * _xpack/watcher -> _watcher * _xpack/monitoring -> _monitoring * _xpack/security -> _security * [console_extensions] regenerate * [console_extensions] update ml overrides * [console_extensions] update security overrides * [console_extensions] update rollup overrides * Revert "[console_extensions] update rollup overrides" This reverts commitbb3742570d
. * Revert "[console_extensions] update security overrides" This reverts commit5c0263b35e
. * Revert "[console_extensions] update ml overrides" This reverts commite8254d5671
. * Revert "[console_extensions] regenerate" This reverts commit91b754e956
.
This commit is contained in:
parent
dc70eab105
commit
e9f0006890
14 changed files with 38 additions and 38 deletions
|
@ -94,7 +94,7 @@ async function insertUser(port, auth, username, password, roles = [], retries =
|
|||
auth,
|
||||
hostname: 'localhost',
|
||||
port,
|
||||
pathname: `/_xpack/security/user/${username}`,
|
||||
pathname: `/_security/user/${username}`,
|
||||
}),
|
||||
json: true,
|
||||
body: { password, roles },
|
||||
|
|
|
@ -175,7 +175,7 @@ interface ElasticsearchClientLogging {
|
|||
}
|
||||
|
||||
interface AssistantAPIClientParams extends GenericParams {
|
||||
path: '/_xpack/migration/assistance';
|
||||
path: '/_migration/assistance';
|
||||
method: 'GET';
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ export interface AssistanceAPIResponse {
|
|||
}
|
||||
|
||||
interface DeprecationAPIClientParams extends GenericParams {
|
||||
path: '/_xpack/migration/deprecations';
|
||||
path: '/_migration/deprecations';
|
||||
method: 'GET';
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { normalizeType } from './normalize_type';
|
|||
|
||||
export const queryEsSQL = (elasticsearchClient, { count, query, filter }) =>
|
||||
elasticsearchClient('transport.request', {
|
||||
path: '/_xpack/sql?format=json',
|
||||
path: '/_sql?format=json',
|
||||
method: 'POST',
|
||||
body: {
|
||||
fetch_size: count,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
const getLicensePath = (acknowledge) => `/_xpack/license${ acknowledge ? '?acknowledge=true' : ''}`;
|
||||
const getLicensePath = (acknowledge) => `/_license${ acknowledge ? '?acknowledge=true' : ''}`;
|
||||
|
||||
export async function putLicense(req, xpackInfo) {
|
||||
const { acknowledge } = req.query;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
const getStartBasicPath = (acknowledge) => `/_xpack/license/start_basic${ acknowledge ? '?acknowledge=true' : ''}`;
|
||||
const getStartBasicPath = (acknowledge) => `/_license/start_basic${ acknowledge ? '?acknowledge=true' : ''}`;
|
||||
|
||||
|
||||
export async function startBasic(req, xpackInfo) {
|
||||
|
|
|
@ -8,7 +8,7 @@ export async function canStartTrial(req) {
|
|||
const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('admin');
|
||||
const options = {
|
||||
method: 'GET',
|
||||
path: '/_xpack/license/trial_status'
|
||||
path: '/_license/trial_status'
|
||||
};
|
||||
try {
|
||||
const response = await callWithRequest(req, 'transport.request', options);
|
||||
|
@ -22,7 +22,7 @@ export async function startTrial(req, xpackInfo) {
|
|||
const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('admin');
|
||||
const options = {
|
||||
method: 'POST',
|
||||
path: '/_xpack/license/start_trial?acknowledge=true'
|
||||
path: '/_license/start_trial?acknowledge=true'
|
||||
};
|
||||
try {
|
||||
/*eslint camelcase: 0*/
|
||||
|
|
|
@ -44,7 +44,7 @@ const LicenseUpdateInfoForRemote = ({ isPrimaryCluster }) => {
|
|||
</p>
|
||||
<EuiSpacer />
|
||||
<EuiCodeBlock>
|
||||
{`curl -XPUT -u <user> 'https://<host>:<port>/_xpack/license' -H 'Content-Type: application/json' -d @license.json`}
|
||||
{`curl -XPUT -u <user> 'https://<host>:<port>/_license' -H 'Content-Type: application/json' -d @license.json`}
|
||||
</EuiCodeBlock>
|
||||
</EuiPanel>
|
||||
);
|
||||
|
|
|
@ -39,14 +39,14 @@ export function monitoringBulk(Client, _config, components) {
|
|||
}
|
||||
},
|
||||
urls: [{
|
||||
fmt: '/_xpack/monitoring/<%=type%>/_bulk',
|
||||
fmt: '/_monitoring/<%=type%>/bulk',
|
||||
req: {
|
||||
type: {
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fmt: '/_xpack/monitoring/_bulk'
|
||||
fmt: '/_monitoring/bulk'
|
||||
}],
|
||||
needBody: true,
|
||||
bulkBody: true,
|
||||
|
|
|
@ -13,7 +13,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.rollupIndexCapabilities = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/<%=indexPattern%>/_xpack/rollup/data',
|
||||
fmt: '/<%=indexPattern%>/_rollup/data',
|
||||
req: {
|
||||
indexPattern: {
|
||||
type: 'string'
|
||||
|
@ -56,7 +56,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.jobs = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/_all',
|
||||
fmt: '/_rollup/job/_all',
|
||||
}
|
||||
],
|
||||
method: 'GET'
|
||||
|
@ -65,7 +65,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.job = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/<%=id%>',
|
||||
fmt: '/_rollup/job/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string'
|
||||
|
@ -79,7 +79,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.startJob = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/<%=id%>/_start',
|
||||
fmt: '/_rollup/job/<%=id%>/_start',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string'
|
||||
|
@ -93,7 +93,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.stopJob = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/<%=id%>/_stop',
|
||||
fmt: '/_rollup/job/<%=id%>/_stop',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string'
|
||||
|
@ -107,7 +107,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.deleteJob = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/<%=id%>',
|
||||
fmt: '/_rollup/job/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string'
|
||||
|
@ -121,7 +121,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
rollup.createJob = ca({
|
||||
urls: [
|
||||
{
|
||||
fmt: '/_xpack/rollup/job/<%=id%>',
|
||||
fmt: '/_rollup/job/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string'
|
||||
|
|
|
@ -14,7 +14,7 @@ describe('getUpgradeAssistantStatus', () => {
|
|||
let deprecationsResponse: DeprecationAPIResponse;
|
||||
|
||||
const callWithRequest = jest.fn().mockImplementation(async (req, api, { path }) => {
|
||||
if (path === '/_xpack/migration/deprecations') {
|
||||
if (path === '/_migration/deprecations') {
|
||||
return deprecationsResponse;
|
||||
} else {
|
||||
throw new Error(`Unexpected API call: ${path}`);
|
||||
|
@ -25,10 +25,10 @@ describe('getUpgradeAssistantStatus', () => {
|
|||
deprecationsResponse = _.cloneDeep(fakeDeprecations);
|
||||
});
|
||||
|
||||
it('calls /_xpack/migration/deprecations', async () => {
|
||||
it('calls /_migration/deprecations', async () => {
|
||||
await getUpgradeAssistantStatus(callWithRequest, {} as any, '/');
|
||||
expect(callWithRequest).toHaveBeenCalledWith({}, 'transport.request', {
|
||||
path: '/_xpack/migration/deprecations',
|
||||
path: '/_migration/deprecations',
|
||||
method: 'GET',
|
||||
});
|
||||
});
|
||||
|
|
|
@ -31,7 +31,7 @@ export async function getUpgradeAssistantStatus(
|
|||
basePath: string
|
||||
): Promise<UpgradeAssistantStatus> {
|
||||
const deprecations = (await callWithRequest(req, 'transport.request', {
|
||||
path: '/_xpack/migration/deprecations',
|
||||
path: '/_migration/deprecations',
|
||||
method: 'GET',
|
||||
})) as DeprecationAPIResponse;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>/_deactivate',
|
||||
fmt: '/_watcher/watch/<%=id%>/_deactivate',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -51,7 +51,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>/_activate',
|
||||
fmt: '/_watcher/watch/<%=id%>/_activate',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -78,7 +78,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>/_ack/<%=action%>',
|
||||
fmt: '/_watcher/watch/<%=id%>/_ack/<%=action%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -112,7 +112,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>',
|
||||
fmt: '/_watcher/watch/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -136,7 +136,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/_execute'
|
||||
fmt: '/_watcher/watch/_execute'
|
||||
},
|
||||
needBody: true,
|
||||
method: 'POST'
|
||||
|
@ -151,7 +151,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
watcher.getWatch = ca({
|
||||
params: {},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>',
|
||||
fmt: '/_watcher/watch/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -176,7 +176,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
}
|
||||
},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/watch/<%=id%>',
|
||||
fmt: '/_watcher/watch/<%=id%>',
|
||||
req: {
|
||||
id: {
|
||||
type: 'string',
|
||||
|
@ -196,7 +196,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
watcher.restart = ca({
|
||||
params: {},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/_restart'
|
||||
fmt: '/_watcher/_restart'
|
||||
},
|
||||
method: 'PUT'
|
||||
});
|
||||
|
@ -209,7 +209,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
watcher.start = ca({
|
||||
params: {},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/_start'
|
||||
fmt: '/_watcher/_start'
|
||||
},
|
||||
method: 'PUT'
|
||||
});
|
||||
|
@ -222,7 +222,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
watcher.stats = ca({
|
||||
params: {},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/stats'
|
||||
fmt: '/_watcher/stats'
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -234,7 +234,7 @@ export const elasticsearchJsPlugin = (Client, config, components) => {
|
|||
watcher.stop = ca({
|
||||
params: {},
|
||||
url: {
|
||||
fmt: '/_xpack/watcher/_stop'
|
||||
fmt: '/_watcher/_stop'
|
||||
},
|
||||
method: 'PUT'
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
function mockGetXPackLicense(callCluster, license) {
|
||||
callCluster.withArgs('transport.request', {
|
||||
method: 'GET',
|
||||
path: '/_xpack/license',
|
||||
path: '/_license',
|
||||
query: {
|
||||
local: 'true'
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ describe('get_xpack', () => {
|
|||
|
||||
describe('getXPackLicense', () => {
|
||||
|
||||
it('uses callCluster to get /_xpack/license API', async () => {
|
||||
it('uses callCluster to get /_license API', async () => {
|
||||
const response = { type: 'basic' };
|
||||
const callCluster = sinon.stub();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import { TIMEOUT } from './constants';
|
|||
/**
|
||||
* Get the cluster stats from the connected cluster.
|
||||
*
|
||||
* This is the equivalent of GET /_xpack/license?local=true .
|
||||
* This is the equivalent of GET /_license?local=true .
|
||||
*
|
||||
* Like any X-Pack related API, X-Pack must installed for this to work.
|
||||
*
|
||||
|
@ -19,7 +19,7 @@ import { TIMEOUT } from './constants';
|
|||
export function getXPackLicense(callCluster) {
|
||||
return callCluster('transport.request', {
|
||||
method: 'GET',
|
||||
path: '/_xpack/license',
|
||||
path: '/_license',
|
||||
query: {
|
||||
// Fetching the local license is cheaper than getting it from the master and good enough
|
||||
local: 'true'
|
||||
|
@ -51,7 +51,7 @@ export function getXPackUsage(callCluster) {
|
|||
/**
|
||||
* Combine the X-Pack responses into a single response as Monitoring does already.
|
||||
*
|
||||
* @param {Object} license The license returned from /_xpack/license
|
||||
* @param {Object} license The license returned from /_license
|
||||
* @param {Object} usage The usage details returned from /_xpack/usage
|
||||
* @return {Object} An object containing both the license and usage.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue