Class ElasticsearchTransformClient
- All Implemented Interfaces:
- Closeable,- AutoCloseable
- 
Field SummaryFields inherited from class co.elastic.clients.ApiClienttransport, transportOptions
- 
Constructor SummaryConstructorsConstructorDescriptionElasticsearchTransformClient(ElasticsearchTransport transport, TransportOptions transportOptions) 
- 
Method SummaryModifier and TypeMethodDescriptiondeleteTransform(DeleteTransformRequest request) Delete a transform.final DeleteTransformResponseDelete a transform.Get transforms.getTransform(GetTransformRequest request) Get transforms.final GetTransformResponseGet transforms.Get transform stats.getTransformStats(Function<GetTransformStatsRequest.Builder, ObjectBuilder<GetTransformStatsRequest>> fn) Get transform stats.previewTransform(PreviewTransformRequest request) Overload ofpreviewTransform(PreviewTransformRequest, Class), where Class is defined as Void, meaning the documents will not be deserialized.<TTransform>
 PreviewTransformResponse<TTransform>previewTransform(PreviewTransformRequest request, Class<TTransform> tTransformClass) Preview a transform.<TTransform>
 PreviewTransformResponse<TTransform>previewTransform(PreviewTransformRequest request, Type tTransformType) Preview a transform.final PreviewTransformResponse<Void>previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn) Overload ofpreviewTransform(Function, Class), where Class is defined as Void, meaning the documents will not be deserialized.final <TTransform>
 PreviewTransformResponse<TTransform>previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Class<TTransform> tTransformClass) Preview a transform.final <TTransform>
 PreviewTransformResponse<TTransform>previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Type tTransformType) Preview a transform.putTransform(PutTransformRequest request) Create a transform.final PutTransformResponseCreate a transform.resetTransform(ResetTransformRequest request) Reset a transform.final ResetTransformResponseReset a transform.Schedule a transform to start now.scheduleNowTransform(Function<ScheduleNowTransformRequest.Builder, ObjectBuilder<ScheduleNowTransformRequest>> fn) Schedule a transform to start now.Set upgrade_mode for transform indices.setUpgradeMode(SetUpgradeModeRequest request) Set upgrade_mode for transform indices.final SetUpgradeModeResponseSet upgrade_mode for transform indices.startTransform(StartTransformRequest request) Start a transform.final StartTransformResponseStart a transform.stopTransform(StopTransformRequest request) Stop transforms.final StopTransformResponseStop transforms.updateTransform(UpdateTransformRequest request) Update a transform.final UpdateTransformResponseUpdate a transform.Upgrade all transforms.Upgrade all transforms.upgradeTransforms(Function<UpgradeTransformsRequest.Builder, ObjectBuilder<UpgradeTransformsRequest>> fn) Upgrade all transforms.withTransportOptions(TransportOptions transportOptions) Creates a new client with some request optionsMethods inherited from class co.elastic.clients.ApiClient_jsonpMapper, _transport, _transportOptions, close, getDeserializer, withTransportOptions
- 
Constructor Details- 
ElasticsearchTransformClient
- 
ElasticsearchTransformClientpublic ElasticsearchTransformClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) 
 
- 
- 
Method Details- 
withTransportOptionspublic ElasticsearchTransformClient withTransportOptions(@Nullable TransportOptions transportOptions) Description copied from class:ApiClientCreates a new client with some request options- Specified by:
- withTransportOptionsin class- ApiClient<ElasticsearchTransport,- ElasticsearchTransformClient> 
 
- 
deleteTransformpublic DeleteTransformResponse deleteTransform(DeleteTransformRequest request) throws IOException, ElasticsearchException Delete a transform.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
deleteTransformpublic final DeleteTransformResponse deleteTransform(Function<DeleteTransformRequest.Builder, ObjectBuilder<DeleteTransformRequest>> fn) throws IOException, ElasticsearchExceptionDelete a transform.- Parameters:
- fn- a function that initializes a builder to create the- DeleteTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getTransformpublic GetTransformResponse getTransform(GetTransformRequest request) throws IOException, ElasticsearchException Get transforms. Get configuration information for transforms.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getTransformpublic final GetTransformResponse getTransform(Function<GetTransformRequest.Builder, ObjectBuilder<GetTransformRequest>> fn) throws IOException, ElasticsearchExceptionGet transforms. Get configuration information for transforms.- Parameters:
- fn- a function that initializes a builder to create the- GetTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getTransformGet transforms. Get configuration information for transforms.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getTransformStatspublic GetTransformStatsResponse getTransformStats(GetTransformStatsRequest request) throws IOException, ElasticsearchException Get transform stats.Get usage information for transforms. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
getTransformStatspublic final GetTransformStatsResponse getTransformStats(Function<GetTransformStatsRequest.Builder, ObjectBuilder<GetTransformStatsRequest>> fn) throws IOException, ElasticsearchExceptionGet transform stats.Get usage information for transforms. - Parameters:
- fn- a function that initializes a builder to create the- GetTransformStatsRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
previewTransformpublic <TTransform> PreviewTransformResponse<TTransform> previewTransform(PreviewTransformRequest request, Class<TTransform> tTransformClass) throws IOException, ElasticsearchException Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.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:
- IOException
- ElasticsearchException
- See Also:
 
