Executing a Job
You can use the job management function of COC to encapsulate repetitive batch operations, such as patch updates, configuration delivery, and log collection, into standard automated jobs. This allows for easy one-click triggers or scheduled executions. Compared with the traditional O&M, automated job management cuts down on labor needs and speeds up operations from hours to minutes. It also replaces manual tasks with standardized processes, reducing mistakes such as incorrect command input and missed steps and ensuring operation consistency and precision. During job execution, O&M personnel do not need to monitor the execution progress in real time. They can view the execution progress, success or failure status, and detailed error information of each target resource on the O&M console. This facilitates fault locating and subsequent operations.
Constraints
- Before executing a job, ensure that you have the resource permissions of target instances.
- A maximum of 999 instances can be selected for a task.
Executing a Custom Job Using a Single Account
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Job Management. The Job Management page is displayed.
- On the Custom Jobs tab page, locate the job to be executed and click Execute in the Operation column.
- Set Execution Type to Single and configure basic information by referring to Table 1.
Table 1 Basic information parameters Parameter
Description
Example Value
Version
Select the version of the job from the drop-down list. The version number is automatically incremented each time you save the modifications.
V1
IAM Agency
(Optional)
Scope of permissions that can be used on COC to execute jobs. You are advised to use ServiceAgencyForCOC.
ServiceAgencyForCOC
Execution Description
(Optional) Description of the job you want to execute.
-
Tag
(Optional) Click Add Tag and enter a tag key and a value.
- When you enter a tag key and a 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 it 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: _.:/=+-@
-
- Set the job execution content by referring to Table 2.
Table 2 Parameter description Parameter
Description
Example Value
Region
Select the region where the target instance is located.
Single
Target Instance Mode
Select the execution mode for job steps 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.
Consistent for all steps
Job Execution Procedure
You can customize job details.- Click a job name. The drawer for modifying parameters is displayed on the right.
- Set parameters on the Input, Output, and Troubleshooting tab pages.
-
- Click Add and select the target instances to be executed.
Table 3 Parameters for selecting an instance Parameter
Description
Example Value
Selection Method
Select an instance selection method.
Manual Selection: Manually select one or more instances based on settings of 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 by resource type.
- CloudCMDB application groups: Select an instance by application group.
CloudCMDB resources
Resource Type
Resource type of the target instance.
The value can be ECS, BMS, FlexusL, or On-premises IDCs.
CAUTION:FlexusL instances do not support ECS-related operations, including starting, restarting, switching, stopping, and reinstalling the OS, as well as scanning and repairing patches.
ECS
Region
This parameter is automatically set according to the Region field you specified in the execution content. This field is read-only. You cannot select target instances across regions.
AP-Singapore
Target Instance
Set filter criteria in the filter box and select the displayed instances.
Instances cannot be filtered by enterprise project-level IAM permission.
-
- Set a batch policy for executing the job. Select Automatic, Manual, or No Batch.
Table 4 Batch policy parameters Parameter
Description
Automatic
The selected instances on which you want to perform operations are automatically divided into multiple batches based on the default rule.
Manual
You can manually create multiple batches and add instances to each batch as required.
No Batch
All instances on which you want to perform operations are in the same batch.
If you select multiple target instances and set Batch Policy to Automatic or Manual, you can set the batch execution rule. You can select Pause for 1st batch, Pause after all batches, or Continue all.
- If you select Pause for the 1st batch, you need to click Continue to execute the next batch after the first batch is executed.
- If you select Pause after all batches, you need to click Continue after each batch is executed.
- If you select Continue all, the system automatically executes the next batch after each batch is executed.
- If you select Customize, you can determine whether to start or continue with the next batch after each batch is executed.
For example, if you have selected multiple target instances and want to execute them in custom batches, select Manual, set Batches to 3, and set the execution rule to Pause for the 1st batch. Then, select the corresponding batch and click Add.
After the first batch of instances are executed, the execution is suspended. You can check whether the execution result meets the expectation. If the execution result is correct, click Continue to execute the next batch of instances. After the second batch of instances is executed, the third batch of instances will be automatically executed without manual confirmation.
Figure 1 Setting a batch policy
- (Optional) Click Modify to modify the global parameters of the selected job.
Global parameters can be customized or obtained from the parameter center.
Table 5 Global parameters Parameter
Description
Customize
Set the parameter based on service requirements. In a job step, you can obtain the parameter value from ${parameter name}.
Parameter Center
You need to select the preset parameter values from the parameter center.
- Region: Select the region where the parameter is located.
- Parameter: Select a parameter defined in the parameter center.
- Parameter association mode: An association rule is established between multiple parameters or configuration items in the system. When the value, status, or attribute of a parameter (trigger parameter) changes, other associated parameters (associated parameters) automatically adjust the value, status, or trigger a specific action based on the preset rule.
Currently, you are only allowed to use the latest parameter value in the corresponding environment: The parameter is used during job execution, and the parameter value is the latest parameter value obtained from the parameter center in real time.
- Click OK. In the confirmation drawer, confirm the execution information, and click OK to execute the service ticket. The service ticket details page is displayed. You can view the job service ticket execution records.
Change control can be used when custom jobs are executed. If change control is enabled, service ticket-based authorization and authentication will be performed. For details about how to use this feature, see Configuring Change Control.
Executing a Public Job Using a Single Account
Public jobs are predefined jobs on COC. You have the read-only and execution permissions on them. Job Management provides a basic public job list and allows you to execute public jobs on target resources.
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Job Management. The Job Management page is displayed.
- Click Public Jobs.
- Select All Jobs, locate the public job you want to execute, and click Execute in the Operation column.
- Set Execution Type and Basic Information.
Table 6 Related parameters Parameter
Description
Example Value
Execution Type
Select the job execution scope. Currently, only the single-account execution method is supported. That is, the job can be executed only under the current account.
CN-Hong Kong
IAM Agency
(Optional) Scope of permissions that can be used on COC to execute jobs. You are advised to use ServiceAgencyForCOC.
ServiceAgencyForCOC
Execution Description
(Optional) Description of the job you want to execute.
-
Tag
(Optional) Click Add Tag and enter a tag key and a value.
- When you enter a tag key and a value, the system automatically displays all predefined tags associated with the current user.
- A tag key can contain letters, digits, spaces, and any of the following characters: _.:=+-@. The value cannot start or end with spaces or start with _sys_. A maximum of 128 characters are allowed.
- A tag value can contain letters, digits, spaces, and any of the following characters: _.:/=+-@. The value cannot start or end with spaces. A maximum of 255 characters are allowed.
-
- Set Region, Target Instance Mode, and Job Execution Procedure.
Table 7 Parameter description Parameter
Description
Example Value
Region
Select the region where the target instance is located.
AP-Singapore
Target Instance Mode
Select the execution mode for job steps 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.
Consistent for all steps
Job Execution Procedure
You can customize job details.- Click a job name. The drawer for modifying parameters is displayed on the right.
- Set parameters on the Input, Output, and Troubleshooting tab pages.
-
- Perform the following operations based on the selected public job.
Viewing the Execution Records of a Job Service Ticket
After a job is executed, a service ticket record is generated to record the job execution result. To monitor and record the execution objects and results of the job, you can use the job service ticket function.
- Log in to COC.
- In the navigation pane on the left, choose Task Management > Execution Records. The task execution records page is displayed.
- Click the Job Tickets tab. The Job Tickets tab page is displayed.
- You can clone and modify the tag of a job service ticket in the job service ticket list.
- Clone: Click Clone in the Operation column of the target job. The job execution page is displayed. You can execute the job again. For details, see Executing a Job.
- Modify Tag: Hover the cursor on
in the service ticket tag column of the target job. In the displayed tooltip, click Modify Tag to modify the tag. For details, see Managing Job Tags
- On the displayed page, click the name of the target job. The service ticket details page is displayed.
On the service ticket details page, you can view the basic information and execution information about the service ticket.
- Perform the following operations based on the service ticket status:
- If the job ticket status is Abnormal, click Forcibly End in the upper right corner to end the service ticket.
- If the job ticket is in the Executing state, click Forcibly End in the upper right corner to end the service ticket.
- If the job ticket is in the Paused state, click Forcibly End in the upper right corner to end the service ticket.
Helpful Links
- Job execution supports change control. For details about how to enable or disable the change control function, see Configuring Change Control.
- Both custom and public jobs can be scheduled for automatic execution. For details, see Scheduled O&M.
- COC can create, modify, execute, delete, and query jobs by calling APIs. For details, see Job Management.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
