nav-img
Advanced

Trigger Management Models

This section describes the returned fields of the trigger management models.

Trigger Type Model

{
"trigger_type_code":"string",
"display_name":"string",
"status":"string",
"event_codes":"array of string",
"description":"string"
}

Table 1 describes the fields in the trigger type model.

Table 1 Fields in the trigger type model

Field

Description

trigger_type_code

Trigger type code. Options: SMN, APIG, OBS, TIMER, DIS, LTS, CTS, and kafka.

display_name

Trigger type value.

status

Trigger type status. Options:

  • DISABLED: The trigger is disabled.
  • TEST: The trigger is under test and invisible to clients.
  • ACTIVE: The trigger is available.

event_codes

Event attribute field.

description

Trigger description.

Trigger Instance Model

{
"trigger_id":"string",
"trigger_type_code":"string",
"event_type_code":"string",
"status":"string",
"event_data":"json struct",
"last_updated_time":"string",
"created_time":"string"
}

Table 2 describes the fields in the trigger instance model.

Table 2 Fields in the trigger instance model

Field

Description

trigger_id

Trigger ID.

trigger_type_code

Trigger type code. Options: SMN, APIG, OBS, TIMER, DIS, LTS, CTS, and kafka.

event_type_code

Event type code. This parameter is mandatory. It can be a non-null character string. This field is not used currently.

status

Trigger status. Options: ACTIVE and DISABLED.

event_data

Trigger data defined in JSON format.

last_updated_time

Time when the trigger was last updated.

created_time

Time when the trigger was created.

