Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Updating a Trigger

Function

This API is used to update a trigger.

URI

PUT /v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

function_urn

Yes

String

Function URN. For details, see the function model description.

trigger_type_code

Yes

String

Trigger type code. (OBS triggers are not available in the International regions.)

Enumeration values:

  • TIMER
  • APIG
  • CTS
  • DDS
  • DMS
  • DIS
  • LTS
  • OBS
  • SMN
  • KAFKA
  • RABBITMQ
  • DEDICATEDGATEWAY
  • OPENSOURCEKAFKA
  • APIC
  • Gemini Mongo
  • EVENTGRID
  • IOTDA

trigger_id

Yes

String

Trigger ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Content-Type

Yes

String

Message body type (format).

Default: application/json

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

trigger_status

No

String

Trigger status.

Enumeration values:

  • ACTIVE
  • DISABLED

event_data

No

Array of UpdateriggerEventData objects

Trigger update event.

Table 4 UpdateriggerEventData

Parameter

Mandatory

Type

Description

is_serial

No

Boolean

Serial data processing.

max_fetch_bytes

No

Integer

Max. bytes.

polling_interval

No

Integer

Pull period.

polling_unit

No

String

Pull period unit.

Enumeration values:

  • ms
  • s

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

trigger_id

String

Trigger ID.

trigger_type_code

String

Trigger type. (OBS triggers are not available in the International regions.)

  • TIMER
  • APIG
  • CTS
  • DDS
  • DMS
  • DIS
  • LTS
  • OBS
  • SMN
  • KAFKA

Enumeration values:

  • TIMER
  • APIG
  • CTS
  • DDS
  • DMS
  • DIS
  • LTS
  • OBS
  • SMN
  • KAFKA
  • RABBITMQ
  • DEDICATEDGATEWAY
  • OPENSOURCEKAFKA
  • APIC
  • Gemini Mongo
  • EVENTGRID
  • IOTDA

trigger_status

String

Trigger status.

  • ACTIVE: The trigger is enabled.
  • DISABLED: The trigger is disabled.

Enumeration values:

  • ACTIVE
  • DISABLED

event_data

TriggerEventDataResponseBody object

Trigger source event.

last_updated_time

String

Latest update time.

created_time

String

Time when the trigger was created.

Table 6 TriggerEventDataResponseBody

Parameter

Type

Description

name

String

Trigger name.

schedule_type

String

Timer trigger type (timer trigger parameter).

  • Rate: specifies the frequency (minutes, hours, or days) at which the function is invoked. If the unit is minute, the value cannot exceed 60. If the unit is hour, the value cannot exceed 24. If the unit is day, the value cannot exceed 30.
  • Cron: specifies a Cron expression to periodically invoke a function.

Enumeration values:

  • Rate
  • Cron

schedule

String

Triggering rule. (timer trigger parameter).

  • When the trigger type is Rate, the scheduled rule is used. When the trigger type is Cron, the Cron expression is used.

user_event

String

Additional information (timer trigger parameter). When the timer trigger triggers the function, the execution event (the event parameter of the function) is {"version": "v1.0", "time": "2018-06-01T08:30:00+08:00", "trigger_type": "TIMER", "trigger_name": "Timer_001", "user_event": "Additional information you entered"}.

triggerid

String

APIG trigger ID (APIG trigger parameter).

type

Integer

The API type (APIG trigger parameter).

  • 1: public
  • 2: private

path

String

Path of the API (APIG trigger parameter).

protocol

String

Request protocol of the API (APIG trigger parameter).

Enumeration values:

  • HTTP
  • HTTPS

req_method

String

Request mode of the API (APIG trigger parameter).

Enumeration values:

  • GET
  • POST
  • PUT
  • DELETE
  • HEAD
  • PATCH
  • OPTIONS
  • ANY

group_id

String

ID of the group to which the API belongs (APIG trigger parameter).

group_name

String

Name of the group to which the API belongs (APIG trigger parameter).

match_mode

String

Matching mode of the API (APIG trigger parameter).

  • SWA: prefix match
  • NORMAL: normal match (absolute match)

Enumeration values:

  • SWA
  • NORMAL

env_name

String

Environment in which the API is published (APIG trigger parameter).

env_id

String

ID of the environment in which the API has been published (APIG trigger parameter).

api_id

String

API ID (APIG trigger parameter).

api_name

String

API name (APIG trigger parameter).

auth

String

Security authentication (APIG trigger parameter).

  • IAM: IAM authentication. Only IAM users are allowed to access the system. The security level is medium.
  • APP: Appkey&Appsecret authentication is used. The security level is high. This authentication mode is recommended.
  • NONE: No authentication mode is used. All users can access the system. This mode is not recommended.

Enumeration values:

  • IAM
  • APP
  • NONE

invoke_url

String

API calling address (APIG trigger parameter).

func_info

ApigTriggerFuncInfo object

FunctionGraph backend details (APIG trigger parameter). This parameter is mandatory for APIG triggers.

sl_domain

String

Subdomain name allocated by the APIG system by default (APIG trigger parameter).

Minimum: 1

Maximum: 255

backend_type

String

Backend type of the API (APIG trigger parameter).

Enumeration values:

  • FUNCTION

instance_id

String

Instance ID. This parameter is mandatory for DDS, Kafka, and RabbitMQ triggers.

  • APIG trigger: APIG gateway ID
  • DDS trigger: DB instance ID.
  • Kafka trigger: Kafka instance ID
  • RabbitMQ trigger: RabbitMQ instance ID

roma_app_id

String

ID of the integration application to which the API belongs (APIG trigger parameter).

operations

