Managing Scripts
As your business grows, you may create a large number of custom scripts to execute specific tasks. As the number of custom scripts grows, management becomes more complex, with scripts often becoming disorganized, challenging to monitor, and difficult to control. To address this challenge, you can use COC's script management feature. With this feature, you can review, modify, or delete scripts. If you have a large number of custom scripts, you can use tags to manage them, which simplifies script management and improves efficiency.
Precautions
Confirm and complete the risk level of the script content when modifying a script.
Constraints
Public scripts cannot be reviewed, modified, deleted, or managed.
Viewing a Script
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Script Management. The script management page is displayed.
- On the script management page, you can view basic script information, such as the script name, version number, risk level, and script type.
- Click Custom Scripts or Public Scripts to switch to the corresponding tab page. Figure 1 Viewing a custom script
Figure 2 Viewing public scripts
- Click the script name to go to the script details page and view the script details. Figure 3 Viewing script details
Reviewing a Custom Script
If you have set a script review policy in the review configuration or enabled manual review when creating a custom script or modifying a custom script, the script can be executed only after being approved.
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Script Management. The script management page is displayed.
- On the Custom Scripts tab page, locate the script to be reviewed and click Approve in the Operation column.
- Set the review comments. Figure 4 Setting the review comments
- Passed or Not: Passed or Not Passed
- Review Comment: Enter review comments.
- Click OK. The custom script is approved.
Modifying a Custom Script
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Script Management. The script management page is displayed.
- On the Custom Scripts tab page, locate the script you want to modify and click Modify in the Operation column. Figure 5 Modifying a script
- Set parameters on the displayed page. The parameters are the same as those for creating a custom script. For details, see 5.
- Click OK. The custom script is modified.
Deleting a Custom Script
Check whether the script is bound to peripheral service functions (scheduled O&M and job management in the automated O&M module and alarm management in the fault management module). Deleted scripts cannot be restored. Exercise caution when performing this operation.
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Script Management. The script management page is displayed.
- On the Custom Scripts tab page, locate the script you want to delete and click Delete in the Operation column. Figure 6 Deleting a script
- Click OK in the displayed dialog box. The custom script is deleted.
Managing Script Tags
Tag Management Service (TMS) enables you to use tags to manage custom scripts. TMS works with other cloud services to enable tag management. TMS manages tags globally, and other cloud services use these tags to manage their specific tasks.
- You are advised to set pre-defined tags on the TMS console.
- A tag consists of a key and a value. You can add only one value for each key.
- Each script can have a maximum of 20 tags.
For details, see the following steps:
- Log in to COC.
- In the navigation pane, choose Resource O&M > Automated O&M.
- In the Routine O&M area, click Script Management. The script management page is displayed.
- On the Custom Scripts tab page, view the custom script list.
- Move the cursor over
in the tag column of the target script. A tooltip is displayed. Click Modify Tag. If the tag column is not displayed, click
on the right and select Tag. Figure 7 Managing tags
- In the Modify Tag drawer, add, modify, or delete tags.
Table 1 Parameters for modifying a tag Function
Description
Adding a tag
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.
Modifying an existing tag
Click the key or value of a tag and enter a new key or value.
Deleting a tag
Select the tag you want to delete and click
. - Click OK. You can quickly search for custom scripts based on the added tags.Figure 8 Searching for scripts by tag
Helpful Links
You can use COC to create, review, modify, execute, and delete scripts, and manage tags by calling APIs. For details, see Script Management.
Feedback
Was this page helpful?
Provide feedbackThank 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