For details about the CTS event source, see Supported Event Sources.
You have created an agency on IAM. For details, see Creating an Agency.
# -*- coding:utf-8 -*-'''CTS trigger event:{"cts": {"time": "","user": {"name": "userName","id": "","domain": {"name": "domainName","id": ""}},"request": {},"response": {},"code": 204,"service_type": "FunctionGraph","resource_type": "","resource_name": "","resource_id": {},"trace_name": "","trace_type": "ConsoleAction","record_time": "","trace_id": "","trace_status": "normal"}}'''def handler (event, context):trace_name = event["cts"]["resource_name"]timeinfo = event["cts"]["time"]print(timeinfo+' '+trace_name)
Parameter | Description |
|---|---|
Trigger Type | Select Cloud Trace Service (CTS). |
Notification Name | Enter a notification name, for example, Test. |
Service Type | Select FunctionGraph. |
Resource Type | Resource types supported by the selected service, such as triggers, instances, and functions. |
Trace Name | Operations that can be performed on the selected resource type, such as creating or deleting a trigger. |
A maximum of 10 services, each with up to 10 operations, can be added for each CTS trigger. The total number of operations cannot exceed 100. For details, see Supported Services and Operation Lists.
Parameter | Description |
|---|---|
Configure Test Event | You can choose to create a test event or edit an existing one. Use the default option Create new test event. |
Event Template | Select Cloud Trace Service (CTS) and use the built-in CTS event template. |
Event Name | Enter an event name, for example, cts-test. |
Event data | The system automatically loads the event data in the CTS event template. You can modify the event data as required. |