Help Center/ Huawei Cloud Astro Zero/ API Reference/ APIs/ Scripts/ Obtaining Script Signature Information
Updated on 2025-08-28 GMT+08:00

Obtaining Script Signature Information

Function

This API is used to obtain the script signature information, including script name, input and output parameters, declared class names, and method names. It is synchronous, meaning the invocation result is returned only after the function execution is complete.

This API can be called only when you save or save as a script. If the type of an input or output parameter defined in the script is incorrect, an error message is reported when this API is called.

URI

GET Huawei Cloud Astro Zero domain name/u-route/baas/script/v1.0/signature/{scriptName}{?version=1.0.1}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

scriptName

Yes

String

Explanation

Script name. For details, see Logging In to the Application Designer. Go to the application designer and view the script name in the Logic > Script list.

Constraints

None

Value

None

Default value

None

version

No

String

Explanation

Version number of the script. If this parameter is not set, the script of the latest version is executed.

Constraints

None

Value

None

Default value

None

Request Parameters

None

Response Parameters

Table 2 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, "Success" is returned. In other cases, an error message is returned.

result

result object

Explanation

Content returned when the request is successful.

Table 3 result parameters

Parameter

Type

Description

description

String

Explanation

Description of the script.

Value

None

script

String

Explanation

Name of a script.

Value

None

methodName

String

Explanation

Method name. The method name is available only after the @action.method is used in the script.

Value

None

methodObject

String

Explanation

Class that the method belongs to.

Value

None

input

String

Explanation

Input type. Generally, this parameter is set to Input. When defining the input and output parameters of a script, you need to define an input parameter class and an output parameter class. Here, input is the input parameter class name.

Value

None

output

String

Explanation

Output type. Generally, this parameter is set to Output. When defining the input and output parameters of a script, you need to define an input parameter class and an output parameter class. Here, output is the name of the output parameter class.

Value

None

label

String

Explanation

Label of the script.

Value

None

inputs

Array of inputs objects

Explanation

Variables of the input type.

outputs

Array of inputs objects

Explanation

Variables of the output type.

types

Object

Explanation

Name of the class that uses the @action.param annotation in the script.

Table 4 inputs and outputs parameters

Parameter

Type

Description

description

String

Explanation

Description of the script.

Value

None

name

String

Explanation

Name of the script.

Value

None

label

String

Explanation

Method name. The method name is available only after the @action.method is used in the script.

Value

None

message

String

Explanation

Error message returned when an invalid parameter is entered during script running.

Value

None

isCollection

String

Explanation

Whether the variable type is a collection.

Value

None

pattern

String

Explanation

Regular expression that a variable must comply with.

Value

None

valueType

String

Explanation

Type of the variable.

Value

  • Date: date
  • DateTime: date and time
  • Number: number
  • String: text
  • Boolean: Boolean
  • Struct: structure
  • ExtStruct: external structure
  • Map: map type
  • Object: object
  • EncryptedText: encrypted text

required

String

Explanation

Whether the variable is mandatory.

Value

None

Example Request

To obtain the signature information of the Namespace__editEquipment script, send the following request:
GET https://Huawei Cloud Astro Zero domain name/u-route/baas/script/v1.0/signature/Namespace__editEquipment

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": {
        "methodName": "run",
        "methodObject": "Calculator",
        "label": "",
        "description": "do a operation",
        "script": "Namespace__editEquipment,"
        "types": {
            "Input": [
                {
                    "name": "op",
                    "label": "",
                    "description": "the operation type",
                    "isCollection": false,
                    "required": true,
                    "pattern": "",
                    "message": "",
                    "valueType": "String",
                    "structType": "",
                    "lengthInCharacter": false,
                    "min": null,
                    "max": null
                },
                {
                    "name": "value1",
                    "label": "",
                    "description": "the operation value 1",
                    "isCollection": false,
                    "required": true,
                    "pattern": "",
                    "message": "",
                    "valueType": "Number",
                    "structType": "",
                    "lengthInCharacter": false,
                    "min": null,
                    "max": null
                },
                {
                    "name": "value2",
                    "label": "",
                    "description": "the operation value 2",
                    "isCollection": false,
                    "required": true,
                    "pattern": "",
                    "message": "",
                    "valueType": "Number",
                    "structType": "",
                    "lengthInCharacter": false,
                    "min": null,
                    "max": null
                }
            ],
            "Output": [
                {
                    "name": "result",
                    "label": "",
                    "description": "",
                    "isCollection": false,
                    "required": true,
                    "pattern": "",
                    "message": "",
                    "valueType": "Number",
                    "structType": "",
                    "lengthInCharacter": false,
                    "min": null,
                    "max": null
                }
            ]
        },
        "inputs": [
            {
                "name": "op",
                "label": "",
                "description": "the operation type",
                "isCollection": false,
                "required": true,
                "pattern": "",
                "message": "",
                "valueType": "String"
            },
            {
                "name": "value1",
                "label": "",
                "description": "the operation value 1",
                "isCollection": false,
                "required": true,
                "pattern": "",
                "message": "",
                "valueType": "Number"
            },
            {
                "name": "value2",
                "label": "",
                "description": "the operation value 2",
                "isCollection": false,
                "required": true,
                "pattern": "",
                "message": "",
                "valueType": "Number"
            }
        ],
        "input": "Input",
        "outputs": [
            {
                "name": "result",
                "label": "",
                "description": "",
                "isCollection": false,
                "required": true,
                "pattern": "",
                "message": "",
                "valueType": "Number"
            }
        ],
        "output": "Output"
    }
}

Status Code

See Status Codes.

Error Code

See Error Codes.