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

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}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

script_uuid

Yes

String

Definition:

Script UUID.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

Request Parameters

Table 2 Request header 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

Table 3 Response body parameters

Parameter

Type

Description

data

ScriptDetailModel object

Definition:

Detailed data of a custom script.

Value range:

N/A.

Table 4 ScriptDetailModel

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.

Table 5 ScriptParamDefine

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.

Table 6 ScriptPropertiesModel

Parameter

Type

Description

risk_level

String

Definition:

Risk level.

Constraints:

  • LOW

  • MEDIUM

  • HIGH

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:

  • DEFAULT

  • SMS

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.

Table 7 ReviewerInfo

Parameter

Type

Description

reviewer_name

String

Definition:

Reviewer name (IAM username).

Constraints:

IAM username.

Value range:

N/A.

Default value:

N/A.

reviewer_id

String

Definition:

Reviewer ID (IAM user ID).

Constraints:

IAM user ID.

Value range:

N/A.

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.