Updates a trigger.

Request headers

This operation uses only common request headers. For more information, see the documentation of common request parameters.

Parameter Type Required Example Description
If-Match String No e19d5cd5af0378da05f63f891c74****

This parameter is used to ensure that the modified resource is consistent with the resource to be modified. You can obtain the parameter value from the responses of CreateTrigger, GetTrigger, and UpdateTrigger operations.

Request syntax

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

Request parameters

Parameter Type Position Required Example Description
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 No acs:ram::1986114****4305:role/aliyunosseventnotificationrole

The role that is required when event sources such as Object Storage Service (OSS) invoke the function. For more information, see Overview.

qualifier String Body No null

The version of the service. For more information, see Overview.

triggerConfig String Body No true

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

Response parameters

Parameter Type Example Description
ETag String 738136ea26b79cee660862cd762894ea

This parameter 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::19861144305****:role/aliyunosseventnotificationrole

The role required when event sources such as OSS invoke the function. For more information, see Overview.

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

The time when the trigger was last updated.

qualifier String null

The version of the service. For more information, see Overview.

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:

  • oss: the OSS trigger. For more information, see Overview.
  • log: the Log Service trigger. For more information, see Overview.
  • timer: the time trigger. For more information, see Overview.
  • http: the HTTP trigger. For more information, see Overview.
  • tablestore: the Tablestore trigger. For more information, see Overview.
  • cdn_events: the Alibaba Cloud CDN trigger. For more information, see Overview.
  • mns_topic: the Message Service (MNS) topic trigger. For more information, see Overview.

Example

Sample requests

PUT /services/service_name/functions/function_name/triggers/image_resize HTTP/1.1
Host:fc-ram.aliyuncs.com
If-Match:e19d5cd5af0378da05f63f891c74****
Content-Type:application/json

{
  "invocationRole" : "acs:ram::1986114****4305:role/aliyunosseventnotificationrole",
  "qualifier" : "null",
  "triggerConfig" : "true"
}

Sample success responses

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "createdTime" : "2020-04-08T01:48:21Z",
  "invocationRole" : "acs:ram::19861144305****:role/aliyunosseventnotificationrole",
  "lastModifiedTime" : "2020-04-08T07:15:37Z",
  "qualifier" : "null",
  "sourceArn" : "acs:oss:cn-shanghai:12345:mybucket",
  "triggerConfig" : "true",
  "triggerName" : "trigger_name",
  "triggerType" : "oss"
}