-
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.
[7.x] [ML][HLRC] adds put and delete trained model alias APIs to rest…
… high-level client (#69214) (#69297) * [ML][HLRC] adds put and delete trained model alias APIs to rest high-level client (#69214) adds put (and reassign) and delete trained model alias APIs to the rest high-level client. This adds some serialization objects and request wrappers.
- Loading branch information
Showing
10 changed files
with
557 additions
and
0 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
47 changes: 47 additions & 0 deletions
47
...-high-level/src/main/java/org/elasticsearch/client/ml/DeleteTrainedModelAliasRequest.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,47 @@ | ||
/* | ||
* 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.client.ml; | ||
|
||
import org.elasticsearch.client.Validatable; | ||
|
||
import java.util.Objects; | ||
|
||
public class DeleteTrainedModelAliasRequest implements Validatable { | ||
|
||
private final String modelAlias; | ||
private final String modelId; | ||
|
||
public DeleteTrainedModelAliasRequest(String modelAlias, String modelId) { | ||
this.modelAlias = Objects.requireNonNull(modelAlias); | ||
this.modelId = Objects.requireNonNull(modelId); | ||
} | ||
|
||
public String getModelAlias() { | ||
return modelAlias; | ||
} | ||
|
||
public String getModelId() { | ||
return modelId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
DeleteTrainedModelAliasRequest request = (DeleteTrainedModelAliasRequest) o; | ||
return Objects.equals(modelAlias, request.modelAlias) | ||
&& Objects.equals(modelId, request.modelId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(modelAlias, modelId); | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
...est-high-level/src/main/java/org/elasticsearch/client/ml/PutTrainedModelAliasRequest.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,56 @@ | ||
/* | ||
* 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.client.ml; | ||
|
||
import org.elasticsearch.client.Validatable; | ||
|
||
import java.util.Objects; | ||
|
||
public class PutTrainedModelAliasRequest implements Validatable { | ||
|
||
public static final String REASSIGN = "reassign"; | ||
|
||
private final String modelAlias; | ||
private final String modelId; | ||
private final Boolean reassign; | ||
|
||
public PutTrainedModelAliasRequest(String modelAlias, String modelId, Boolean reassign) { | ||
this.modelAlias = Objects.requireNonNull(modelAlias); | ||
this.modelId = Objects.requireNonNull(modelId); | ||
this.reassign = reassign; | ||
} | ||
|
||
public String getModelAlias() { | ||
return modelAlias; | ||
} | ||
|
||
public String getModelId() { | ||
return modelId; | ||
} | ||
|
||
public Boolean getReassign() { | ||
return reassign; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
PutTrainedModelAliasRequest request = (PutTrainedModelAliasRequest) o; | ||
return Objects.equals(modelAlias, request.modelAlias) | ||
&& Objects.equals(modelId, request.modelId) | ||
&& Objects.equals(reassign, request.reassign); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(modelAlias, modelId, reassign); | ||
} | ||
|
||
} |
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
Oops, something went wrong.