Trigger Instance Data

  • The data of a Simple Message Notification (SMN) trigger is as follows:
    {
    "topic_urn":"string",
    "subscription_status":"string"
    }

    Table 3 describes the fields of an SMN trigger.

    Table 3 Fields of an SMN trigger

    Field

    Description

    topic_urn

    URN of an SMN topic. This parameter is mandatory when you create an SMN trigger.

    subscription_status

    Subscription status of a topic. Options: Unconfirmed and Confirmed.

  • The data of an Object Storage Service (OBS) trigger is as follows:
    {
    "bucket": "yourBucketName",
    "events": ["s3:ObjectCreated:Put"],
    "prefix": "yourPrefix",
    "suffix": "yourSuffix"
    }
    Table 4 Fields of an OBS trigger

    Field

    Description

    bucket

    Bucket name. This parameter is mandatory.

    events

    Collection of OBS trigger events. Options: s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:DeleteMarkerCreated, and s3:ObjectRemoved:Delete. This field is mandatory.

    Note that s3:objectcreated:* includes all events that start with s3:objectcreated, and s3:objectremoved:* includes all events that start with s3:objectremoved.

    prefix

    Prefix of an OBS object. This field is optional.

    suffix

    Suffix of an OBS object. This field is optional.

  • The data of a Data Ingestion Service (DIS) trigger is as follows:
    {
    "stream_name": "dis-qYPJ",
    "polling_interval": 30,
    "batch_size": 100,
    "sharditerator_type": "TRIM_HORIZON"
    }

    Table 5 describes the fields of a DIS trigger.

    Table 5 Fields of a DIS trigger

    Field

    Description

    stream_name

    Name of a stream. This field is mandatory.

    polling_interval

    Pull period. This field is optional. Value range: 1–60. Default value: 30.

    batch_size

    Number of data records that can be pulled from a specified stream. This field is optional. Value range: 1–10000. Default value: 100.

    sharditerator_type

    Options: TRIM_HORIZON (pulling data from the beginning of a stream) and LATEST (pulling data from the current position). This parameter is mandatory.

  • The data of an APIG trigger is as follows:
    {
    "group_id":"string",
    "env_id":"string",
    "auth":"string",
    "protocol":"string",
    "name":"string",
    "path":"string",
    "match_mode":"string",
    "req_method":"string" ,
    "backend_type":"string" ,
    "type": int ,
    "sl_domain":"string" ,
    "instance_id":"string"
    }

    Table 6 describes the fields of an APIG trigger.

    Table 6 Fields of an APIG trigger

    Field

    Description

    group_id

    API group. This field is mandatory.

    env_id

    API publishing environment. This field is mandatory.

    auth

    API authentication mode. Options: NONE, IAM, and APP. This field is mandatory.

    protocol

    Access protocol. Options: HTTP and HTTPS. This field is mandatory.

    name

    API name. This field is mandatory.

    path

    API access address, which must meet the URL rules, for example, /a/b. This field is mandatory.

    match_mode

    Match mode. Currently, only the prefix match mode (corresponding to SWA) is supported. This field is mandatory.

    req_method

    API request method, which is of enumerated type. Options: GET, POST, and PUT. This field is mandatory.

    backend_type

    Backend type, which must be set to FUNCTION. This field is mandatory.

    type

    API type. Currently, only 1 is supported, indicating open API. This field is mandatory.

    sl_domain

    Subdomain name. This field is mandatory.

    instance_id

    Instance ID. This field is mandatory when trigger_type_code is set to DEDICATEDGATEWAY or APIC.

  • The data of a timer trigger is as follows:
    {
    "name": "string",
    "schedule_type": "string",
    "schedule": "string",
    "user_event": "string"
    }

    Table 7 describes the fields of a timer trigger.

    Table 7 Fields of a timer trigger

    Field

    Description

    name

    Trigger name. This field is mandatory.

    schedule_type

    Schedule type. Options: Rate or Cron. This field is mandatory.

    schedule

    Schedule setting, which varies depending on the schedule type you choose. This field is mandatory.

    When schedule_type is set to Rate, add unit m, h, or d behind a rate, for example, 3m for 3 minutes.

    user_event

    Additional information for calling a function. This field is optional.

  • The data of a Log Tank Service (LTS) trigger is as follows:
    {
    "trigger_type_code": "LTS",
    "event_type_code": "MessageCreated",
    "trigger_status": "ACTIVE",
    "event_data": {
    "log_group_id": "3e4d3bf7-7bad-11e9-92c5-fa163e6216be",
    "log_topic_id": "41d90375-7bad-11e9-8bcf-fa163ea23ac3",
    "log_group_name": "lts-group-5b42",
    "log_topic_name": "lts-topic-5f3e"
    }
    }

    Table 8 describes the fields of an LTS trigger.

    Table 8 Fields of an LTS trigger

    Field

    Description

    trigger_type_code

    Trigger type.

    event_type_code

    Event type.

    trigger_status

    Trigger status.

    event_data

    Trigger data defined in JSON format.

    log_group_id

    Log group. This field is mandatory when you create an LTS trigger.

    log_topic_id

    Log topic. This field is mandatory when you create an LTS trigger.

    log_group_name

    LTS log group name.

    log_topic_name

    LTS log topic name.

  • The data of a Cloud Trace Service (CTS) trigger is as follows:
    {
    "name": "eqwrwe",
    "operations": ["AAD:addprotocolrule:addProtocolRule", "BCS:baas-apiserver:scalePeers", "ARS:ars:setConfigArs"]
    }

    Table 9 describes the fields of a CTS trigger.

    Table 9 Fields of a CTS trigger

    Field

    Description

    name

    Name of a key notification.

    operations

    Operation list.

    The format is "service type:resource type A;resource type B:operation 1;operation 2". Example: ["ECS:ecs;server:restartServer;deleteServer",...].

  • The data of a Kafka trigger is as follows:
    {
    "instance_id": "string",
    "topic_id": "[]string",
    "kafka_user": "string",
    "kafka_password": "string",
    "kafka_ssl_enable": string,
    "batch_size": int,
    }
    Table 10 Fields of a Kafka trigger

    Field

    Description

    instance_id

    Kafka instance ID.

    topic_id

    Topic ID.

    kafka_user

    Username.

    kafka_password

    Password.

    kafka_ssl_enable

    Whether to enable SSL authentication. If SSL authentication is enabled, the kafka_user and kafka_password fields are mandatory.

    batch_size

    Batch size.