Obtaining Details About a Custom Script
Function
Test parameters are returned.
Constraints
Only the custom script details of the current account can be queried.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
 - If you are using identity policy-based authorization, the following identity policy-based permissions are required. 
    
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
coc:document:get
Read
-
-
-
-
 
URI
GET /v1/job/scripts/{script_uuid}
| 
        Parameter  | 
      
        Mandatory  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|---|
| 
        script_uuid  | 
      
        Yes  | 
      
        String  | 
      
        Definition: Script UUID. Constraints: N/A. Value range: N/A. Default value: N/A.  | 
     
Request Parameters
| 
        Parameter  | 
      
        Mandatory  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|---|
| 
        X-Auth-Token  | 
      
        Yes  | 
      
        String  | 
      
        Definition: Tenant token. Constraints: Tenant token obtained from IAM. Value range: N/A. Default value: N/A.  | 
     
| 
        X-Language  | 
      
        No  | 
      
        String  | 
      
        Definition: Internationalization tag. zh-cn indicates Chinese, and en-us or no value indicates English. Constraints: zh-cn indicates Chinese, and en-us or no value indicates English. Value range: zh-cn and en-us Default value: N/A.  | 
     
| 
        x-project-id  | 
      
        No  | 
      
        String  | 
      
        Definition: The project ID. Constraints: Project ID corresponding to the region. Value range: N/A. Default value: N/A.  | 
     
| 
        x-user-profile  | 
      
        No  | 
      
        String  | 
      
        Definition: IAM 5.0 user information. Constraints: N/A. Value range: N/A. Default value: N/A.  | 
     
Response Parameters
Status code: 200
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        data  | 
      
        ScriptDetailModel object  | 
      
        Definition: Detailed data of a custom script. Value range: N/A.  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        script_uuid  | 
      
        String  | 
      
        Definition: Script UUID. Value range: N/A.  | 
     
| 
        name  | 
      
        String  | 
      
        Definition: Script name. Value range: N/A.  | 
     
| 
        version  | 
      
        String  | 
      
        Definition: Script version. Constraint. This parameter will be discarded later and you are advised to not use this parameter. Value range: N/A.  | 
     
| 
        description  | 
      
        String  | 
      
        Definition: Script description. Value range: N/A.  | 
     
| 
        type  | 
      
        String  | 
      
        Definition: Script type. The value can be SHELL, PYTHON, and BAT. Value range: SHELL, PYTHON, or BAT.  | 
     
| 
        content  | 
      
        String  | 
      
        Definition: Script content. Value range: N/A.  | 
     
| 
        script_params  | 
      
        Array of ScriptParamDefine objects  | 
      
        Definition: Input parameters of the script. Value range: N/A.  | 
     
| 
        status  | 
      
        String  | 
      
        Definition: Script status. The value can be PENDING_APPROVE, APPROVED, and REJECTED. Value range: PENDING_APPROVE, APPROVED, or REJECTED.  | 
     
| 
        gmt_created  | 
      
        Long  | 
      
        Definition: Creation time. Value range: N/A.  | 
     
| 
        gmt_modified  | 
      
        Long  | 
      
        Definition: Modification time. Value range: N/A.  | 
     
| 
        creator  | 
      
        String  | 
      
        Definition: Creator. Value range: N/A.  | 
     
| 
        creator_id  | 
      
        String  | 
      
        Definition: Creator ID. Value range: N/A.  | 
     
| 
        operator  | 
      
        String  | 
      
        Definition: Modifier. Value range: N/A.  | 
     
| 
        properties  | 
      
        ScriptPropertiesModel object  | 
      
        Definition: Script label. Risk level (value range: LOW, MEDIUM, and HIGH), reviewer, and interpreter. Value range: N/A.  | 
     
| 
        enterprise_project_id  | 
      
        String  | 
      
        Definition: Enterprise project ID. Value range: N/A.  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        param_name  | 
      
        String  | 
      
        Definition: Parameter name. Constraints: The parameter name can contain only letters, digits, and underscores (_). Value range: N/A. Default value: N/A.  | 
     
| 
        param_value  | 
      
        String  | 
      
        Definition: Parameter value. Constraints: The parameter value contains 1 to 4096 characters. The value can contain uppercase letters, lowercase letters, digits, and special characters (_-/.*?:",=+@#[{]}). Consecutive periods (.) are not allowed. Value range: N/A. Default value: N/A.  | 
     
| 
        param_description  | 
      
        String  | 
      
        Definition: Parameter description. Constraints: N/A. Value range: N/A. Default value: N/A.  | 
     
| 
        param_order  | 
      
        Integer  | 
      
        Definition: Parameter sequence. This parameter has been discarded and does not take effect when it is configured. Constraints: N/A. Value range: N/A. Default value: N/A.  | 
     
| 
        sensitive  | 
      
        Boolean  | 
      
        Definition: Whether a parameter is sensitive. Constraints: The value can be true or false. Value range: The value can be true or false. Default value: N/A.  | 
     
| 
        Parameter  | 
      
        Type  | 
      
        Description  | 
     
|---|---|---|
| 
        risk_level  | 
      
        String  | 
      
        Definition: Risk level. Constraints: Value range: LOW, MEDIUM, or HIGH. Default value: N/A.  | 
     
| 
        version  | 
      
        String  | 
      
        Definition: Script version. Constraints: Format: 1.0.0 Value range: N/A. Default value: N/A.  | 
     
| 
        reviewers  | 
      
        Array of ReviewerInfo objects  | 
      
        Definition: Reviewer. If this parameter is not specified, review is not required. Constraints: N/A. Value range: N/A. Default value: N/A.  | 
     
| 
        protocol  | 
      
        String  | 
      
        Definition: Review message notification protocol, which is used to notify the reviewer. Constraints: EMAIL, DING_TALK, WE_LINK, WECHAT, CALLNOTIFY, and NOT_TO_NOTIFY. Value range: DEFAULT, SMS, EMAIL, DING_TALK, WE_LINK, WECHAT, CALLNOTIFY, or NOT_TO_NOTIFY. Default value: N/A.  | 
     
Example Requests
A request example for querying custom script details
GET https://{Endpoint}/v1/job/scripts/{script_uuid}
 Example Responses
Status code: 200
Request result is returned.
For more status codes, see Status Codes.
{
  "data" : {
    "script_uuid" : "SC20230831110xxx",
    "name" : "testExxx",
    "description" : "Test xx is returned.",
    "type" : "SHELL",
    "content" : "echo \"${aaa}\"",
    "script_params" : [ {
      "param_name" : "value",
      "param_value" : "aaa",
      "param_description" : "Test parameters are returned.",
      "param_order" : 1,
      "sensitive" : false
    } ],
    "gmt_created" : 1686059454716,
    "gmt_modified" : 1745222192134,
    "status" : "APPROVED",
    "creator" : "COC-TEST",
    "creator_id" : "1994a3ed905a47ad82c6xxxxxxx",
    "operator" : "COC-TEST",
    "properties" : {
      "risk_level" : "LOW",
      "version" : "1.0.0"
    },
    "enterprise_project_id" : 0
  }
}
 Status Codes
| 
        Status Code  | 
      
        Description  | 
     
|---|---|
| 
        200  | 
      
        Request result is returned. For more status codes, see Status Codes.  | 
     
Error Codes
See Error Codes.
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