Class ElasticsearchTransformClient
-
Field Summary
Fields inherited from class co.elastic.clients.ApiClient
transport, transportOptions -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchTransformClient(ElasticsearchTransport transport, TransportOptions transportOptions) -
Method Summary
Modifier and TypeMethodDescriptiondeleteTransform(DeleteTransformRequest request) Deletes a transform.final DeleteTransformResponseDeletes a transform.Retrieves configuration information for transforms.getTransform(GetTransformRequest request) Retrieves configuration information for transforms.final GetTransformResponseRetrieves configuration information for transforms.Retrieves usage information for transforms.getTransformStats(Function<GetTransformStatsRequest.Builder, ObjectBuilder<GetTransformStatsRequest>> fn) Retrieves usage information for transforms.<TTransform>
PreviewTransformResponse<TTransform>previewTransform(PreviewTransformRequest request, Class<TTransform> tTransformClass) Previews a transform.<TTransform>
PreviewTransformResponse<TTransform>previewTransform(PreviewTransformRequest request, Type tTransformType) Previews a transform.final <TTransform>
PreviewTransformResponse<TTransform>previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Class<TTransform> tTransformClass) Previews a transform.final <TTransform>
PreviewTransformResponse<TTransform>previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Type tTransformType) Previews a transform.putTransform(PutTransformRequest request) Creates a transform.final PutTransformResponseCreates a transform.resetTransform(ResetTransformRequest request) Resets a transform.final ResetTransformResponseResets a transform.Schedules now a transform.scheduleNowTransform(Function<ScheduleNowTransformRequest.Builder, ObjectBuilder<ScheduleNowTransformRequest>> fn) Schedules now a transform.startTransform(StartTransformRequest request) Starts a transform.final StartTransformResponseStarts a transform.stopTransform(StopTransformRequest request) Stops one or more transforms.final StopTransformResponseStops one or more transforms.updateTransform(UpdateTransformRequest request) Updates certain properties of a transform.final UpdateTransformResponseUpdates certain properties of a transform.Upgrades all transforms.Upgrades all transforms.upgradeTransforms(Function<UpgradeTransformsRequest.Builder, ObjectBuilder<UpgradeTransformsRequest>> fn) Upgrades all transforms.withTransportOptions(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient
_jsonpMapper, _transport, _transportOptions, getDeserializer, withTransportOptions
-
Constructor Details
-
ElasticsearchTransformClient
-
ElasticsearchTransformClient
public ElasticsearchTransformClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions)
-
-
Method Details
-
withTransportOptions
public ElasticsearchTransformClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClientCreates a new client with some request options- Specified by:
withTransportOptionsin classApiClient<ElasticsearchTransport,ElasticsearchTransformClient>
-
deleteTransform
public DeleteTransformResponse deleteTransform(DeleteTransformRequest request) throws IOException, ElasticsearchException Deletes a transform.- Throws:
IOExceptionElasticsearchException- See Also:
-
deleteTransform
public final DeleteTransformResponse deleteTransform(Function<DeleteTransformRequest.Builder, ObjectBuilder<DeleteTransformRequest>> fn) throws IOException, ElasticsearchExceptionDeletes a transform.- Parameters:
fn- a function that initializes a builder to create theDeleteTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
getTransform
public GetTransformResponse getTransform(GetTransformRequest request) throws IOException, ElasticsearchException Retrieves configuration information for transforms.- Throws:
IOExceptionElasticsearchException- See Also:
-
getTransform
public final GetTransformResponse getTransform(Function<GetTransformRequest.Builder, ObjectBuilder<GetTransformRequest>> fn) throws IOException, ElasticsearchExceptionRetrieves configuration information for transforms.- Parameters:
fn- a function that initializes a builder to create theGetTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
getTransform
Retrieves configuration information for transforms.- Throws:
IOExceptionElasticsearchException- See Also:
-
getTransformStats
public GetTransformStatsResponse getTransformStats(GetTransformStatsRequest request) throws IOException, ElasticsearchException Retrieves usage information for transforms.- Throws:
IOExceptionElasticsearchException- See Also:
-
getTransformStats
public final GetTransformStatsResponse getTransformStats(Function<GetTransformStatsRequest.Builder, ObjectBuilder<GetTransformStatsRequest>> fn) throws IOException, ElasticsearchExceptionRetrieves usage information for transforms.- Parameters:
fn- a function that initializes a builder to create theGetTransformStatsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
previewTransform
public <TTransform> PreviewTransformResponse<TTransform> previewTransform(PreviewTransformRequest request, Class<TTransform> tTransformClass) throws IOException, ElasticsearchException Previews a transform.It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
- Throws:
IOExceptionElasticsearchException- See Also:
-
previewTransform
public final <TTransform> PreviewTransformResponse<TTransform> previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Class<TTransform> tTransformClass) throws IOException, ElasticsearchExceptionPreviews a transform.It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
- Parameters:
fn- a function that initializes a builder to create thePreviewTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
previewTransform
public <TTransform> PreviewTransformResponse<TTransform> previewTransform(PreviewTransformRequest request, Type tTransformType) throws IOException, ElasticsearchException Previews a transform.It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
- Throws:
IOExceptionElasticsearchException- See Also:
-
previewTransform
public final <TTransform> PreviewTransformResponse<TTransform> previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Type tTransformType) throws IOException, ElasticsearchExceptionPreviews a transform.It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also generates a list of mappings and settings for the destination index. These values are determined based on the field types of the source index and the transform aggregations.
- Parameters:
fn- a function that initializes a builder to create thePreviewTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
putTransform
public PutTransformResponse putTransform(PutTransformRequest request) throws IOException, ElasticsearchException Creates a transform.A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity.
You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of
group_byfields in the pivot object. If you choose to use the latest method, the entities are defined by theunique_keyfield values in the latest object.You must have
create_index,index, andreadprivileges on the destination index andreadandview_index_metadataprivileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
.transform-internal*indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on.transform-internal*indices. If you used transforms prior to 7.5, also do not give users any privileges on.data-frame-internal*indices.- Throws:
IOExceptionElasticsearchException- See Also:
-
putTransform
public final PutTransformResponse putTransform(Function<PutTransformRequest.Builder, ObjectBuilder<PutTransformRequest>> fn) throws IOException, ElasticsearchExceptionCreates a transform.A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a unique row per entity.
You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If you choose to use the pivot method for your transform, the entities are defined by the set of
group_byfields in the pivot object. If you choose to use the latest method, the entities are defined by theunique_keyfield values in the latest object.You must have
create_index,index, andreadprivileges on the destination index andreadandview_index_metadataprivileges on the source indices. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any
.transform-internal*indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do not give users any privileges on.transform-internal*indices. If you used transforms prior to 7.5, also do not give users any privileges on.data-frame-internal*indices.- Parameters:
fn- a function that initializes a builder to create thePutTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
resetTransform
public ResetTransformResponse resetTransform(ResetTransformRequest request) throws IOException, ElasticsearchException Resets a transform. Before you can reset it, you must stop it; alternatively, use theforcequery parameter. If the destination index was created by the transform, it is deleted.- Throws:
IOExceptionElasticsearchException- See Also:
-
resetTransform
public final ResetTransformResponse resetTransform(Function<ResetTransformRequest.Builder, ObjectBuilder<ResetTransformRequest>> fn) throws IOException, ElasticsearchExceptionResets a transform. Before you can reset it, you must stop it; alternatively, use theforcequery parameter. If the destination index was created by the transform, it is deleted.- Parameters:
fn- a function that initializes a builder to create theResetTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
scheduleNowTransform
public ScheduleNowTransformResponse scheduleNowTransform(ScheduleNowTransformRequest request) throws IOException, ElasticsearchException Schedules now a transform.If you _schedule_now a transform, it will process the new data instantly, without waiting for the configured frequency interval. After _schedule_now API is called, the transform will be processed again at now + frequency unless _schedule_now API is called again in the meantime.
- Throws:
IOExceptionElasticsearchException- See Also:
-
scheduleNowTransform
public final ScheduleNowTransformResponse scheduleNowTransform(Function<ScheduleNowTransformRequest.Builder, ObjectBuilder<ScheduleNowTransformRequest>> fn) throws IOException, ElasticsearchExceptionSchedules now a transform.If you _schedule_now a transform, it will process the new data instantly, without waiting for the configured frequency interval. After _schedule_now API is called, the transform will be processed again at now + frequency unless _schedule_now API is called again in the meantime.
- Parameters:
fn- a function that initializes a builder to create theScheduleNowTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
startTransform
public StartTransformResponse startTransform(StartTransformRequest request) throws IOException, ElasticsearchException Starts a transform.When you start a transform, it creates the destination index if it does not already exist. The
number_of_shardsis set to1and theauto_expand_replicasis set to0-1. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case ofscripted_metricorbucket_scriptaggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform.When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.
- Throws:
IOExceptionElasticsearchException- See Also:
-
startTransform
public final StartTransformResponse startTransform(Function<StartTransformRequest.Builder, ObjectBuilder<StartTransformRequest>> fn) throws IOException, ElasticsearchExceptionStarts a transform.When you start a transform, it creates the destination index if it does not already exist. The
number_of_shardsis set to1and theauto_expand_replicasis set to0-1. If it is a pivot transform, it deduces the mapping definitions for the destination index from the source indices and the transform aggregations. If fields in the destination index are derived from scripts (as in the case ofscripted_metricorbucket_scriptaggregations), the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings in a pivot transform.When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you created the transform, they occur when you start the transform—with the exception of privilege checks. When Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the time of creation and uses those same roles. If those roles do not have the required privileges on the source and destination indices, the transform fails when it attempts unauthorized operations.
- Parameters:
fn- a function that initializes a builder to create theStartTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
stopTransform
public StopTransformResponse stopTransform(StopTransformRequest request) throws IOException, ElasticsearchException Stops one or more transforms.- Throws:
IOExceptionElasticsearchException- See Also:
-
stopTransform
public final StopTransformResponse stopTransform(Function<StopTransformRequest.Builder, ObjectBuilder<StopTransformRequest>> fn) throws IOException, ElasticsearchExceptionStops one or more transforms.- Parameters:
fn- a function that initializes a builder to create theStopTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
updateTransform
public UpdateTransformResponse updateTransform(UpdateTransformRequest request) throws IOException, ElasticsearchException Updates certain properties of a transform.All updated properties except
descriptiondo not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must havereadandview_index_metadataprivileges for the source indices. You must also haveindexandreadprivileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges.- Throws:
IOExceptionElasticsearchException- See Also:
-
updateTransform
public final UpdateTransformResponse updateTransform(Function<UpdateTransformRequest.Builder, ObjectBuilder<UpdateTransformRequest>> fn) throws IOException, ElasticsearchExceptionUpdates certain properties of a transform.All updated properties except
descriptiondo not take effect until after the transform starts the next checkpoint, thus there is data consistency in each checkpoint. To use this API, you must havereadandview_index_metadataprivileges for the source indices. You must also haveindexandreadprivileges for the destination index. When Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the time of update and runs with those privileges.- Parameters:
fn- a function that initializes a builder to create theUpdateTransformRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
upgradeTransforms
public UpgradeTransformsResponse upgradeTransforms(UpgradeTransformsRequest request) throws IOException, ElasticsearchException Upgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.- Throws:
IOExceptionElasticsearchException- See Also:
-
upgradeTransforms
public final UpgradeTransformsResponse upgradeTransforms(Function<UpgradeTransformsRequest.Builder, ObjectBuilder<UpgradeTransformsRequest>> fn) throws IOException, ElasticsearchExceptionUpgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.- Parameters:
fn- a function that initializes a builder to create theUpgradeTransformsRequest- Throws:
IOExceptionElasticsearchException- See Also:
-
upgradeTransforms
Upgrades all transforms. This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. It also cleans up the internal data structures that store the transform state and checkpoints. The upgrade does not affect the source and destination indices. The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged.- Throws:
IOExceptionElasticsearchException- See Also:
-