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

Displaying public script details

Function

This API is used to query public script details.

Constraints

Query the public scripts that exist in the system.

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/public-scripts/{script_uuid}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

script_uuid

Yes

String

Definition:

UUID of the public script.

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

PublicScriptDetailModel object

Definition:

Response body of public script details.

Value range:

N/A.

Table 4 PublicScriptDetailModel

Parameter

Type

Description

script_uuid

String

Definition:

Script UUID.

Value range:

N/A.

name

String

Definition:

Script name.

Value range:

N/A.

description

String

Definition:

Script description.

Value range:

N/A.

type

String

Definition:

Script type.

Value range:

The value can be SHELL,

PYTHON,

and 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.

gmt_created

Long

Definition:

Creation time.

Value range:

N/A.

properties

PublicScriptPropertiesModel object

Definition:

Additional attribute of a script.

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 PublicScriptPropertiesModel

Parameter

Type

Description

risk_level

String

Definition:

Risk level.

Value range:

The value can be LOW,

MEDIUM,

and HIGH.

version

String

Definition:

Script version.

Value range:

N/A.

Example Requests

Display details about a specified public script.

GET https://{Endpoint}/v1/job/public-scripts/{script_uuid}

Example Responses

Status code: 200

Request result is returned.

For more status codes, see Status Codes.

{
  "data" : {
    "script_uuid" : "SC2023083111030804153xxx",
    "name" : "testEcho",
    "description" : "Test echo.",
    "type" : "SHELL",
    "content" : "echo \"${aaa}\"",
    "script_params" : [ {
      "param_name" : "value",
      "param_value" : "aaa",
      "param_description" : "Test parameters",
      "param_order" : 1,
      "sensitive" : false
    } ],
    "gmt_created" : 1686059454716,
    "provider" : "HWC.ECS",
    "properties" : {
      "risk_level" : "LOW",
      "version" : "1.0.0"
    }
  }
}

Status Codes

Status Code

Description

200

Request result is returned.

For more status codes, see Status Codes.

Error Codes

See Error Codes.