获取脚本签名信息 - ObtainSignatureInformation
功能介绍
获取脚本签名信息,该接口是同步接口(同步接口是指调用后,会等待函数执行结束后,才返回结果)。获取脚本的名称、输入参数、输出参数、声明的类名、方法名等相关信息。
只有用户保存或另存脚本时会调用该接口,当脚本中定义的输入参数或输出参数的类型错误时,该接口会执行报错。
URI
GET 华为云Astro轻应用域名/u-route/baas/script/v1.0/signature/{scriptName}{?version=1.0.1}
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
scriptName |
是 |
String |
参数解释: 脚本的名称,请参考登录应用设计器中操作,进入应用设计器,在列表中查看。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
|
version |
否 |
String |
参数解释: 脚本的版本号,表示运行具体版本号对应的脚本,不配置表示运行最新版本的脚本。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
请求参数
无
响应参数
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
resCode |
String |
参数解释: 返回码。 取值范围: 如果返回“0”代表请求成功,其他错误码说明请参考错误码(数据面)。 |
|
resMsg |
String |
参数解释: 返回消息。 取值范围: 成功返回“成功”,其他情况会返回具体的错误信息。 |
|
result |
result object |
参数解释: 在成功请求时,会有内容返回。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
description |
String |
参数解释: 脚本的描述信息。 取值范围: 不涉及。 |
|
script |
String |
参数解释: 脚本的名称。 取值范围: 不涉及。 |
|
methodName |
String |
参数解释: 方法名称,在脚本使用@action.method注解后才会有方法名。 取值范围: 不涉及。 |
|
methodObject |
String |
参数解释: 方法所属的类。 取值范围: 不涉及。 |
|
input |
String |
参数解释: 输入类型,一般为Input。在定义脚本出入参时,会定义一个入参类和出参类,这里input即为入参类名。 取值范围: 不涉及。 |
|
output |
String |
参数解释: 输出类型,一般为Output。在定义脚本出入参时,会定义一个入参类和出参类,这里output即为出参类名。 取值范围: 不涉及。 |
|
label |
String |
参数解释: 脚本的标签。 取值范围: 不涉及。 |
|
inputs |
Array of inputs objects |
参数解释: 输入类型中的变量信息描述。 |
|
outputs |
Array of inputs objects |
参数解释: 输出类型中的变量信息描述。 |
|
types |
Object |
参数解释: 脚本中使用@action.param注解的类名。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
description |
String |
参数解释: 脚本的描述信息。 取值范围: 不涉及。 |
|
name |
String |
参数解释: 脚本的名称。 取值范围: 不涉及。 |
|
label |
String |
参数解释: 方法名称,在脚本使用@action.method注解后才会有方法名。 取值范围: 不涉及。 |
|
message |
String |
参数解释: 运行脚本参数不合法输入时,返回的错误信息。 取值范围: 不涉及。 |
|
isCollection |
String |
参数解释: 变量类型是否是集合。 取值范围: 不涉及。 |
|
pattern |
String |
参数解释: 输入变量值需要满足的正则表达式。 取值范围: 不涉及。 |
|
valueType |
String |
参数解释: 变量的类型。 取值范围:
|
|
required |
String |
参数解释: 变量是否必填。 取值范围: 不涉及。 |
请求示例
GET https://华为云Astro轻应用域名/u-route/baas/script/v1.0/signature/命名空间__editEquipment
响应示例
{
"resCode": "0",
"resMsg": "成功",
"result": {
"methodName": "run",
"methodObject": "Calculator",
"label": "",
"description": "do a operation",
"script": "命名空间__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"
}
}
状态码
状态码请参见状态码。
错误码
错误码请参见错误码(数据面)。