Amazon.CloudWatchEvents.AmazonCloudWatchEventsClient.PutRule C# (CSharp) Method

PutRule() public method

Creates or updates a rule. Rules are enabled by default, or based on value of the State parameter. You can disable a rule using DisableRule.

Note: When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Please allow a short period of time for changes to take effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule will trigger on matching events as well as on a schedule.

Note: Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.

/// This exception occurs if there is concurrent modification on rule or target. /// /// This exception occurs due to unexpected causes. /// /// The event pattern is invalid. /// /// This exception occurs if you try to create more rules or add more targets to a rule /// than allowed by default. ///
public PutRule ( PutRuleRequest request ) : PutRuleResponse
request Amazon.CloudWatchEvents.Model.PutRuleRequest Container for the necessary parameters to execute the PutRule service method.
return Amazon.CloudWatchEvents.Model.PutRuleResponse
        public PutRuleResponse PutRule(PutRuleRequest request)
        {
            var marshaller = new PutRuleRequestMarshaller();
            var unmarshaller = PutRuleResponseUnmarshaller.Instance;

            return Invoke<PutRuleRequest,PutRuleResponse>(request, marshaller, unmarshaller);
        }