use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class PutMetricData method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <dataPoint> \n\n" + "Where:\n" + " dataPoint - the value for the metric.\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
Double dataPoint = Double.parseDouble(args[0]);
Region region = Region.US_WEST_2;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
putMetData(cw, dataPoint);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class ListMetrics method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <namespace> \n\n" + "Where:\n" + " namespace - the namespace to filter against (for example, AWS/EC2). \n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String namespace = args[0];
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
listMets(cw, namespace);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class DisableAlarmActions method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " DisableAlarmActions <alarmName>\n\n" + "Where:\n" + " alarmName - an alarm name to disable (for example, MyAlarm).\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String alarmName = args[0];
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
disableActions(cw, alarmName);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class PutMetricAlarm method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <alarmName> <instanceId> \n\n" + "Where:\n" + " alarmName - an alarm name to use.\n" + " instanceId - an instance Id value .\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String alarmName = args[0];
String instanceId = args[1];
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
putMetricAlarm(cw, alarmName, instanceId);
cw.close();
}
Aggregations