use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project beam by apache.
the class KinesisSource method createClient.
private SimplifiedKinesisClient createClient(PipelineOptions options) {
AwsOptions awsOptions = options.as(AwsOptions.class);
KinesisClient kinesis;
CloudWatchClient cloudWatch;
if (spec.getAWSClientsProvider() != null) {
kinesis = spec.getAWSClientsProvider().getKinesisClient();
cloudWatch = spec.getAWSClientsProvider().getCloudWatchClient();
} else {
ClientConfiguration config = spec.getClientConfiguration();
kinesis = ClientBuilderFactory.buildClient(awsOptions, KinesisClient.builder(), config);
cloudWatch = ClientBuilderFactory.buildClient(awsOptions, CloudWatchClient.builder(), config);
}
return new SimplifiedKinesisClient(kinesis, cloudWatch, spec.getRequestRecordsLimit(), Instant::now);
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteAlarm method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " <alarmName>\n\n" + "Where:\n" + " alarmName - an alarm name to delete (for example, MyAlarm).\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String alarmName = args[0];
Region region = Region.US_EAST_2;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
deleteCWAlarm(cw, alarmName);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class DescribeAlarms method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
desCWAlarms(cw);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class GetMetricData method main.
public static void main(String[] args) {
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
getMetData(cw);
cw.close();
}
use of software.amazon.awssdk.services.cloudwatch.CloudWatchClient in project aws-doc-sdk-examples by awsdocs.
the class EnableAlarmActions method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " EnableAlarmActions <alarmName>\n\n" + "Where:\n" + " alarmName - an alarm name to enable (for example, MyAlarm).\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String alarm = args[0];
Region region = Region.US_EAST_1;
CloudWatchClient cw = CloudWatchClient.builder().region(region).build();
enableActions(cw, alarm);
cw.close();
}
Aggregations