- Java REST Client (deprecated): other versions:
- Overview
- Java Low Level REST Client
- Java High Level REST Client
- Getting started
- Document APIs
- Search APIs
- Async Search APIs
- Miscellaneous APIs
- Index APIs
- Analyze API
- Create Index API
- Delete Index API
- Index Exists API
- Open Index API
- Close Index API
- Shrink Index API
- Split Index API
- Clone Index API
- Refresh API
- Flush API
- Flush Synced API
- Clear Cache API
- Force Merge API
- Rollover Index API
- Put Mapping API
- Get Mappings API
- Get Field Mappings API
- Index Aliases API
- Delete Alias API
- Exists Alias API
- Get Alias API
- Update Indices Settings API
- Get Settings API
- Put Template API
- Validate Query API
- Get Templates API
- Templates Exist API
- Get Index API
- Freeze Index API
- Unfreeze Index API
- Delete Template API
- Reload Search Analyzers API
- Get Composable Index Templates API
- Put Composable Index Template API
- Delete Composable Index Template API
- Optional arguments
- Simulate Index Template API
- Cluster APIs
- Ingest APIs
- Snapshot APIs
- Tasks APIs
- Script APIs
- Licensing APIs
- Machine Learning APIs
- Close anomaly detection jobs API
- Delete anomaly detection jobs API
- Delete anomaly detection jobs from calendar API
- Delete calendar events API
- Delete calendars API
- Delete data frame analytics jobs API
- Delete datafeeds API
- Delete expired data API
- Delete filters API
- Delete forecasts API
- Delete model snapshots API
- Delete trained models API
- Estimate anomaly detection job model memory API
- Evaluate data frame analytics API
- Explain data frame analytics API
- Find file structure API
- Flush jobs API
- Forecast jobs API
- Get anomaly detection jobs API
- Get anomaly detection job stats API
- Get buckets API
- Get calendar events API
- Get calendars API
- Get categories API
- Get data frame analytics jobs API
- Get data frame analytics jobs stats API
- Get datafeeds API
- Get datafeed stats API
- Get filters API
- Get influencers API
- Get machine learning info API
- Get model snapshots API
- Get overall buckets API
- Get records API
- Get trained models API
- Get trained models stats API
- Open anomaly detection jobs API
- Post calendar events API
- Post data API
- Preview datafeeds API
- Put anomaly detection jobs API
- Put anomaly detection jobs in calendar API
- Put calendars API
- Put data frame analytics jobs API
- Put datafeeds API
- Put filters API
- Put trained models API
- Revert model snapshots API
- Set upgrade mode API
- Start data frame analytics jobs API
- Start datafeeds API
- Stop data frame analytics jobs API
- Stop datafeeds API
- Update anomaly detection jobs API
- Update data frame analytics jobs API
- Update datafeeds API
- Update filters API
- Update model snapshots API
- Migration APIs
- Rollup APIs
- Security APIs
- Put User API
- Get Users API
- Delete User API
- Enable User API
- Disable User API
- Change Password API
- Put Role API
- Get Roles API
- Delete Role API
- Delete Privileges API
- Get Builtin Privileges API
- Get Privileges API
- Clear Roles Cache API
- Clear Privileges Cache API
- Clear Realm Cache API
- Clear API Key Cache API
- Authenticate API
- Has Privileges API
- Get User Privileges API
- SSL Certificate API
- Put Role Mapping API
- Get Role Mappings API
- Delete Role Mapping API
- Create Token API
- Invalidate Token API
- Put Privileges API
- Create API Key API
- Get API Key information API
- Invalidate API Key API
- Watcher APIs
- Graph APIs
- CCR APIs
- Index Lifecycle Management APIs
- Snapshot Lifecycle Management APIs
- Put Snapshot Lifecycle Policy API
- Delete Snapshot Lifecycle Policy API
- Get Snapshot Lifecycle Policy API
- Start Snapshot Lifecycle Management API
- Stop Snapshot Lifecycle Management API
- Snapshot Lifecycle Management Status API
- Execute Snapshot Lifecycle Policy API
- Execute Snapshot Lifecycle Retention API
- Transform APIs
- Enrich APIs
- Using Java Builders
- Migration Guide
- License
Put Rollup Job API
editPut Rollup Job API
editThis functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.
The Put Rollup Job API can be used to create a new Rollup job
in the cluster. The API accepts a PutRollupJobRequest
object
as a request and returns a PutRollupJobResponse
.
Put Rollup Job Request
editA PutRollupJobRequest
requires the following argument:
Rollup Job Configuration
editThe RollupJobConfig
object contains all the details about the rollup job
configuration. See create rollup job API to learn more
about the various configuration settings.
A RollupJobConfig
requires the following arguments:
RollupJobConfig config = new RollupJobConfig(id, indexPattern, rollupIndex, cron, pageSize, groups, metrics, timeout);
The name of the Rollup job |
|
The index (or index pattern) to rollup |
|
The index to store rollup results into |
|
A cron expression which defines when the Rollup job should be executed |
|
The page size to use for the Rollup job |
|
The grouping configuration of the Rollup job as a |
|
The metrics configuration of the Rollup job as a list of |
|
The timeout value to use for the Rollup job as a |
Grouping Configuration
editThe grouping configuration of the Rollup job is defined in the RollupJobConfig
using a GroupConfig
instance. GroupConfig
reflects all the configuration
settings that can be defined using the REST API. See Grouping config
to learn more about these settings.
Using the REST API, we could define this grouping configuration:
"groups" : { "date_histogram": { "field": "timestamp", "calendar_interval": "1h", "delay": "7d", "time_zone": "UTC" }, "terms": { "fields": ["hostname", "datacenter"] }, "histogram": { "fields": ["load", "net_in", "net_out"], "interval": 5 } }
Using the GroupConfig
object and the high level REST client, the same
configuration would be:
DateHistogramGroupConfig dateHistogram = new DateHistogramGroupConfig("timestamp", DateHistogramInterval.HOUR, new DateHistogramInterval("7d"), "UTC"); TermsGroupConfig terms = new TermsGroupConfig("hostname", "datacenter"); HistogramGroupConfig histogram = new HistogramGroupConfig(5L, "load", "net_in", "net_out"); GroupConfig groups = new GroupConfig(dateHistogram, histogram, terms);
Metrics Configuration
editAfter defining which groups should be generated for the data, you next configure
which metrics should be collected. The list of metrics is defined in the RollupJobConfig
using a List<MetricConfig>
instance. MetricConfig
reflects all the configuration
settings that can be defined using the REST API. See Metrics config
to learn more about these settings.
Using the REST API, we could define this metrics configuration:
"metrics": [ { "field": "temperature", "metrics": ["min", "max", "sum"] }, { "field": "voltage", "metrics": ["avg", "value_count"] } ]
Using the MetricConfig
object and the high level REST client, the same
configuration would be:
Execution
editThe Put Rollup Job API can be executed through a RollupClient
instance. Such instance can be retrieved from a RestHighLevelClient
using the rollup()
method:
AcknowledgedResponse response = client.rollup().putRollupJob(request, RequestOptions.DEFAULT);
Response
editThe returned PutRollupJobResponse
indicates if the new Rollup job
has been successfully created:
Asynchronous Execution
editThis request can be executed asynchronously:
The asynchronous method does not block and returns immediately. Once it is
completed the ActionListener
is called back using the onResponse
method
if the execution successfully completed or using the onFailure
method if
it failed.
A typical listener for PutRollupJobResponse
looks like:
On this page