You can call this operation to update a trigger.

Request headers

This operation uses only common request headers. For more information, see Common parameters.

Request syntax

PUT /services/{serviceName}/functions/{functionName}/triggers/{triggerName} 

Request parameters

Parameter Type Position Required Example Description
If-Match String Header No trigger_name

The value used to ensure that the modified resource is consistent with the resource to be modified. The value is obtained from the responses of CreateTrigger, GetTrigger, and UpdateTrigger.

serviceName String Path Yes service_name

The name of the service.

functionName String Path Yes function_name

The name of the function.

triggerName String Path Yes image_resize

The name of the trigger.

Object Body Yes

The definition of the trigger.

invocationRole String Body Yes acs:ram::1986114****4305:role/aliyunosseventnotificationrole

The role required when the trigger source such as OSS invokes the function. For more information, see Overview.

qualifier String Body Yes null

The version of the service. For more information, see Introduction to versions.

triggerConfig String Body Yes true

The configurations of the trigger. The configurations vary with trigger types.

Response parameters

Parameter Type Example Description
ETag String trigger_name

The ETag value of the trigger name. This value is used to ensure that the modified trigger is consistent with the trigger to be modified.

createdTime String 2020-04-08T01:48:21Z

The time when the trigger was created.

invocationRole String acs:ram::1986114****4305:role/aliyunosseventnotificationrole

The role required when the trigger source such as OSS invokes the function. For more information, see Overview.

lastModifiedTime String 2020-04-08T07:15:37Z

The last time when the trigger was updated.

qualifier String null

The version of the service. For more information, see Introduction to versions.

sourceArn String acs:oss:cn-shanghai:12345:mybucket

The Alibaba Cloud Resource Name (ARN) of the event source for the trigger.

triggerConfig String true

The configurations of the trigger. The configurations vary with trigger types.

triggerName String trigger_name

The name of the trigger.

triggerType String oss

The type of the trigger. Valid values:

Examples

Sample requests

PUT /services/service_name/functions/function_name/triggers/trigger_name HTTP/1.1

正常返回示例

JSON 格式

HTTP/1.1 200 OK 公共响应头 {   "triggerName": "trigger_name",   "description": "test_description",   "triggerId": "b883122b-6f86-4889-bb69-1729a417***",   "sourceArn": "acs:oss:cn-shanghai:12345:mybucket",   "triggerType": "oss",   "invocationRole": "acs:ram::1986114****4305:role/aliyunosseventnotificationrole",   "qualifier":null,   "triggerConfig": {     "events": [       "oss:ObjectCreated:*"     ],     "filter": {       "key": {         "prefix": "prefix_text",         "suffix": ".png"       }     }   },   "createdTime": "2020-04-08T01:48:21Z",   "lastModifiedTime": "2020-04-08T07:15:37Z" }