Example usage for com.amazonaws.services.cloudwatch AmazonCloudWatch enableAlarmActions

List of usage examples for com.amazonaws.services.cloudwatch AmazonCloudWatch enableAlarmActions

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudwatch AmazonCloudWatch enableAlarmActions.

Prototype

EnableAlarmActionsResult enableAlarmActions(EnableAlarmActionsRequest enableAlarmActionsRequest);

Source Link

Document

Enables the actions for the specified alarms.

Usage

From source file:aws.example.cloudwatch.EnableAlarmActions.java

License:Open Source License

public static void main(String[] args) {

    final String USAGE = "To run this example, supply an alarm name\n"
            + "Ex: EnableAlarmActions <alarm-name>\n";

    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);//from   w  ww.  j  a  va2 s . com
    }

    String alarm = args[0];

    final AmazonCloudWatch cw = AmazonCloudWatchClientBuilder.defaultClient();

    EnableAlarmActionsRequest request = new EnableAlarmActionsRequest().withAlarmNames(alarm);

    EnableAlarmActionsResult response = cw.enableAlarmActions(request);

    System.out.printf("Successfully enabled actions on alarm %s", alarm);
}

From source file:cloudwatch.src.main.java.aws.example.cloudwatch.EnableAlarmActions.java

License:Open Source License

public static void main(String[] args) {

    final String USAGE = "To run this example, supply an alarm name\n"
            + "Ex: EnableAlarmActions <alarm-name>\n";

    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);/*w w  w  . j  a  v  a  2  s  .  co m*/
    }

    String alarmName = args[0];

    final AmazonCloudWatch cloudWatch = AmazonCloudWatchClientBuilder.defaultClient();

    EnableAlarmActionsRequest request = new EnableAlarmActionsRequest().withAlarmNames(alarmName);

    EnableAlarmActionsResult response = cloudWatch.enableAlarmActions(request);

    System.out.printf("Successfully enabled actions on alarm %s", alarmName);
}