Updated on 2023-07-06 GMT+08:00

Querying All Triggers of a Function

Function

This API is used to query all triggers of a function.

URI

GET /v2/{project_id}/fgs/triggers/{function_urn}

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.

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.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array of ListFunctionTriggerResult objects

Table 4 ListFunctionTriggerResult

Parameter

Type

Description

trigger_id

String

Trigger ID.

trigger_type_code

String

Trigger type.

  • 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

  • GAUSSMONGO

  • EVENTGRID

  • IOTDA

trigger_status

String

Trigger status.

  • ACTIVE: The trigger is enabled.

  • DISABLED: The trigger is disabled.

Enumeration values:

  • ACTIVE

  • DISABLED

event_data

Object

Trigger source event.

last_updated_time

String

Latest update time.

created_time

String

Time when the trigger was created.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

Query all triggers of a function.

GET https://{Endpoint}/v2/{project_id}/fgs/triggers/{function_urn}

Example Responses

Status code: 200

OK

[ {
  "trigger_id" : "1b3b264db3b849118d007884b9bc8a60",
  "trigger_type_code" : "APIG",
  "trigger_status" : "ACTIVE",
  "event_data" : {
    "api_id" : "4a59f6a7263c4d1dab3f69c34f98d949",
    "api_name" : "API_test_triggers",
    "auth" : "IAM",
    "env_id" : "DEFAULT_ENVIRONMENT_RELEASE_ID",
    "env_name" : "RELEASE",
    "func_info" : {
      "function_urn" : "urn:fss:xxxxx:46b6f338fc3445b8846c71dfb1fbxxxx:function:default:test_triggers",
      "invocation_type" : "sync",
      "timeout" : 5000,
      "version" : "latest"
    },
    "group_id" : "9205f83fe721481eb490870d380cf31d",
    "group_name" : "APIGroup_2mbe",
    "invoke_url" : "https://ed94ae9494ba4f70ac24224747202140.{apig_endpoint}/test_triggers",
    "match_mode" : "SWA",
    "name" : "API_test_triggers",
    "path" : "/test_triggers",
    "protocol" : "HTTPS",
    "req_method" : "ANY",
    "trigger_id" : "1b3b264db3b849118d007884b9bc8a60",
    "type" : 1
  },
  "last_updated_time" : "2022-11-09 16:37:24",
  "created_time" : "2022-11-09 16:37:24"
} ]

Status Codes

Status Code

Description

200

OK

400

Bad request.

401

Unauthorized.

403

Forbidden.

404

Not found.

500

Internal server error.

Error Codes

See Error Codes.