Class CloseJobRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.ml.CloseJobRequest
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable public class CloseJobRequest extends RequestBase implements JsonpSerializable
Closes one or more anomaly detection jobs. A job can be opened and closed
multiple times throughout its lifecycle. A closed job cannot receive data or
perform analysis operations, but you can still explore and navigate results.
When you close a job, it runs housekeeping tasks such as pruning the model
history, flushing buffers, calculating final results and persisting the model
snapshots. Depending upon the size of the job, it could take several minutes
to close and the equivalent time to re-open. After it is closed, the job has
a minimal overhead on the cluster except for maintaining its meta data.
Therefore it is a best practice to close jobs that are no longer required to
process data. If you close an anomaly detection job whose datafeed is
running, the request first tries to stop the datafeed. This behavior is
equivalent to calling stop datafeed API with the same timeout and force
parameters as the close job request. When a datafeed that has a specified end
date stops, it automatically closes its associated job.
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CloseJobRequest.Builder
Builder forCloseJobRequest
.Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>>
-
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<CloseJobRequest>
_DESERIALIZER
Json deserializer forCloseJobRequest
static Endpoint<CloseJobRequest,CloseJobResponse,ErrorResponse>
_ENDPOINT
Endpoint "ml.close_job
". -
Method Summary
Modifier and Type Method Description java.lang.Boolean
allowNoJobs()
Deprecated.java.lang.Boolean
allowNoMatch()
Refer to the description for theallow_no_match
query parameter.java.lang.Boolean
force()
Refer to the descriptiion for theforce
query parameter.java.lang.String
jobId()
Required - Identifier for the anomaly detection job.static CloseJobRequest
of(java.util.function.Function<CloseJobRequest.Builder,ObjectBuilder<CloseJobRequest>> fn)
void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
Serialize this object to JSON.protected void
serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
protected static void
setupCloseJobRequestDeserializer(ObjectDeserializer<CloseJobRequest.Builder> op)
Time
timeout()
Refer to the description for thetimeout
query parameter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
_DESERIALIZER
Json deserializer forCloseJobRequest
-
_ENDPOINT
Endpoint "ml.close_job
".
-
-
Method Details
-
of
public static CloseJobRequest of(java.util.function.Function<CloseJobRequest.Builder,ObjectBuilder<CloseJobRequest>> fn) -
allowNoJobs
@Deprecated @Nullable public final java.lang.Boolean allowNoJobs()Deprecated.7.10.0 Useallow_no_match
instead.Whether to ignore if a wildcard expression matches no jobs. (This includes_all
string or when no jobs have been specified)API name:
allow_no_jobs
-
allowNoMatch
@Nullable public final java.lang.Boolean allowNoMatch()Refer to the description for theallow_no_match
query parameter.API name:
allow_no_match
-
force
@Nullable public final java.lang.Boolean force()Refer to the descriptiion for theforce
query parameter.API name:
force
-
jobId
public final java.lang.String jobId()Required - Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using_all
or by specifying*
as the job identifier.API name:
job_id
-
timeout
Refer to the description for thetimeout
query parameter.API name:
timeout
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
setupCloseJobRequestDeserializer
protected static void setupCloseJobRequestDeserializer(ObjectDeserializer<CloseJobRequest.Builder> op)
-
allow_no_match
instead.