Class PreviewDatafeedRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.ml.PreviewDatafeedRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable
public class PreviewDatafeedRequest
extends RequestBase
implements JsonpSerializable
Previews a datafeed. This API returns the first "page" of search results from a datafeed. You can preview an existing datafeed or provide configuration details for a datafeed and anomaly detection job in the API. The preview shows the structure of the data that will be passed to the anomaly detection engine. IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. You can also use secondary authorization headers to supply the credentials.
See Also:
API specification
  • Field Details

  • Method Details

    • of

      public static PreviewDatafeedRequest of​(java.util.function.Function<PreviewDatafeedRequest.Builder,​ObjectBuilder<PreviewDatafeedRequest>> fn)
    • datafeedConfig

      @Nullable public final DatafeedConfig datafeedConfig()
      The datafeed definition to preview.

      API name: datafeed_config

    • datafeedId

      @Nullable public final java.lang.String datafeedId()
      A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job configuration details in the request body.

      API name: datafeed_id

    • jobConfig

      @Nullable public final JobConfig jobConfig()
      The configuration details for the anomaly detection job that is associated with the datafeed. If the datafeed_config object does not include a job_id that references an existing anomaly detection job, you must supply this job_config object. If you include both a job_id and a job_config, the latter information is used. You cannot specify a job_config object unless you also supply a datafeed_config object.

      API name: job_config

    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupPreviewDatafeedRequestDeserializer

      protected static void setupPreviewDatafeedRequestDeserializer​(ObjectDeserializer<PreviewDatafeedRequest.Builder> op)
    • createPreviewDatafeedEndpoint

      public static <TDocument> Endpoint<PreviewDatafeedRequest,​PreviewDatafeedResponse<TDocument>,​ErrorResponse> createPreviewDatafeedEndpoint​(JsonpDeserializer<TDocument> tDocumentDeserializer)
      Create an "ml.preview_datafeed" endpoint.