Provides the ability to update an anomaly detection job.
It accepts a
UpdateJobRequest object and responds with a
UpdateJobRequest object gets created with a
JobUpdate object has many optional arguments with which to update an
existing anomaly detection job. An existing, non-null
jobId must be referenced in its
JobUpdate update = new JobUpdate.Builder(jobId) .setDescription("My description") .setAnalysisLimits(new AnalysisLimits(1000L, null)) .setBackgroundPersistInterval(TimeValue.timeValueHours(3)) .setCategorizationFilters(Arrays.asList("categorization-filter")) .setDetectorUpdates(Arrays.asList(detectorUpdate)) .setGroups(Arrays.asList("job-group-1")) .setResultsRetentionDays(10L) .setModelPlotConfig(new ModelPlotConfig(true, null, true)) .setModelSnapshotRetentionDays(7L) .setCustomSettings(customSettings) .setRenormalizationWindowDays(3L) .build();
Updated analysis limits.
Updated background persistence interval.
Updated analysis config’s categorization filters.
Updated detectors through the
Updated group membership.
Updated result retention.
Updated model plot configuration.
Updated model snapshot retention setting.
Updated custom settings.
Updated renormalization window.
Included with these options are specific optional
When executing a
UpdateJobRequest in the following manner, the client waits
PutJobResponse to be returned before continuing with code execution:
PutJobResponse updateJobResponse = client.machineLearning().updateJob(updateJobRequest, RequestOptions.DEFAULT);
Synchronous calls may throw an
IOException in case of either failing to
parse the REST response in the high-level REST client, the request times out
or similar cases where there is no response coming back from the server.
In cases where the server returns a
5xx error code, the high-level
client tries to parse the response body error details instead and then throws
ElasticsearchException and adds the original
ResponseException as a
suppressed exception to it.
UpdateJobRequest can also be done in an asynchronous fashion so that
the client can return directly. Users need to specify how the response or
potential failures will be handled by passing the request and a listener to the
asynchronous update-job method:
The asynchronous method does not block and returns immediately. Once it is
ActionListener is called back using the
if the execution successfully completed or using the
onFailure method if
it failed. Failure scenarios and expected exceptions are the same as in the
synchronous execution case.
A typical listener for
update-job looks like:
PutJobResponse contains the updated