The following code examples show how to use ListRuleNamesByTarget
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:
- SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. List all of the rule names using the target.
/// <summary> /// List names of all rules matching a target. /// </summary> /// <param name="targetArn">The ARN of the target.</param> /// <returns>The list of rule names.</returns> public async Task<List<string>> ListAllRuleNamesByTarget(string targetArn) { var results = new List<string>(); var request = new ListRuleNamesByTargetRequest() { TargetArn = targetArn }; ListRuleNamesByTargetResponse response; do { response = await _amazonEventBridge.ListRuleNamesByTargetAsync(request); results.AddRange(response.RuleNames); request.NextToken = response.NextToken; } while (response.NextToken is not null); return results; }
-
For API details, see ListRuleNamesByTarget in AWS SDK for .NET API Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using EventBridge with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.