Editing an Event Subscription
Modify the description, status, event source, and event target of a subscription.
Constraints
- The event source provider cannot be changed.
- The bound custom event channel cannot be changed.
Modifying the Description
- Log in to the EG console.
- In the navigation pane, choose Event Subscriptions.
- Click Configure in the row that contains the desired subscription to go to the details page.
- Click the edit icon next to the default subscription name.
- Modify the description and click OK.
Changing the Status
- Log in to the EG console.
- In the navigation pane, choose Event Subscriptions.
- Click Disable or Enable in the row that contains the desired subscription.
Changing the Event Source
- Log in to the EG console.
- In the navigation pane, choose Event Subscriptions.
- Click the name of the desired subscription to go to the details page.
- Click the event source card.
- Modify the event source parameters.
When selecting Cloud services, set the parameters listed in Table 1.
Table 1 Cloud service event source parameters Parameter
Description
Event Source
Select a cloud service event source.
Event Type
(Optional) Select a predefined event type.
Filter Rule
Enter an event filter rule.
Only events that match these filter rules will be routed to the associated targets. For more information about filter rules, see Filter Rule Parameters and Example Filter Rules.
Figure 1 Configuring a cloud service event sourceWhen selecting Custom, set the parameters listed in Table 2.
Table 2 Custom event source parameters Parameter
Description
Channel
Select an existing custom event channel, for example, channel.
Event Source
Enter or select a custom event source that has been associated with the selected custom event channel.
Filter Rule
Enter an event filter rule.
Only events that match these filter rules will be routed to the associated targets. For more information about filter rules, see Filter Rule Parameters and Example Filter Rules.
Figure 2 Configuring a custom event source - Click OK.
- Click Save.
Changing the Event Target
- Log in to the EG console.
- In the navigation pane, choose Event Subscriptions.
- Click the name of the desired subscription to go to the details page.
- Change the event target or add another one.
- Click the event target card to change the event target.
- Click
to add an event target.
- Click
to delete an event target.
- Set the event target provider and relevant parameters.
When selecting Cloud services, set the following parameters.
- Event Target: Select an event target.
If you set Event Target to FunctionGraph (function computing):
- Function: Select the function to trigger. If no function is available, create a function first.
- Version/Alias: Choose to specify a version or alias.
- Version: Select a version of the function. By default, latest is selected.
- Alias: Select an alias of the function.
- Execute: Select Asynchronously or Synchronously.
Function invocation mode. Default: Asynchronously.
Asynchronously: Immediate responses of function invocation are not required.
Synchronously: Immediate responses of function invocation are required.
- Agency: Select an agency. If no agency is available, click Create Agency to generate one named EG_TARGET_AGENCY.
- Only agencies with EG as the delegated cloud service are displayed.
- Select an agency with the permission functiongraph:function:invoke*.
If you set Event Target to Distributed Message Service (DMS) for Kafka:
- Connection: Select a DMS for Kafka connection.
- Topic: Select a message topic.
- Enable: Whether to enable the message key function.
- Transform Type: Defines how message keys are used. There are two options:
- Variables: Keys are variable values from CloudEvents-compliant events.
- Constants: Keys are specified constants. All messages will be sent to the same partition.
For more information about the transform types, see Event Content Transformation.
If you set Event Target to Cloud service API:
- Cloud Service: Select a cloud service.
- API: Select a cloud service API and configure the API information.
- Agency: Select the created agency.
If you set Event Target to Simple Message Notification (SMN):
- Topic: Select a message topic.
- Agency: Select an agency. If no agency is available, click Create Agency to generate one named EG_SMN_PUBLISHER_AGENCY.
- Only agencies with EG as the delegated cloud service are displayed.
- Select an agency with the permission smn:topic:publish.
- Message Subject: Configure the subject through constants or variables.
- Type: Type of the message subject. Two types are available:
- Constants: The subject does not change from specified. All messages will use the same subject.
- Variables: The subject in the template is a variable value from CloudEvents-compliant events. Max.: 512 characters.
The Subject parameter is optional.
Rule:
- Transform Type: EG transforms CloudEvents-compliant events for targets. The following three types are supported:
- Pass-through: Directly route CloudEvents-compliant events to the target.
- Variables: Route variables in CloudEvents-compliant events to the target.
- Constants: Route constants in events to the target.
For more information about the transform types, see Event Content Transformation.
Figure 3 Configuring a cloud service event targetWhen selecting Custom, set the following parameters.- URL: Enter the URL of the event target starting with http:// or https:// and using the POST method.
The default timeout for pushing events to custom targets is 9 seconds. Exceeding this limit will cause delivery failure.
HTTP has high security risks, which may cause data eavesdropping or tampering. For data security, you are advised to use HTTPS. If you must use HTTP, ensure that the custom event does not contain any sensitive information. You are responsible for all related risks.Table 3 Event body parameters Parameter
Required
Type
Description
datacontenttype
No
String
Data content type
data
Yes
Array of Data objects
Data
subject
No
String
Subject
specversion
No
String
Specification version
id
Yes
String
Id
source
Yes
String
Event source
time
Yes
String
Time
type
Yes
String
Event type
ttl
Yes
String
Timeout
dataschema
No
String
Data schema
The following is an example of the event body (OBS Application Service as the event source):"datacontenttype":"application/json", "data": { "obs":{ "bucket":{ "bucket":"bucket-input-my", "name":"bucket-input-my", "arn":"", "ownerIdentity":{"ID":"f9e40463cxxxxxxxx9efd3a7ec854e"} }, "Version":"1.0", "configurationId":"a6b0bcf8-8874-4d8b-84f5-f9068527930f", "object":{ "versionId":"G00101928EE6072DFFFFD28824BB4AB8null", "oldpsxpth":"", "size":10, "eTag":"c9b20f7d442e65ede148e006dfe1308c", "key":"\xe4\xba\x8b\xe4\xbb\xxx\xxx\xxx\xxx\xxx\xxx\x85\xe6\xb5\x8b\xe8\xaf\x951015-2.txt", "sequencer":"1" } }, "eventVersion":"3.0", "responseElements":{ "x-obs-id-2":"", "x-obs-request-id":"3f905af2683e6ed7dbaec881b66390ab", "x-amz-request-id":"", "x-amz-id-2":"" }, "eventSource":"OBS", "eventTime":"2024-10-15T14:38:12.781Z", "requestParameters":{ "sourceIPAddress":"xx.xx.xx.xx" }, "eventName":"ObjectCreated:Put", "eventRegion":"cn-north-4", "userIdentity":{ "ID":"f9e40463c23xxxxxxxxefd3a7ec854e" } }, "subject":"\xe4\xba\x8b\xe4\xbb\xxx\xxx\xxx\xxx\xxx\xxx\xxx\xe6\xb5\x8b\xe8\xaf\x951015-2.txt", "specversion":"1.0", "id":"3f905af2683e6ed7dbaec881b66390ab", "source":"HC.OBS.DWR", "time":"2024-10-15T06:38:13.52240464Z", "type":"OBS:DWR:ObjectCreated:PUT", "ttl":"4000","dataschema":""
- Connection: Select a custom or the default connection. For details, see Connections.
- Headers Parameters
- Enter a request header.
- Enter a value.
- Specify whether to encrypt the header.
Figure 4 Header parameters
- For custom HTTPS events, add authorization configurations for the event target to improve security.
- If the request header and value are invalid, the encryption option is unavailable.
- Key: Max. 256 characters starting and ending with a letter. Only letters and hyphen (-) are allowed.
- Value: Max. 1024 characters, including letters, hyphens (-), underscores (_), spaces, and special characters (~!@#$%^&*()=+|[{}];:'",<.>/?).
- Transform Type: EG transforms CloudEvents-compliant events for targets. The following three types are supported:
- Pass-through: Directly route CloudEvents-compliant events to the target.
- Variables: Route variables in CloudEvents-compliant events to the target.
- Constants: Route constants in events to the target.
For more information about the transform types, see Event Content Transformation.
- Status: The dead letter queue is disabled by default. If enabled, EG sends failed events to the specified queue. If disabled, such events will be discarded. For details, see Dead Letter Queue.
Figure 5 Configuring a custom event target - Event Target: Select an event target.
- Click OK.
- Click Save.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot