Updated on 2025-08-08 GMT+08:00

Executing Public Jobs

Scenarios

Public jobs are predefined jobs that you can read only and execute. Basic public jobs are listed and can be executed on target resources.

Precautions

Before executing a public job, ensure that you have the resource permissions of target instances.

Executing a Public Job

  1. Log in to COC.
  2. In the navigation pane on the left, choose Resource O&M > Automated O&M.
  3. In the Routine O&M area, click Job Management.
  4. Choose Public Jobs.
  5. Select All Jobs, locate the public job to be executed, and click Execute in the Operation column.
  6. Set Execution Type and Basic Information.

    Table 1 Parameters related

    Parameter

    Description

    Example Value

    Execution Type

    Select the scope of the jobs to be executed.

    • Single: Execute this job only under the current account.

    Single

    IAM Agency

    (Optional) Scope of permissions that can be used on COC to execute jobs.

    ServiceAgencyForCOC

    Execution Description

    (Optional) Description of the job to be executed.

    -

    Tag

    (Optional) Click Add Tag and enter a tag key and value.

    • When you enter a tag key and value, the system automatically displays all predefined tags associated with the current user.
    • A tag key can contain up to 128 characters. It cannot start with _sys_ or a space, and cannot end with a space. Only letters, digits, spaces, and the following special characters are allowed: _.:=+-@
    • A tag value can contain up to 255 characters. It cannot start or end with a space. Only letters, digits, spaces, and the following special characters are allowed: _ . : / = + - @

    -

  7. Set Region, Target Instance Mode, and Job Execution Procedure.

    • Region: Select the region where the target instance is located.
    • Target Instance Mode: Select the execution mode of job step and target instances.
      • Consistent for all steps: All steps are executed on all target instances.
      • Unique for each step: Set the target instance and batch policy for each job step.
      • Unique for each task: Set the target instance and batch policy for each task.
    • Job Execution Procedure: Customize job details.
      • Click the job name. The Modifying Parameters drawer is displayed on the right.
      • Set Input, Output, and Troubleshooting.

  8. Perform related operations based on the selected public job type.

    • Perform 9 and 10, if you select a public job whose name starts with restarting ECS, stopping ECS, starting ECS, or starting OS.
    • Perform 11, if you select other public jobs.

  9. Click Add and configure the parameters on the Select Instance dialog box.

    Table 2 Instance parameters

    Parameter

    Description

    Example Value

    Selection Method

    Select an instance selection method. Select All is not enabled.

    • Manual Selection: Manually select an instance based on Enterprise Project, View Type, Resource Type, Region, and Target Instance.
    • Select All: Automatically select all instances based on Enterprise Project, View Type, Resource Type, Region, and Target Instance.

    Manual Selection

    Enterprise Project

    Select an enterprise project from the drop-down list. You can choose All.

    All

    View Type

    Select a view type.

    • CloudCMDB resources: Select an instance from the resource list.
    • CloudCMDB application groups: Select an instance from the application group list.

    CloudCMDB resources

    Resource Type

    The default value is used and cannot be changed.

    ECS

    Region

    The default parameter cannot be modified and is determined by Region in Execution Content.

    CN-Hong Kong

    Target Instance

    Set filter criteria in the filter box and select the filtered instances manually or automatically.

    -

  10. Set Batch Policy.

    • Batch Policy: Select Automatic, Manual, or No Batch.
      • Automatic: The selected instances to be executed are automatically divided into multiple batches based on the preset rule.
      • Manual: You can manually create multiple batches and add instances to each batch as required.
      • No Batch: All instances will be executed in the same batch.

  11. (Optional) Set global parameters.

    • Global Parameters: Set global parameters of the job.

  12. Click OK. Confirm the execution information and click OK.
  13. Perform the following operations to check whether a service ticket execution is complete.

    • For the service tickets that are being executed:
      • If you want to stop the service ticket that is about to be executed or is abnormal, click Forcibly End.
      • If you want to pause the next batch when the current batch is executed, click Pause.
      • If you want to continue the paused batch, click Continue.
      • If you want to end all batches, click End All Batches.
    • For the service tickets that are executed:
      • If some or all instance tasks in the service tickets are executed abnormally, click the abnormal batch to view the exception details.
      • If all instance tasks in the service tickets are executed successfully, no more operation is needed.