Skip to content

Commit f73ad12

Browse files
authored
[ML] Remove deprecated force parameter. (#46361) (#47123)
The force parameter was removed from start actions in elastic/elasticsearch#46414. This reflects the change in the UI API calls.
1 parent 1d6f33b commit f73ad12

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

x-pack/legacy/plugins/ml/server/client/elasticsearch_ml.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,11 @@ export const elasticsearchJsPlugin = (Client, config, components) => { // eslint
287287
ml.startDataFrameTransform = ca({
288288
urls: [
289289
{
290-
fmt: '/_data_frame/transforms/<%=transformId%>/_start?&force=<%=force%>',
290+
fmt: '/_data_frame/transforms/<%=transformId%>/_start',
291291
req: {
292292
transformId: {
293293
type: 'string'
294294
},
295-
force: {
296-
type: 'boolean'
297-
}
298295
}
299296
}
300297
],

x-pack/legacy/plugins/ml/server/models/data_frame/transforms.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ enum TRANSFORM_ACTIONS {
1919
DELETE = 'delete',
2020
}
2121

22-
interface StartStopOptions {
22+
interface StartTransformOptions {
2323
transformId: DataFrameTransformId;
24-
force: boolean;
24+
}
25+
26+
interface StopTransformOptions {
27+
transformId: DataFrameTransformId;
28+
force?: boolean;
2529
waitForCompletion?: boolean;
2630
}
2731

@@ -30,11 +34,11 @@ export function transformServiceProvider(callWithRequest: callWithRequestType) {
3034
return callWithRequest('ml.deleteDataFrameTransform', { transformId });
3135
}
3236

33-
async function stopTransform(options: StartStopOptions) {
37+
async function stopTransform(options: StopTransformOptions) {
3438
return callWithRequest('ml.stopDataFrameTransform', options);
3539
}
3640

37-
async function startTransform(options: StartStopOptions) {
41+
async function startTransform(options: StartTransformOptions) {
3842
return callWithRequest('ml.startDataFrameTransform', options);
3943
}
4044

@@ -86,13 +90,7 @@ export function transformServiceProvider(callWithRequest: callWithRequestType) {
8690
for (const transformInfo of transformsInfo) {
8791
const transformId = transformInfo.id;
8892
try {
89-
await startTransform({
90-
transformId,
91-
force:
92-
transformInfo.state !== undefined
93-
? transformInfo.state === DATA_FRAME_TRANSFORM_STATE.FAILED
94-
: false,
95-
});
93+
await startTransform({ transformId });
9694
results[transformId] = { success: true };
9795
} catch (e) {
9896
if (isRequestTimeout(e)) {

0 commit comments

Comments
 (0)