Viewing Event Notification Settings
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
You can call ObsClient.GetBucketNotification to view event notification settings of a bucket. Sample code is as follows:
// Create an instance of ObsClient.
ObsClient client = new ObsClient("*** Provide your Access Key ***", "*** Provide your Secret Key ***", "https://your-endpoint");
// View event notification settings.
try
{
GetBucketNotificationRequest request = new GetBucketNotificationRequest
{
BucketName = "bucketname",
};
GetBucketNotificationReponse response = client.GetBucketNotification(request);
if (response.Configuration.FunctionGraphConfigurations.Count > 0)
{
foreach (FunctionGraphConfiguration functionGraphConfig in response.NotificationConfiguration.FunctionGraphConfigurations)
{
Console.WriteLine("ID is : {0}", functionGraphConfig.Id);
Console.WriteLine("Topic is : {0}", functionGraphConfig.Topic);
foreach (EventTypeEnum e in functionGraphConfig.Events)
{
Console.WriteLine("Event is : {0}", e);
}
foreach (FilterRule filterRule in functionGraphConfig.FilterRules)
{
Console.WriteLine("Name is : {0}", filterRule.Name);
Console.WriteLine("Value is : {0}", filterRule.Value);
}
}
}
if (response.Configuration.TopicConfigurations.Count > 0)
{
foreach (TopicConfiguration topicConfig in response.NotificationConfiguration.TopicConfigurations)
{
Console.WriteLine("ID is : {0}", topicConfig.Id);
Console.WriteLine("TopicConfiguration is : {0}", topicConfig.Topic);
foreach (EventTypeEnum e in topicConfig.Events)
{
Console.WriteLine("Event is : {0}", e);
}
foreach (FilterRule filterRule in topicConfig.FilterRules)
{
Console.WriteLine("Name is : {0}", filterRule.Name);
Console.WriteLine("Value is : {0}", filterRule.Value);
}
}
}
}
catch (ObsException ex)
{
Console.WriteLine("ErrorCode: {0}", ex.ErrorCode);
Console.WriteLine("ErrorMessage: {0}", ex.ErrorMessage);
} Last Article: Configuring Event Notification
Next Article: Disabling Event Notification
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.