|
23 | 23 | import org.elasticsearch.client.core.AcknowledgedResponse;
|
24 | 24 | import org.elasticsearch.client.dataframe.DeleteDataFrameTransformRequest;
|
25 | 25 | import org.elasticsearch.client.dataframe.PutDataFrameTransformRequest;
|
| 26 | +import org.elasticsearch.client.dataframe.StartDataFrameTransformRequest; |
| 27 | +import org.elasticsearch.client.dataframe.StartDataFrameTransformResponse; |
| 28 | +import org.elasticsearch.client.dataframe.StopDataFrameTransformRequest; |
| 29 | +import org.elasticsearch.client.dataframe.StopDataFrameTransformResponse; |
26 | 30 |
|
27 | 31 | import java.io.IOException;
|
28 | 32 | import java.util.Collections;
|
@@ -115,4 +119,85 @@ public void deleteDataFrameTransformAsync(DeleteDataFrameTransformRequest reques
|
115 | 119 | listener,
|
116 | 120 | Collections.emptySet());
|
117 | 121 | }
|
| 122 | + |
| 123 | + |
| 124 | + /** |
| 125 | + * Start a data frame transform |
| 126 | + * <p> |
| 127 | + * For additional info |
| 128 | + * see <a href="https://www.TODO.com">Start Data Frame transform documentation</a> |
| 129 | + * |
| 130 | + * @param request The start data frame transform request |
| 131 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 132 | + * @return A response object indicating request success |
| 133 | + * @throws IOException when there is a serialization issue sending the request or receiving the response |
| 134 | + */ |
| 135 | + public StartDataFrameTransformResponse startDataFrameTransform(StartDataFrameTransformRequest request, RequestOptions options) |
| 136 | + throws IOException { |
| 137 | + return restHighLevelClient.performRequestAndParseEntity(request, |
| 138 | + DataFrameRequestConverters::startDataFrameTransform, |
| 139 | + options, |
| 140 | + StartDataFrameTransformResponse::fromXContent, |
| 141 | + Collections.emptySet()); |
| 142 | + } |
| 143 | + |
| 144 | + /** |
| 145 | + * Start a data frame transform asynchronously and notifies listener on completion |
| 146 | + * <p> |
| 147 | + * For additional info |
| 148 | + * see <a href="https://www.TODO.com">Start Data Frame transform documentation</a> |
| 149 | + * |
| 150 | + * @param request The start data frame transform request |
| 151 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 152 | + * @param listener Listener to be notified upon request completion |
| 153 | + */ |
| 154 | + public void startDataFrameTransformAsync(StartDataFrameTransformRequest request, RequestOptions options, |
| 155 | + ActionListener<StartDataFrameTransformResponse> listener) { |
| 156 | + restHighLevelClient.performRequestAsyncAndParseEntity(request, |
| 157 | + DataFrameRequestConverters::startDataFrameTransform, |
| 158 | + options, |
| 159 | + StartDataFrameTransformResponse::fromXContent, |
| 160 | + listener, |
| 161 | + Collections.emptySet()); |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * Stop a data frame transform |
| 166 | + * <p> |
| 167 | + * For additional info |
| 168 | + * see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a> |
| 169 | + * |
| 170 | + * @param request The stop data frame transform request |
| 171 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 172 | + * @return A response object indicating request success |
| 173 | + * @throws IOException when there is a serialization issue sending the request or receiving the response |
| 174 | + */ |
| 175 | + public StopDataFrameTransformResponse stopDataFrameTransform(StopDataFrameTransformRequest request, RequestOptions options) |
| 176 | + throws IOException { |
| 177 | + return restHighLevelClient.performRequestAndParseEntity(request, |
| 178 | + DataFrameRequestConverters::stopDataFrameTransform, |
| 179 | + options, |
| 180 | + StopDataFrameTransformResponse::fromXContent, |
| 181 | + Collections.emptySet()); |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * Stop a data frame transform asynchronously and notifies listener on completion |
| 186 | + * <p> |
| 187 | + * For additional info |
| 188 | + * see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a> |
| 189 | + * |
| 190 | + * @param request The stop data frame transform request |
| 191 | + * @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized |
| 192 | + * @param listener Listener to be notified upon request completion |
| 193 | + */ |
| 194 | + public void stopDataFrameTransformAsync(StopDataFrameTransformRequest request, RequestOptions options, |
| 195 | + ActionListener<StopDataFrameTransformResponse> listener) { |
| 196 | + restHighLevelClient.performRequestAsyncAndParseEntity(request, |
| 197 | + DataFrameRequestConverters::stopDataFrameTransform, |
| 198 | + options, |
| 199 | + StopDataFrameTransformResponse::fromXContent, |
| 200 | + listener, |
| 201 | + Collections.emptySet()); |
| 202 | + } |
118 | 203 | }
|
0 commit comments