Show / Hide Table of Contents

Class AlarmRule

Class with static functions to build AlarmRule for Composite Alarms.

Inheritance
object
AlarmRule
Namespace: Amazon.CDK.AWS.CloudWatch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AlarmRule : DeputyBase
Syntax (vb)
Public Class AlarmRule Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
Alarm alarm1;
            Alarm alarm2;
            Alarm alarm3;
            Alarm alarm4;


            var alarmRule = AlarmRule.AnyOf(AlarmRule.AllOf(AlarmRule.AnyOf(alarm1, AlarmRule.FromAlarm(alarm2, AlarmState.OK), alarm3), AlarmRule.Not(AlarmRule.FromAlarm(alarm4, AlarmState.INSUFFICIENT_DATA))), AlarmRule.FromBoolean(false));

            new CompositeAlarm(this, "MyAwesomeCompositeAlarm", new CompositeAlarmProps {
                AlarmRule = alarmRule
            });

Synopsis

Constructors

AlarmRule()

Class with static functions to build AlarmRule for Composite Alarms.

Methods

AllOf(params IAlarmRule[])

function to join all provided AlarmRules with AND operator.

AnyOf(params IAlarmRule[])

function to join all provided AlarmRules with OR operator.

FromAlarm(IAlarmRef, AlarmState)

function to build Rule Expression for given IAlarm and AlarmState.

FromBoolean(bool)

function to build TRUE/FALSE intent for Rule Expression.

FromString(string)

function to build Rule Expression for given Alarm Rule string.

Not(IAlarmRule)

function to wrap provided AlarmRule in NOT operator.

Constructors

AlarmRule()

Class with static functions to build AlarmRule for Composite Alarms.

public AlarmRule()
Remarks

ExampleMetadata: infused

Examples
Alarm alarm1;
            Alarm alarm2;
            Alarm alarm3;
            Alarm alarm4;


            var alarmRule = AlarmRule.AnyOf(AlarmRule.AllOf(AlarmRule.AnyOf(alarm1, AlarmRule.FromAlarm(alarm2, AlarmState.OK), alarm3), AlarmRule.Not(AlarmRule.FromAlarm(alarm4, AlarmState.INSUFFICIENT_DATA))), AlarmRule.FromBoolean(false));

            new CompositeAlarm(this, "MyAwesomeCompositeAlarm", new CompositeAlarmProps {
                AlarmRule = alarmRule
            });

Methods

AllOf(params IAlarmRule[])

function to join all provided AlarmRules with AND operator.

public static IAlarmRule AllOf(params IAlarmRule[] operands)
Parameters
operands IAlarmRule[]

IAlarmRules to be joined with AND operator.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

AnyOf(params IAlarmRule[])

function to join all provided AlarmRules with OR operator.

public static IAlarmRule AnyOf(params IAlarmRule[] operands)
Parameters
operands IAlarmRule[]

IAlarmRules to be joined with OR operator.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

FromAlarm(IAlarmRef, AlarmState)

function to build Rule Expression for given IAlarm and AlarmState.

public static IAlarmRule FromAlarm(IAlarmRef alarm, AlarmState alarmState)
Parameters
alarm IAlarmRef

IAlarm to be used in Rule Expression.

alarmState AlarmState

AlarmState to be used in Rule Expression.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

FromBoolean(bool)

function to build TRUE/FALSE intent for Rule Expression.

public static IAlarmRule FromBoolean(bool value)
Parameters
value bool

boolean value to be used in rule expression.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

FromString(string)

function to build Rule Expression for given Alarm Rule string.

public static IAlarmRule FromString(string alarmRule)
Parameters
alarmRule string

string to be used in Rule Expression.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

Not(IAlarmRule)

function to wrap provided AlarmRule in NOT operator.

public static IAlarmRule Not(IAlarmRule operand)
Parameters
operand IAlarmRule

IAlarmRule to be wrapped in NOT operator.

Returns

IAlarmRule

Remarks

ExampleMetadata: infused

Back to top Generated by DocFX