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

Obtaining the Public Script List

Function

This API is used to obtain the public scripts.

Constraints

  • The maximum of 100 scripts can be queried.

  • The script risk level can only be LOW, MEDIUM, or HIGH.

  • The script type can only be SHELL, PYTHON, or BAT.

  • The result pagination uses both limit and marker to improve pagination efficiency.

  • Use the auto-addition ID as the marker parameter.

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:list

    List

    document *

    -

    -

    -

URI

GET /v1/job/public-scripts

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Definition:

Pagination parameter, which indicates the maximum number of records returned on each page.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

marker

No

Long

Definition:

Pagination parameter, which indicates ID of the last record on the previous page.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

name_like

No

String

Definition:

Script name (only right fuzzy search is supported).

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

name

No

String

Definition:

Script name queried by exact search.

Constraints:

N/A.

Value range:

N/A.

Default value:

N/A.

risk_level

No

String

Definition:

Risk level.

Constraints:

  • LOW

  • MEDIUM

  • HIGH

Value range:

LOW, MEDIUM, or HIGH.

Default value:

N/A.

type

No

String

Definition:

Script type.

Constraints:

The value can be SHELL,

PYTHON,

and BAT.

Value range:

SHELL, PYTHON, or BAT.

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

PublicScriptListPage object

Definition:

Public script list.

Value range:

N/A.

Table 4 PublicScriptListPage

Parameter

Type

Description

total

Long

Definition:

Total number of records.

Value range:

N/A.

data

Array of PublicScriptListModel objects

Definition:

Data listed on a single page.

Value range:

N/A.

Table 5 PublicScriptListModel

Parameter

Type

Description

id

Long

Definition:

Auto-added script ID.

Value range:

N/A.

script_uuid

String

Definition:

Script UUID.

Value range:

N/A.

name

String

Definition:

Script name.

Value range:

N/A.

type

String

Definition:

Script type.

Value range:

The value can be SHELL,

PYTHON,

and BAT.

gmt_created

Long

Definition:

Creation time.

Value range:

N/A.

description

String

Definition:

Script description.

Value range:

N/A.

properties

PublicScriptPropertiesModel object

Definition:

Additional attribute of a script.

Value range:

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

Public scripts.

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

Example Responses

Status code: 200

Request result is returned.

For more status codes, see Status Codes.

{
  "data" : {
    "total" : 2,
    "data" : [ {
      "id" : 1422704,
      "name" : "HWC.ECS.OSOps-switch-linux-ssh.sh",
      "type" : "SHELL",
      "gmt_created" : 1745294950699,
      "status" : "APPROVED",
      "script_uuid" : "SC2024052200000006dd50344",
      "description" : "Enable or disable the SSH of the Linux OS.",
      "properties" : {
        "risk_level" : "HIGH",
        "version" : "1.0.0"
      }
    }, {
      "id" : 1422703,
      "name" : "HWC.ECS.OSOps-switch-linux-firewall.sh",
      "type" : "SHELL",
      "gmt_created" : 1745294950689,
      "status" : "APPROVED",
      "script_uuid" : "SC2024052200000005dd50344",
      "description" : "Enable or disable the firewall of the Linux OS.",
      "properties" : {
        "risk_level" : "HIGH",
        "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.