- 
previewTransformpublic final <TTransform> PreviewTransformResponse<TTransform> previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Class<TTransform> tTransformClass) throws IOException, ElasticsearchExceptionPreview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.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 the- PreviewTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
previewTransformpublic PreviewTransformResponse<Void> previewTransform(PreviewTransformRequest request) throws IOException, ElasticsearchException Overload ofpreviewTransform(PreviewTransformRequest, Class), where Class is defined as Void, meaning the documents will not be deserialized.- Throws:
- IOException
- ElasticsearchException
 
- 
previewTransformpublic final PreviewTransformResponse<Void> previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn) throws IOException, ElasticsearchExceptionOverload ofpreviewTransform(Function, Class), where Class is defined as Void, meaning the documents will not be deserialized.- Throws:
- IOException
- ElasticsearchException
 
- 
previewTransformpublic <TTransform> PreviewTransformResponse<TTransform> previewTransform(PreviewTransformRequest request, Type tTransformType) throws IOException, ElasticsearchException Preview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.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:
- IOException
- ElasticsearchException
- See Also:
 
- 
previewTransformpublic final <TTransform> PreviewTransformResponse<TTransform> previewTransform(Function<PreviewTransformRequest.Builder, ObjectBuilder<PreviewTransformRequest>> fn, Type tTransformType) throws IOException, ElasticsearchExceptionPreview a transform. Generates a preview of the results that you will get when you create a transform with the same configuration.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 the- PreviewTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
putTransformpublic PutTransformResponse putTransform(PutTransformRequest request) throws IOException, ElasticsearchException Create a transform. 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:
- IOException
- ElasticsearchException
- See Also:
 
- 
putTransformpublic final PutTransformResponse putTransform(Function<PutTransformRequest.Builder, ObjectBuilder<PutTransformRequest>> fn) throws IOException, ElasticsearchExceptionCreate a transform. 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.- Parameters:
- fn- a function that initializes a builder to create the- PutTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
resetTransformpublic ResetTransformResponse resetTransform(ResetTransformRequest request) throws IOException, ElasticsearchException Reset a transform.Before you can reset it, you must stop it; alternatively, use the forcequery parameter. If the destination index was created by the transform, it is deleted.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
resetTransformpublic final ResetTransformResponse resetTransform(Function<ResetTransformRequest.Builder, ObjectBuilder<ResetTransformRequest>> fn) throws IOException, ElasticsearchExceptionReset a transform.Before you can reset it, you must stop it; alternatively, use the forcequery parameter. If the destination index was created by the transform, it is deleted.- Parameters:
- fn- a function that initializes a builder to create the- ResetTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
scheduleNowTransformpublic ScheduleNowTransformResponse scheduleNowTransform(ScheduleNowTransformRequest request) throws IOException, ElasticsearchException Schedule a transform to start now.Instantly run a transform to process data. If you run this API, the transform will process the new data instantly, without waiting for the configured frequency interval. After the API is called, the transform will be processed again at now + frequencyunless the API is called again in the meantime.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
scheduleNowTransformpublic final ScheduleNowTransformResponse scheduleNowTransform(Function<ScheduleNowTransformRequest.Builder, ObjectBuilder<ScheduleNowTransformRequest>> fn) throws IOException, ElasticsearchExceptionSchedule a transform to start now.Instantly run a transform to process data. If you run this API, the transform will process the new data instantly, without waiting for the configured frequency interval. After the API is called, the transform will be processed again at now + frequencyunless the API is called again in the meantime.- Parameters:
- fn- a function that initializes a builder to create the- ScheduleNowTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
setUpgradeModepublic SetUpgradeModeResponse setUpgradeMode(SetUpgradeModeRequest request) throws IOException, ElasticsearchException Set upgrade_mode for transform indices. Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your transform indices. In those circumstances, there must be no transforms running. You can close the transforms, do the upgrade, then open all the transforms again. Alternatively, you can use this API to temporarily halt tasks associated with the transforms and prevent new transforms from opening. You can also use this API during upgrades that do not require you to reindex your transform indices, though stopping transforms is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get transform info API.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
setUpgradeModepublic final SetUpgradeModeResponse setUpgradeMode(Function<SetUpgradeModeRequest.Builder, ObjectBuilder<SetUpgradeModeRequest>> fn) throws IOException, ElasticsearchExceptionSet upgrade_mode for transform indices. Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your transform indices. In those circumstances, there must be no transforms running. You can close the transforms, do the upgrade, then open all the transforms again. Alternatively, you can use this API to temporarily halt tasks associated with the transforms and prevent new transforms from opening. You can also use this API during upgrades that do not require you to reindex your transform indices, though stopping transforms is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get transform info API.- Parameters:
- fn- a function that initializes a builder to create the- SetUpgradeModeRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
setUpgradeModeSet upgrade_mode for transform indices. Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. When upgrading your cluster, in some circumstances you must restart your nodes and reindex your transform indices. In those circumstances, there must be no transforms running. You can close the transforms, do the upgrade, then open all the transforms again. Alternatively, you can use this API to temporarily halt tasks associated with the transforms and prevent new transforms from opening. You can also use this API during upgrades that do not require you to reindex your transform indices, though stopping transforms is not a requirement in that case. You can see the current value for the upgrade_mode setting by using the get transform info API.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
startTransformpublic StartTransformResponse startTransform(StartTransformRequest request) throws IOException, ElasticsearchException Start 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:
- IOException
- ElasticsearchException
- See Also:
 
