Skip to content

Commit 3642a1f

Browse files
Squash job and task level sections to single section (#3536)
1 parent 40141ba commit 3642a1f

File tree

1 file changed

+20
-27
lines changed

1 file changed

+20
-27
lines changed

docs/resources/job.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ The resource supports the following arguments:
9898
* `timeout_seconds` - (Optional) (Integer) An optional timeout applied to each run of this job. The default behavior is to have no timeout.
9999
* `min_retry_interval_millis` - (Optional) (Integer) An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.
100100
* `max_concurrent_runs` - (Optional) (Integer) An optional maximum allowed number of concurrent runs of the job. Defaults to *1*.
101-
* `email_notifications` - (Optional) (List) An optional set of email addresses notified when runs of this job begins, completes or fails. The default behavior is to not send any emails. This field is a block and is [documented below](#job-level-email_notifications-configuration-block).
101+
* `email_notifications` - (Optional) (List) An optional set of email addresses notified when runs of this job begins, completes or fails. The default behavior is to not send any emails. This field is a block and is [documented below](#email_notifications-configuration-block).
102102
* `webhook_notifications` - (Optional) (List) An optional set of system destinations (for example, webhook destinations or Slack) to be notified when runs of this job begins, completes or fails. The default behavior is to not send any notifications. This field is a block and is documented below.
103-
* `notification_settings` - (Optional) An optional block controlling the notification settings on the job level (described below).
103+
* `notification_settings` - (Optional) An optional block controlling the notification settings on the job level [documented below](#notification_settings-configuration-block).
104104
* `schedule` - (Optional) (List) An optional periodic schedule for this job. The default behavior is that the job runs when triggered by clicking Run Now in the Jobs UI or sending an API request to runNow. This field is a block and is documented below.
105105
* `health` - (Optional) An optional block that specifies the health conditions for the job (described below).
106106
* `tags` - (Optional) An optional map of the tags associated with the job. See [tags Configuration Map](#tags-configuration-map)
@@ -132,7 +132,7 @@ This block describes individual tasks:
132132
* `max_retries` - (Optional) (Integer) An optional maximum number of times to retry an unsuccessful run. A run is considered to be unsuccessful if it completes with a `FAILED` or `INTERNAL_ERROR` lifecycle state. The value -1 means to retry indefinitely and the value 0 means to never retry. The default behavior is to never retry. A run can have the following lifecycle state: `PENDING`, `RUNNING`, `TERMINATING`, `TERMINATED`, `SKIPPED` or `INTERNAL_ERROR`.
133133
* `timeout_seconds` - (Optional) (Integer) An optional timeout applied to each run of this job. The default behavior is to have no timeout.
134134
* `min_retry_interval_millis` - (Optional) (Integer) An optional minimal interval in milliseconds between the start of the failed run and the subsequent retry run. The default behavior is that unsuccessful runs are immediately retried.
135-
* `email_notifications` - (Optional) (List) An optional set of email addresses notified when this task begins, completes or fails. The default behavior is to not send any emails. This field is a block and is [documented below](#task-level-email_notifications-configuration-block).
135+
* `email_notifications` - (Optional) (List) An optional set of email addresses notified when this task begins, completes or fails. The default behavior is to not send any emails. This field is a block and is [documented below](#email_notifications-configuration-block).
136136
* `webhook_notifications` - (Optional) (List) An optional set of system destinations (for example, webhook destinations or Slack) to be notified when runs of this task begins, completes or fails. The default behavior is to not send any notifications. This field is a block and is documented below.
137137
* `health` - (Optional) block described below that specifies health conditions for a given task.
138138

@@ -375,21 +375,27 @@ This block is used to specify Git repository information & branch/tag/commit tha
375375
* `tag` - name of the Git branch to use. Conflicts with `branch` and `commit`.
376376
* `commit` - hash of Git commit to use. Conflicts with `branch` and `tag`.
377377

378-
### Job-level `email_notifications` Configuration Block
378+
### parameter Configuration Block
379379

380-
* `on_start` - (Optional) (List) list of emails to notify when the run starts.
381-
* `on_success` - (Optional) (List) list of emails to notify when the run completes successfully.
382-
* `on_failure` - (Optional) (List) list of emails to notify when the run fails.
383-
* `on_duration_warning_threshold_exceeded` - (Optional) (List) list of emails to notify when the duration of a run exceeds the threshold specified by the `RUN_DURATION_SECONDS` metric in the `health` block.
384-
* `no_alert_for_skipped_runs` - (Optional) (Bool) don't send alert for skipped runs. (It's recommended to use the corresponding setting in the `notification_settings` configuration block).
380+
This block defines a job-level parameter for the job. You can define several job-level parameters for the job. Supported options are:
385381

386-
### Task-level `email_notifications` Configuration Block
382+
* `name` - (Required) The name of the defined parameter. May only contain alphanumeric characters, `_`, `-`, and `.`.
383+
* `default` - (Required) Default value of the parameter.
384+
385+
*You can use this block only together with `task` blocks, not with the legacy tasks specification!*
386+
387+
### email_notifications Configuration Block
388+
389+
This block can be configured on both job and task levels for corresponding effect.
387390

388391
* `on_start` - (Optional) (List) list of emails to notify when the run starts.
389392
* `on_success` - (Optional) (List) list of emails to notify when the run completes successfully.
390393
* `on_failure` - (Optional) (List) list of emails to notify when the run fails.
391394
* `on_duration_warning_threshold_exceeded` - (Optional) (List) list of emails to notify when the duration of a run exceeds the threshold specified by the `RUN_DURATION_SECONDS` metric in the `health` block.
392395

396+
The following parameter is only available for the job level configuration.
397+
* `no_alert_for_skipped_runs` - (Optional) (Bool) don't send alert for skipped runs. (It's recommended to use the corresponding setting in the `notification_settings` configuration block).
398+
393399
### webhook_notifications Configuration Block
394400

395401
Each entry in `webhook_notification` block takes a list `webhook` blocks. The field is documented below.
@@ -417,28 +423,15 @@ webhook_notifications {
417423

418424
-> **Note** The following configuration blocks can be standalone or nested inside a `task` block
419425

420-
### notification_settings Configuration Block (Job Level)
426+
### notification_settings Configuration Block
421427

422-
This block controls notification settings for both email & webhook notifications on a job level:
428+
This block controls notification settings for both email & webhook notifications.
429+
It can be configured on both job and task level for corresponding effect.
423430

424431
* `no_alert_for_skipped_runs` - (Optional) (Bool) don't send alert for skipped runs.
425432
* `no_alert_for_canceled_runs` - (Optional) (Bool) don't send alert for cancelled runs.
426433

427-
### parameter Configuration Block
428-
429-
This block defines a job-level parameter for the job. You can define several job-level parameters for the job. Supported options are:
430-
431-
* `name` - (Required) The name of the defined parameter. May only contain alphanumeric characters, `_`, `-`, and `.`.
432-
* `default` - (Required) Default value of the parameter.
433-
434-
*You can use this block only together with `task` blocks, not with the legacy tasks specification!*
435-
436-
### notification_settings Configuration Block (Task Level)
437-
438-
This block controls notification settings for both email & webhook notifications on a task level:
439-
440-
* `no_alert_for_skipped_runs` - (Optional) (Bool) don't send alert for skipped runs.
441-
* `no_alert_for_canceled_runs` - (Optional) (Bool) don't send alert for cancelled runs.
434+
The following parameter is only available on task level.
442435
* `alert_on_last_attempt` - (Optional) (Bool) do not send notifications to recipients specified in `on_start` for the retried runs and do not send notifications to recipients specified in `on_failure` until the last retry of the run.
443436

444437
### health Configuration Block

0 commit comments

Comments
 (0)