Put Action
-
打印
-
PDF
Put Action
-
打印
-
PDF
概述
创建、修改操作。
请求
请求URL
PUT {CLOUD_FUNCTIONS_API_URL}/packages/{packageName}/actions/{actionName}
Content-Type: application/json; charset=utf-8
x-ncp-apigw-timestamp: {Timestamp}
x-ncp-iam-access-key: {Sub Account Access Key}
x-ncp-apigw-signature-v2: {API Gateway Signature}
Path Variables
参数 | 是否必填 | 类型 | 限制事项 | 说明 |
---|---|---|---|---|
packageName | Yes | string | 使用英文字母、数字、连字符(-)和下划线(_)组合,限50个字符以内 | - 包名称 - 生成不属于package的action时,在packageName输入连字符(-) |
actionName | Yes | string | 使用英文字母、数字、连字符(-)和下划线(_)组合,限50个字符以内 | 操作名称 |
请求参数
参数名称 | 是否必填 | 类型 | 限制事项 | 说明 |
---|---|---|---|---|
platform | No | string | (classic | vpc) | - 平台类型 - 作为default classic处理 |
请求体
Basic Action
{
"description" : "string",
"web" : "boolean",
"raw-http" : "boolean",
"custom-options" : "boolean",
"parameters": {
},
"limits": {
"timeout": "number",
"memory": "number"
},
"exec": {
"kind": "string",
"code": "string",
"binary": "boolean",
"main": "string"
},
"vpc": {
"vpcNo" : "number",
"subnetNo" : "number"
}
}
项目 | 是否必填 | 类型 | 限制事项 | 说明 |
---|---|---|---|---|
description | No | string | 3000byte以内的字符串 | 操作说明 |
web | No | Boolean | true/false | 设置Web操作 |
raw-http | No | Boolean | true/false | - 是否使用HTTP原文 - Web设置为false时仅允许false |
custom-options | No | Boolean | true/false | - 设置报头选项 - Web设置为false时仅允许false |
parameters | No | JSON格式。采用{"key" : "value"}形式 | 设置操作的默认参数 * 运行时参数应用优先级 ** 第1位:运行时传递的运行时参数 ** 第2位:连接触发器的默认参数 ** 第3位:操作的默认参数 ** 第4位:包含包的默认参数 |
|
limits.timeout | Yes | number | MIN 500 MAX 300000 | - 可运行操作的最长时间 如果超过该时间会强制终止 - 以ms为单位,default:60000ms |
limits.memory | Yes | number | ( 128 | 256 | 512 ) | 分配给操作容器的内存大小(default:256) |
exec.kind | Yes | string | ( swift:3.1.1 | python:3.6 | python:3.7 | php:7.1 | php:7.3 | nodejs:6 | nodejs:8 | nodejs:12 | nodejs:16 | java | go:1.11 | go:1.19 | dotnet:2.2) | 使用语言 |
exec.binary | Yes | boolean | - 直接输入代码时设置为false,输入二进制文件时设置为true - 使用语言为java或dotnet时,只允许二进制文件 - Java只可用压缩的*.jar文件格式注册,.net(dotnet)只可上传*.zip(压缩文件)格式。 |
|
exec.code | Yes | string | - 源代码 -直接输入代码时,需进行escape处理 |
|
exec.main | Yes | string | 输入代码内将运行的函数名 | |
vpc | No | - 输入连接的vpc信息 - 仅当platform为vpc时输入 |
||
vpc.vpcNo | No | number | 输入连接的vpc No | |
vpc.subnetNo | No | number | 输入连接的子网No |
Sequence Action
{
"description" : "string",
"web" : "boolean",
"exec": {
"kind": "string",
"components": [
"string"
]
}
}
项目 | 是否必填 | 类型 | 限制事项 | 说明 |
---|---|---|---|---|
description | No | string | 3000byte以内的字符串 | 操作说明 |
web | No | Boolean | true/false | 设置Web操作 |
exec.kind | Yes | string | sequence | 创建序列操作时输入sequence |
exec.components | Yes | string array | "{packageName}/{actionName}"形式连接不属于 package的action时,在packageName中输入- | 依次输入要连接Sequence Action的操作 |
响应
响应体
Basic Action
{
"content": {
"name": "string",
"path": "string",
"description": "string",
"parameters": {},
"resourceId": "string",
"web": "boolean",
"raw-http": "boolean",
"custom-options": "boolean",
"exec": {
"binary": "boolean",
"code": "string",
"kind": "string",
"main": "string"
},
"limits": {
"memory": "number",
"timeout": "number"
},
"vpc" : {
"vpcNo": "number",
"subnetNo": "number"
}
}
}
项目 | 类型 | 说明 | 备注 |
---|---|---|---|
content.name | string | 操作名称 | |
content.path | string | 操作的path | |
content.description | string | 操作说明 | |
content.parameters | object | 操作的默认参数 | |
content.resourceId | string | 操作的resourceId | |
content.web | boolean | 设置Web操作 | |
content.raw-http | boolean | 是否使用HTTP原文 | |
content.custom-options | boolean | 设置报头选项 | |
content.exec.binary | boolean | 代码文件是否为二进制 | |
content.exec.code | string | 源代码 | |
content.exec.kind | string | 使用语言 | |
content.exec.main | string | 代码内将运行的函数 | |
content.limits.memory | number | 分配给操作容器的内存大小 | |
content.limits.timeout | number | 可运行操作的最长时间 | |
content.vpc | vpc信息 | 只会在platform为vpc时显示 | |
content.vpc.vpcNo | number | 已连接vpc的No | |
content.vpc.vpcNo | number | 已连接subnet的No |
Sequence Action
{
"content": {
"name": "string",
"path": "string",
"description": "string",
"resourceId": "string",
"web": "boolean",
"exec": {
"kind": "string",
"components": [
"string"
]
}
}
}
项目 | 类型 | 说明 | 备注 |
---|---|---|---|
content.name | string | 操作名称 | |
content.path | string | 操作的path | |
content.description | string | 操作说明 | |
content.resourceId | string | 操作的resourceId | |
content.web | boolean | 设置Web操作 | |
content.exec.kind | string | 序列操作 | |
content.exec.components | string array | 连接的操作列表 |
本文对您有帮助吗?