Array of strings

Custom operations (CTS trigger parameter). CTS collects operation records of subscribed cloud resources. If you create a function with a CTS trigger, collected operation records of specified cloud services will be passed as a parameter to invoke the function.

collection_name

String

Collection name (DDS trigger parameter).

db_name

String

Database name (DDS trigger parameter).

db_password

String

DDS database password (DDS trigger parameter).

db_user

String

DDS database username (DDS trigger parameter).

instance_addrs

Array of strings

DDS database instance address (DDS trigger parameter).

mode

String

DDS database instance type (DDS trigger parameter).

  • Sharding: cluster instance
  • ReplicaSet: replica set instance
  • Single: single node instance.

batch_size

Integer

Batch size: Maximum number of data records that can be processed by the function at a time. This parameter is mandatory for DIS, DDS, Kafka, and RabbitMQ triggers.

  • DDS trigger: Set the batch size to a value ranging from 1 to 10,000.
  • DIS trigger: Set the batch size to a value ranging from 1 to 10,000.
  • Kafka trigger: Set the batch size to a value ranging from 1 to 1000.
  • RabbitMQ trigger: Set the batch size to a value ranging from 1 to 1000.

queue_id

String

Queue ID (DMS trigger parameter).

consumer_group_id

String

Consumer group ID (DMS trigger parameter).

polling_interval

Integer

Pull period.

stream_name

String

Stream name (DIS trigger parameter).

sharditerator_type

String

Start position (DIS trigger parameter).

  • TRIM_HORIZON: Data is read from the earliest valid record stored in the partition.
  • LATEST: Data is read from the latest record in the partition. This option ensures that the most recent data in the partition is read.

Enumeration values:

  • TRIM_HORIZON
  • LATEST

polling_unit

String

Unit of the pull period (DIS trigger parameter).

  • s: second
  • ms: millisecond

Enumeration values:

  • s
  • ms

max_fetch_bytes

Integer

Maximum number of bytes to be extracted (DIS trigger parameter).

Minimum: 0

Maximum: 4194304

is_serial

String

Serial Data Processing: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends.

Enumeration values:

  • true
  • false

log_group_id

String

Log group ID (LTS trigger parameter).

log_topic_id

String

Log stream ID (LTS trigger parameter).

bucket

String

Bucket name (OBS trigger parameter). The name of the OBS bucket used as the event source cannot be the same as that of an existing bucket of the current user or another user. After being created, the bucket name cannot be modified.

Minimum: 1

Maximum: 64

prefix

String

Prefix (OBS trigger parameter). Enter a prefix to limit notifications to objects whose names start with the matching characters.

Minimum: 0

Maximum: 1024

suffix

String

Suffix (OBS trigger parameter). Enter a suffix to limit notifications to objects whose names end with the matching characters.

Minimum: 0

Maximum: 1024

events

Array of strings

Trigger event (OBS trigger parameter).

  • ObjectCreated: all object creation operations, including PUT, POST, COPY, and part assembling
  • Put: Uploads an object using Put.
  • Post: Uploads an object using POST
  • Copy: Copies an object using COPY.
  • CompleteMultipartUpload: Merges parts of a multipart upload.
  • ObjectRemoved: Deletes an object.
  • Delete: Deletes an object by specifying its version ID.
  • DeleteMarkerCreated: Deletes an object without specifying its version ID.

topic_urn

String

Topic URN (SMN trigger parameter)

Minimum: 1

Maximum: 255

topic_ids

Array of strings

The Kafka topic ID list (Kafka trigger parameter).

kafka_user

String

Kafka account name (Kafka trigger parameter).

kafka_password

String

Kafka password (Kafka trigger parameter).

kafka_connect_address

String

Kafka instance connection address (Kafka trigger parameter).

kafka_ssl_enable

Boolean

Whether to enable SASL authentication(Kafka trigger parameter).

access_password

String

RabbitMQ account password (RabbitMQ trigger parameter).

access_user

String

RabbitMQ username (RabbitMQ trigger parameter).

connect_address

String

Instance IP address (RabbitMQ trigger parameter).

exchange_name

String

Switch name (RabbitMQ trigger parameter).

vhost

String

Virtual host (RabbitMQ trigger parameter).

ssl_enable

Boolean

Whether to enable SSL (RabbitMQ trigger parameter).

Table 7 ApigTriggerFuncInfo

Parameter

Type

Description

function_urn

String

Function URN. For details, see the function model descriptions.

invocation_type

String

Execution mode of a function.

  • sync: synchronous execution
  • async: asynchronous execution

Enumeration values:

  • sync
  • async

timeout

Integer

Timeout allowed for APIG to request the FunctionGraph service. The unit is in millisecond. This parameter is mandatory for APIG triggers.

Minimum: 1

Maximum: 60000

version

String

Function version information.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Enable a trigger.

PUT https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}/{trigger_type_code}/{trigger_id}

{
  "trigger_status" : "ACTIVE"
}

Example Responses

Status code: 200

OK

{
  "trigger_id" : "9a14fae1-78cf-4185-ac7a-429eb6dc41fb",
  "trigger_type_code" : "TIMER",
  "trigger_status" : "ACTIVE",
  "event_data" : {
    "name" : "Timer-cpg3",
    "schedule" : "3m",
    "schedule_type" : "Rate"
  },
  "last_updated_time" : "2022-11-09 16:37:24",
  "created_time" : "2019-10-29171553"
}

Status code: 404

Not Found

{
  "error_code" : "FSS.0404",
  "error_msg" : "not found"
}

Status Codes

Status Code

Description

200

OK

404

Not Found

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback