Skip to content
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

Resurrect _xpack/migration/deprecations routes #75947

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ tasks.named("transformV7RestTests").configure({ task ->
task.replaceKeyInDo("license.post_start_trial", "xpack-license.post_start_trial")
task.addAllowedWarningRegex(".*_xpack/license.* is deprecated.*")

task.replaceKeyInDo("migration.deprecations", "xpack-migration.deprecations")
task.addAllowedWarningRegex(".*_xpack/migration.* is deprecated.*")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could apply to the test that is using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #75950, there's only one test that's using the change ("Test get SSL certificates") so it's straightforward to limit ourselves to just the one test. Here, though, there's two ("Test Deprecations" and "Test ml") so I don't think it's worth the additional lines of code to limit ourselves.

I'm going to merge this as is, but if you disagree strongly we can always tweak change it as a new PR against master.


task.replaceKeyInDo("rollup.delete_job", "xpack-rollup.delete_job")
task.replaceKeyInDo("rollup.get_jobs", "xpack-rollup.get_jobs")
task.replaceKeyInDo("rollup.get_rollup_caps", "xpack-rollup.get_rollup_caps")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
Expand All @@ -23,8 +24,11 @@ public class RestDeprecationInfoAction extends BaseRestHandler {
@Override
public List<Route> routes() {
return List.of(
new Route(GET, "/_migration/deprecations"),
new Route(GET, "/{index}/_migration/deprecations"));
Route.builder(GET, "/_migration/deprecations")
.replaces(GET, "/_xpack/migration/deprecations", RestApiVersion.V_7).build(),
Route.builder(GET, "/{index}/_migration/deprecations")
.replaces(GET, "/{index}/_xpack/migration/deprecations", RestApiVersion.V_7).build()
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"xpack-migration.deprecations":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html",
"description":"Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version."
},
"stability":"stable",
"visibility":"public",
"headers":{
"accept": [ "application/json"]
},
"url":{
"paths":[
{
"path":"/_xpack/migration/deprecations",
"methods":[
"GET"
],
"deprecated":{
"version":"7.0.0",
"description":"all _xpack prefix have been deprecated"
}
},
{
"path":"/{index}/_xpack/migration/deprecations",
"methods":[
"GET"
],
"parts":{
"index":{
"type":"string",
"description":"Index pattern"
}
},
"deprecated":{
"version":"7.0.0",
"description":"all _xpack prefix have been deprecated"
}
}
]
},
"params":{}
}
}