Updated on 2025-12-01 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.

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: default value

  • SMS: SMS message

  • EMAIL: email

  • DING_TALK: DingTalk

  • WECHAT: WeChat

  • CALLNOTIFY: language

  • NOT_TO_NOTIFY: No notifications are sent.

WE_LINK: WeLink

Value range:

  • DEFAULT: default value

  • SMS: SMS message

  • EMAIL: email

  • DING_TALK: DingTalk

  • WE_LINK: WeLink

  • WECHAT: WeChat

  • CALLNOTIFY: language

  • NOT_TO_NOTIFY: No notifications are sent.

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.