-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate the 'local' parameter of /_cat/indices
#62198
Changes from 1 commit
4687421
00e4e36
4a4604b
8f01c02
a1376c7
742df9f
9021609
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,11 @@ | |
}, | ||
"local":{ | ||
"type":"boolean", | ||
"description":"Return local information, do not retrieve the state from master node (default: false)" | ||
"description":"Return local information, do not retrieve the state from master node (default: false)", | ||
"deprecated":{ | ||
"version":"8.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be the release in which we deprecate the parameter? That should be before 8.0.0. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We typically update the version when backporting to a release branch and then come back and update the master branch. |
||
"description":"This parameter does not cause this API to act locally." | ||
} | ||
}, | ||
"master_timeout":{ | ||
"type":"time", | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -39,6 +39,7 @@ | |||||||
import org.elasticsearch.cluster.metadata.IndexMetadata; | ||||||||
import org.elasticsearch.common.Strings; | ||||||||
import org.elasticsearch.common.Table; | ||||||||
import org.elasticsearch.common.logging.DeprecationLogger; | ||||||||
import org.elasticsearch.common.settings.Settings; | ||||||||
import org.elasticsearch.common.time.DateFormatter; | ||||||||
import org.elasticsearch.common.unit.TimeValue; | ||||||||
|
@@ -66,6 +67,9 @@ | |||||||
import static org.elasticsearch.rest.RestRequest.Method.GET; | ||||||||
|
||||||||
public class RestIndicesAction extends AbstractCatAction { | ||||||||
private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(RestIndicesAction.class); | ||||||||
static final String LOCAL_DEPRECATED_MESSAGE = "Deprecated parameter [local] used. This parameter does not cause this API to act " + | ||||||||
"locally, and should not be used. It will be unsupported in version 8.0."; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
private static final DateFormatter STRICT_DATE_TIME_FORMATTER = DateFormatter.forPattern("strict_date_time"); | ||||||||
|
||||||||
|
@@ -91,6 +95,9 @@ protected void documentation(StringBuilder sb) { | |||||||
public RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { | ||||||||
final String[] indices = Strings.splitStringByCommaToArray(request.param("index")); | ||||||||
final IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, IndicesOptions.strictExpand()); | ||||||||
if (request.hasParam("local")) { | ||||||||
DEPRECATION_LOGGER.deprecate("local", LOCAL_DEPRECATED_MESSAGE); | ||||||||
} | ||||||||
final boolean local = request.paramAsBoolean("local", false); | ||||||||
final TimeValue masterNodeTimeout = request.paramAsTime("master_timeout", DEFAULT_MASTER_NODE_TIMEOUT); | ||||||||
final boolean includeUnloadedSegments = request.paramAsBoolean("include_unloaded_segments", false); | ||||||||
|
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.
This creates two entries for the
local
parameter, one pulled from thecommon-parms
file and this one. I'll solicit some input from our documentation writers on how best to handle this.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.
@jrodewig, do you have any suggestions on how to handle this documentation case where a parameter pulled in from a common file needs to be marked as deprecated on a specific API?
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.
I left a suggestion here: #62198 (comment)