Update Task Definition
Endpoint: PUT /api/metadata/taskdefs
Updates an existing task definition.
Request body
Parameter | Description | Type | Required/Optional |
---|---|---|---|
name | The name of the task definition to be updated. Note:Calling this API without an existing task definition name returns 404. | string | Required. |
description | A brief description of the task. | string | Optional. |
retryCount | The number of retry attempts if the task fails. | integer | Optional. |
retryDelaySeconds | The time (in seconds) to wait before each retry attempt. | integer | Optional. |
backOffScaleFactor | The value multiplied with retryDelaySeconds to determine the interval for retry. | integer | Optional. |
retryLogic | The policy that determines the retry mechanism for the tasks. Supported values:
| string | Optional. |
rateLimitPerFrequency | The maximum number of task executions that can be scheduled in a given duration. | integer | Optional. |
rateLimitFrequencyInSeconds | The frequency window (in seconds) for the rate limit. | integer | Optional. |
concurrentExecLimit | The number of task executions that can be executed concurrently. | integer | Optional. |
timeOutSeconds | Time (in seconds) for the task to reach a terminal state before it gets marked as TIMED_OUT. No timeout occurs if the value is set to 0. | integer | Required. |
responseTimeoutSeconds | The maximum duration in seconds that a worker has to respond to the server with a status update before it gets marked as TIMED_OUT. | integer | Optional. |
pollTimeoutSeconds | Time (in seconds), after which the task is marked as TIMED_OUT if not polled by a worker. No timeout occurs if the value is set to 0. | integer | Optional. |
timeoutPolicy | The policy for handling timeout. Supported values:
| string | Optional. |
totalTimeoutSeconds | The total duration (in seconds) after which the task will be TIMED_OUT, regardless of the retry configuration. Once this duration is reached, no further retries will be attempted. | integer | Required. |
enforceSchema | Whether to enforce input/output schema validation for all instances of the task. Set to true to enable validation or false to disable. | boolean | Optional. |
inputSchema | The schema parameters to be used as input schema for the task definition. Learn more about creating and using schemas. | object | Required if enforceSchema is set to true. |
outputSchema | The schema parameters to be used as output schema for the task definition. Learn more about creating and using schemas. | object | Required if enforceSchema is set to true. |
inputTemplate | The default template values to be supplied for every instance of the task definition. Learn more about using input templates. | object | Optional. |
inputKeys | Keys representing the expected input for the task. | array | Optional. |
outputKeys | Keys representing the expected output from the task. | array | Optional. |
tags | A key-value map to add tags to the task definition. Each tag consists of a key associated with a corresponding value. | object | Optional. |
ownerEmail | The email address of the user updating the task definition. | string | Required. |
Examples
Update an existing task definition
Update an existing task definition
Request
curl -X 'PUT' \
'https://<YOUR-CLUSTER>/api/metadata/taskdefs' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "sample-api-test",
"description": "Task created using API",
"retryCount": 5,
"timeoutSeconds": 3600,
"timeoutPolicy": "TIME_OUT_WF",
"retryLogic": "FIXED",
"retryDelaySeconds": 60,
"responseTimeoutSeconds": 600,
"rateLimitPerFrequency": 0,
"rateLimitFrequencyInSeconds": 1,
"ownerEmail": "john.doe@acme.com",
"pollTimeoutSeconds": 3600,
"inputKeys": [
"abc"
],
"outputKeys": [
"xyz"
],
"inputTemplate":
{
"someKey": "someValue"
},
"backoffScaleFactor": 1,
"concurrentExecLimit": 0
}'
Response
Returns 200 OK, indicating that the task definition has been updated successfully.