Updated on 2024-04-19 GMT+08:00

Scheduled Task Management

Creating a Scheduled Task

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M.

    Figure 1 Scheduled O&M
    Figure 2 Scheduled task list

  3. Click Create Task.

    Figure 3 Creating a scheduled task

  4. Enter the basic information about the scheduled task. Table 1 describes the required parameters.

    Figure 4 Entering basic information
    Table 1 Parameters

    Parameter

    Description

    Task

    Mandatory.

    The value can contain 3 to 100 characters, including letters, digits, hyphens (-), and underscores (_).

    Enterprise Project

    Mandatory.

    The drop-down data source is maintained by Enterprise Project Management.

    Version

    Mandatory.

    Version number of version management.

    Risk Level

    Mandatory.

    There are three risk levels:

    • High
    • Medium
    • Low
      NOTE:

      If high risk is selected, manual review is enabled by default.

  5. Set the time zone. If you select Single execution, select the task execution time. If you select Periodic execution, the Simple Cycle and Cron options are displayed, allowing you to customize the execution period. The scheduled task is executed periodically based on the customized execution period, until the rule expires. Table 2 describes the required parameters.

    Figure 5 Scheduled Settings
    Table 2 Parameters

    Parameter

    Sub-parameter Name

    Description

    Time Zone

    -

    Mandatory.

    The scheduled task is executed based on the time zone.

    Task Type

    Single execution

    Execute the scheduled task at the specified time.

    Periodic execution

    Execute the task based on the specified rule until the rule expires.

    Executed

    -

    This parameter is used together with the task type.

    • For a single execution, set this parameter to the execution time.
    • For periodic execution, the following two modes are available:
      • Simple Cycle
      • Cron

    Rule Expired

    -

    If you select Periodic execution, you need to configure the rule expiration time.

  6. a. Enter the task type. If you select Scripts, search for a desired script by keyword from the drop-down script lists. Select the desired script.

    Figure 6 Task Type

    b. Click View Selected Scripts. The script details are displayed on the right.

    Figure 7 Script Details

    c. Default script parameters are displayed in Script Input Parameters. You can select Sensitive to determine whether to display the parameters in plaintext. You can click the text box to edit the parameter values.

    d. Enter the execution user and the timeout interval.

    e. Select instances: Manual selection: manually select instances. Select All: Select all instances associated with a single region or application.

    Manual selection: Click add instance. The select Instance dialog box is displayed. If you select Manual selection, search for the target instance list based on the enterprise project, view type, resource type, region, and target instance search boxes. Select the check box before the instance list and click OK. Only instances whose UniAgent status is running can be selected.

    Figure 8 Manually selecting instances (CloudCMDB Resource)
    Figure 9 Manually selecting instances (CloudCMDB application groups)

    Select All: Determine the target instance based on the search criteria such as Enterprise Project, View Type, Resource Type, Region, and Target Instance. The list displays the instances that meet the current filter criteria. When a scheduled task is executed, the system queries the target instances in real time based on the selected filter criteria and executes the scheduled task. By default, UniAgent status is running.

    Figure 10 Selecting All (CloudCMDB resources)
    Figure 11 Selecting All (CloudCMDB Application groups)

    f. Select the batch policy and suspension policy. If Select All is selected, the batch processing is automatically performed by default.

    Figure 12 No batch
    Figure 13 Automatic batch

  7. a. Enter the task type. If you select Jobs, click the text box, and select custom jobs or common jobs by searching for the desired job name. Select the desired job.

    Figure 14 Selecting Jobs

    b. Click View Selected Jobs. The job details dialog box is displayed on the right.

    Figure 15 Viewing job details

    c. Select the target instance mode. If you select Unique for each step, you can set the target instance and batch policy for each job step.

    Figure 16 Selecting Unique for each step

    d. Modify job execution parameters. Click a job step name. The job step details are displayed on the right. Enter the success rate threshold, select the batch execution policy, select the post-fault operation strategy, and click OK.

    Figure 17 Modifying job execution parameters

    e. Select an instance. Manual selection: Manually select instances. Select All: Select all instances associated with a single region or application.

    f. Select the batch policy and suspension policy.

  8. You can select whether to manually review task.

    Figure 18 Enabling manual review

  9. Determine whether to enable notification. If you enable notification, select the notification policy, notification object, and channel.

    Figure 19 Setting notifications

  10. Click Submit.

    You can set the jobs and scripts to be executed on the Automated O&M > Scripts page or Automated O&M > Jobs page.

Viewing a Scheduled Task

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M.

    Figure 20 Scheduled tasks

  3. Click the search box. The search criteria list is displayed. Select search criteria, enter values, and press Enter to search for data. You can click the refresh icon next to the search box to refresh the data and set the fields to be displayed in the list.
  4. Click a task name to view the scheduled task details.

    Figure 21 Viewing task details

  5. On the scheduled task details page, click the script or job ID. The script or job details are displayed on the right.

    Figure 22 Script or job details

    System tenants are isolated. Only scheduled tasks created by tenant accounts or sub-accounts can be viewed.

Enabling and Disabling a Scheduled Task

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M.
  3. Locate a target task, and click Enable or Disable in the Operation column to enable or disable a scheduled task.

    Figure 23 Viewing task list

    1. Users can enable or disable only the scheduled tasks created by themselves. You can view scheduled tasks created by other users under the current tenant account.

    2. A task takes effect after it is enabled. When the execution time is reached, the task is executed. After a scheduled task is disabled, it is deleted from the background and will not be executed.

Editing a Scheduled Task

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M.
  3. Click Modify in the Operation column of a scheduled task. On the displayed page, modify the scheduled task information. Click Submit.

    Figure 24 Modifying a scheduled task

    1. Only scheduled tasks in the pending review or disabled state can be modified.

    2. After a scheduled task is modified and enabled again, it will be executed at the new execution time.

Deleting a Scheduled Task

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M.
  3. Locate the target task, click More in the Operation column, and click Delete. In the displayed confirmation dialog box, click OK to delete the scheduled task.

    Figure 25 Deleting a scheduled task

    Only disabled scheduled tasks can be deleted.

Reviewing Scheduled O&M Tasks

  1. Log in to COC.
  2. In the navigation pane on the left, choose Automated O&M > Scheduled O&M. Select a record whose status is Pending review and click the task name.

    Figure 26 Reviewing a scheduled task

  3. Click Review in the upper right corner. In the displayed dialog box, select the review result and enter review comments. Click OK.

    Figure 27 Reviewing a scheduled task

    Only the task whose reviewer is the current login account can be reviewed. Only approved scheduled tasks can be enabled.