- 
startTransformpublic final StartTransformResponse startTransform(Function<StartTransformRequest.Builder, ObjectBuilder<StartTransformRequest>> fn) throws IOException, ElasticsearchExceptionStart 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 the- StartTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
stopTransformpublic StopTransformResponse stopTransform(StopTransformRequest request) throws IOException, ElasticsearchException Stop transforms. Stops one or more transforms.- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
stopTransformpublic final StopTransformResponse stopTransform(Function<StopTransformRequest.Builder, ObjectBuilder<StopTransformRequest>> fn) throws IOException, ElasticsearchExceptionStop transforms. Stops one or more transforms.- Parameters:
- fn- a function that initializes a builder to create the- StopTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
updateTransformpublic UpdateTransformResponse updateTransform(UpdateTransformRequest request) throws IOException, ElasticsearchException Update a transform. 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:
- IOException
- ElasticsearchException
- See Also:
 
- 
updateTransformpublic final UpdateTransformResponse updateTransform(Function<UpdateTransformRequest.Builder, ObjectBuilder<UpdateTransformRequest>> fn) throws IOException, ElasticsearchExceptionUpdate a transform. 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.- Parameters:
- fn- a function that initializes a builder to create the- UpdateTransformRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
upgradeTransformspublic UpgradeTransformsResponse upgradeTransforms(UpgradeTransformsRequest request) throws IOException, ElasticsearchException Upgrade all transforms.Transforms are compatible across minor versions and between supported major versions. However, over time, the format of transform configuration information may change. 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. If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue. Resolve the issue then re-run the process again. A summary is returned when the upgrade is finished. To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster. You may want to perform a recent cluster backup prior to the upgrade. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
upgradeTransformspublic final UpgradeTransformsResponse upgradeTransforms(Function<UpgradeTransformsRequest.Builder, ObjectBuilder<UpgradeTransformsRequest>> fn) throws IOException, ElasticsearchExceptionUpgrade all transforms.Transforms are compatible across minor versions and between supported major versions. However, over time, the format of transform configuration information may change. 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. If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue. Resolve the issue then re-run the process again. A summary is returned when the upgrade is finished. To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster. You may want to perform a recent cluster backup prior to the upgrade. - Parameters:
- fn- a function that initializes a builder to create the- UpgradeTransformsRequest
- Throws:
- IOException
- ElasticsearchException
- See Also:
 
- 
upgradeTransformsUpgrade all transforms.Transforms are compatible across minor versions and between supported major versions. However, over time, the format of transform configuration information may change. 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. If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue. Resolve the issue then re-run the process again. A summary is returned when the upgrade is finished. To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster. You may want to perform a recent cluster backup prior to the upgrade. - Throws:
- IOException
- ElasticsearchException
- See Also:
 
 
-