UpdateFunction
Update a function.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mpserverless:UpdateFunction |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Desc |
string |
No |
Function description. |
description |
| Name |
string |
Yes |
Function name. |
demoFunction |
| SpaceId |
string |
Yes |
Service space ID. |
dece4ea0-d432-4cfa-8514-8a88d205e2b8 |
| Memory |
integer |
No |
Function memory size. Must be a multiple of 64 MB. Minimum is 128 MB. Maximum is 2048 MB. |
256 |
| Timeout |
integer |
No |
Function timeout period in seconds. Default is 5. Valid range is 1 to 7200. |
5 |
| HttpTriggerPath |
string |
No |
HTTP trigger path. To disable this feature, set this parameter to an empty string. The path must start with /http. It cannot end with /. Paths must be unique within the same service space. Only the following characters are allowed: /, -, |
/http/hello |
| TimingTriggerConfig |
string |
No |
Scheduled trigger configuration. To disable this feature, set this parameter to an empty string. For configuration rules, see Use scheduled triggers for functions. Note
Public preview: cron:0 0 */2 * * *. Commercial edition: 0 0 */2 * * *. |
cron:0 0 * * * * |
| TimingTriggerUserPayload |
string |
No |
Custom input parameter for scheduled tasks. Note
This feature is supported only in the commercial edition. |
hello |
| InstanceConcurrency |
integer |
No |
Maximum concurrent invocations per instance. Default is 1. Valid range is 1 to 20. Setting a value greater than 1 reduces cold starts. Use this setting when your function spends most of its time waiting for downstream services. Do not use it if your function has shared state that cannot be accessed concurrently. Also avoid it if a single request consumes large amounts of CPU or memory. Note
|
1 |
| Runtime |
string |
No |
Function runtime environment. Supported values include nodejs12 and nodejs14. For the full list, see Supported runtimes. Valid values:
|
nodejs14 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
Request ID. |
C293BB03-B6AD-46C2-80D1-19C8FB573916 |
| TimingTriggerConfig |
string |
Scheduled trigger configuration. |
cron:0 0 * * * * |
| TimingTriggerUserPayload |
string |
Custom input parameter for scheduled tasks. You can access this value in your function code as |
24 |
| HttpTriggerPath |
string |
HTTP trigger path. |
/http/hello |
| CreatedAt |
string |
Function creation time. |
2019-06-20T03:22:54.854Z |
| Name |
string |
Function name. |
demoFunction |
| ModifiedAt |
string |
Function last modified time. |
2019-06-20T03:22:54.854Z |
| Desc |
string |
Function description. |
description |
| Spec |
object |
Function runtime configuration. |
|
| Timeout |
string |
Timeout period. |
5s |
| Runtime |
string |
Runtime environment. |
Node.js 8 |
| InstanceConcurrency |
integer |
Maximum concurrent invocations per instance. |
1 |
| Memory |
string |
Memory size. |
128 MB |
Examples
Success response
JSON format
{
"RequestId": "C293BB03-B6AD-46C2-80D1-19C8FB573916",
"TimingTriggerConfig": "cron:0 0 * * * *",
"TimingTriggerUserPayload": "24",
"HttpTriggerPath": "/http/hello",
"CreatedAt": "2019-06-20T03:22:54.854Z",
"Name": "demoFunction",
"ModifiedAt": "2019-06-20T03:22:54.854Z",
"Desc": "description",
"Spec": {
"Timeout": "5s",
"Runtime": "Node.js 8",
"InstanceConcurrency": 1,
"Memory": "128 MB"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.