When creating a scheduled task in Tanzu Data Flow (Spring Cloud Data Flow for Cloud Foundry) by calling the /tasks/schedules REST endpoint directly with curl, the request fails with an IllegalArgumentException.
The task can be registered, created, and launched manually without issue. Only the scheduling operation via the REST API fails.
Depending on how the cron expression is placed in the request, one of the following errors is returned:
properties field:{"_embedded":{"errors":[{"logref":"IllegalArgumentException","message":"Only deployment property keys starting with 'app.' or 'deployer.' or 'version.' allowed. Not spring.cloud.scheduler.cron.expression=0 * * * ?","link":{"rel":"self","href":"/"}}]}}When the cron key is moved out of the properties field:
{"_embedded":{"errors":[{"logref":"IllegalArgumentException","message":"request's scheduleProperties must have a spring.cloud.scheduler.cron.expression or spring.cloud.deployer.cloudfoundry.cron.expression that is not null nor empty","link":{"rel":"self","href":"/"}}]}}Tanzu Data Flow (Spring Cloud Data Flow for Cloud Foundry)
The failure is caused by an incorrect request structure when calling the /tasks/schedules endpoint directly. The Data Flow dashboard UI succeeds because it constructs the request differently from the manual curl command.
The correct request structure was determined by capturing the request the UI sends using the browser's Developer Tools (Network tab) and inspecting the request payload.
/tasks/schedules.Construct the curl request to match the structure the UI submits, confirmed by inspecting the UI's network payload.
deployer.*.cron.expression key for the cron expression, placed in the properties field. This key is accepted by the deployment-property validator because it begins with deployer..Example:
curl -H "Authorization: $(cf oauth-token)" \
"https://dataflow-<service-guid>.<apps-domain>/tasks/schedules" \
-i -X POST \
-d "scheduleName=<schedule-name>" \
-d "taskDefinitionName=<task-definition-name>" \
-d "platform=default" \
-d "properties=deployer.*.cron.expression=0 16 ? * *" \
-d "arguments=--spring.profiles.active=<profile1>,<profile2>"