Task creation with Java library

Duck
Mon, 24 Jan 2022 11:09:02 +0000
Client SDKs

I’m trying to create a task to downsampling a bucket but I am not sure how to set the “option” tag inside of the code.

Error

invalid options: no task options defined

Code

        client.getTasksApi().createTask(new TaskCreateRequest()
                .description("Downsampling statistics to daily statistics.")
                .status(TaskStatusType.ACTIVE)
                .orgID(provider.getOrganizationId())
                .flux(Flux.from("statistics_daily")
                        //Since a day.
                        .range(-1L, ChronoUnit.DAYS)
                        //Aggregate window.
                        .aggregateWindow().withEvery("1d").withAggregateFunction("sum")
                        //Write to infinite bucket.
                        .to("statistics", provider.getOrganizationId(), "(r) => ({sum: r._value})")
                        .toString()));

2 posts - 1 participant