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

[7.x] [ML][Inference] minor fixes for created_by, and action permission (#50890) #50911

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class PutTrainedModelAction extends ActionType<PutTrainedModelAction.Response> {

public static final PutTrainedModelAction INSTANCE = new PutTrainedModelAction();
public static final String NAME = "cluster:monitor/xpack/ml/inference/put";
public static final String NAME = "cluster:admin/xpack/ml/inference/put";
private PutTrainedModelAction() {
super(NAME, Response::new);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.elasticsearch.xpack.core.ml.inference.TrainedModelDefinition;
import org.elasticsearch.xpack.core.ml.inference.TrainedModelInput;
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
import org.elasticsearch.xpack.core.security.user.XPackUser;
import org.elasticsearch.xpack.ml.dataframe.DataFrameAnalyticsTask.ProgressTracker;
import org.elasticsearch.xpack.ml.dataframe.process.results.AnalyticsResult;
import org.elasticsearch.xpack.ml.dataframe.process.results.RowResults;
Expand Down Expand Up @@ -173,7 +174,7 @@ private TrainedModelConfig createTrainedModelConfig(TrainedModelDefinition.Build
.collect(toList());
return TrainedModelConfig.builder()
.setModelId(modelId)
.setCreatedBy("data-frame-analytics")
.setCreatedBy(XPackUser.NAME)
.setVersion(Version.CURRENT)
.setCreateTime(createTime)
.setTags(Collections.singletonList(analytics.getId()))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"model_id" : "lang_ident_model_1",
"created_by" : "ml_admin",
"created_by" : "_xpack",
"version" : "7.6.0",
"description" : "Model used for identifying language from arbitrary input text.",
"create_time" : 1575548914594,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.elasticsearch.xpack.core.ml.inference.TrainedModelConfig;
import org.elasticsearch.xpack.core.ml.inference.TrainedModelDefinition;
import org.elasticsearch.xpack.core.ml.inference.TrainedModelDefinitionTests;
import org.elasticsearch.xpack.core.security.user.XPackUser;
import org.elasticsearch.xpack.ml.dataframe.DataFrameAnalyticsTask.ProgressTracker;
import org.elasticsearch.xpack.ml.dataframe.process.results.AnalyticsResult;
import org.elasticsearch.xpack.ml.dataframe.process.results.RowResults;
Expand Down Expand Up @@ -167,7 +168,7 @@ public void testProcess_GivenInferenceModelIsStoredSuccessfully() {
assertThat(storedModel.getLicenseLevel(), equalTo(License.OperationMode.PLATINUM));
assertThat(storedModel.getModelId(), containsString(JOB_ID));
assertThat(storedModel.getVersion(), equalTo(Version.CURRENT));
assertThat(storedModel.getCreatedBy(), equalTo("data-frame-analytics"));
assertThat(storedModel.getCreatedBy(), equalTo(XPackUser.NAME));
assertThat(storedModel.getTags(), contains(JOB_ID));
assertThat(storedModel.getDescription(), equalTo(JOB_DESCRIPTION));
assertThat(storedModel.getModelDefinition(), equalTo(inferenceModel.build()));
Expand Down