-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces an endpoint to reset the desired balance. It could be used if computed balance diverged from the actual one a lot to start a new computation from the current state.
- Loading branch information
1 parent
058bcdb
commit c2c0ced
Showing
14 changed files
with
571 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[[delete-desired-balance]] | ||
=== Delete/reset desired balance API | ||
++++ | ||
<titleabbrev>Delete/reset desired balance</titleabbrev> | ||
++++ | ||
|
||
NOTE: {cloud-only} | ||
|
||
Exposes the desired balance and basic metrics. | ||
|
||
[[delete-desired-balance-request]] | ||
==== {api-request-title} | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
DELETE /_internal/desired_balance | ||
-------------------------------------------------- | ||
// TEST[skip:Can't reliably test desired balance] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
rest-api-spec/src/main/resources/rest-api-spec/api/_internal.delete_desired_balance.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"_internal.delete_desired_balance":{ | ||
"documentation":{ | ||
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-desired-balance.html", | ||
"description": "This API is a diagnostics API and the output should not be relied upon for building applications." | ||
}, | ||
"stability":"experimental", | ||
"visibility":"private", | ||
"headers":{ | ||
"accept": [ "application/json"] | ||
}, | ||
"url":{ | ||
"paths":[ | ||
{ | ||
"path":"/_internal/desired_balance", | ||
"methods":[ | ||
"DELETE" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...in/java/org/elasticsearch/action/admin/cluster/allocation/DeleteDesiredBalanceAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
package org.elasticsearch.action.admin.cluster.allocation; | ||
|
||
import org.elasticsearch.action.ActionResponse; | ||
import org.elasticsearch.action.ActionType; | ||
|
||
public class DeleteDesiredBalanceAction extends ActionType<ActionResponse.Empty> { | ||
|
||
public static final DeleteDesiredBalanceAction INSTANCE = new DeleteDesiredBalanceAction(); | ||
public static final String NAME = "cluster:admin/desired_balance/reset"; | ||
|
||
DeleteDesiredBalanceAction() { | ||
super(NAME, in -> ActionResponse.Empty.INSTANCE); | ||
} | ||
} |
Oops, something went wrong.